mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
// ==========================================================================
|
|
// AppClients.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using Squidex.Infrastructure;
|
|
|
|
namespace Squidex.Domain.Apps.Core.Apps
|
|
{
|
|
public sealed class AppClients : DictionaryBase<string, AppClient>
|
|
{
|
|
public void Add(string id, AppClient client)
|
|
{
|
|
Guard.NotNullOrEmpty(id, nameof(id));
|
|
Guard.NotNull(client, nameof(client));
|
|
|
|
Inner.Add(id, client);
|
|
}
|
|
|
|
public void Add(string id, string secret)
|
|
{
|
|
Guard.NotNullOrEmpty(id, nameof(id));
|
|
|
|
Inner.Add(id, new AppClient(id, secret, AppClientPermission.Editor));
|
|
}
|
|
|
|
public void Revoke(string id)
|
|
{
|
|
Guard.NotNullOrEmpty(id, nameof(id));
|
|
|
|
Inner.Remove(id);
|
|
}
|
|
}
|
|
}
|
|
|