Interface IApiKeyManagementService
User-facing service for API key management. All methods require the apikey:manage scope.
public interface IApiKeyManagementService
Methods
CreateKeyAsync(string, string, AccessLevel, string[], string[], DateTime?, IReadOnlyList<Tag>)
[RequireScope("apikey:manage")]
Task<IApiKey> CreateKeyAsync(string teamKey, string name, AccessLevel accessLevel, string[] roles = null, string[] scopeOverrides = null, DateTime? expiryDate = null, IReadOnlyList<Tag> tags = null)
Parameters
teamKeystringnamestringaccessLevelAccessLevelrolesstring[]scopeOverridesstring[]expiryDateDateTime?tagsIReadOnlyList<Tag>
Returns
CreateSystemKeyAsync(string, string[], DateTime?)
[RequireScope("apikey:system-manage")]
Task<IApiKey> CreateSystemKeyAsync(string name, string[] scopes, DateTime? expiryDate = null)
Parameters
Returns
DeleteKeyAsync(string, string)
[RequireScope("apikey:manage")]
Task DeleteKeyAsync(string teamKey, string key)
Parameters
Returns
DeleteSystemKeyAsync(string)
[RequireScope("apikey:system-manage")]
Task DeleteSystemKeyAsync(string key)
Parameters
keystring
Returns
GetKeysAsync(string)
[RequireScope("apikey:manage")]
IAsyncEnumerable<IApiKey> GetKeysAsync(string teamKey)
Parameters
teamKeystring
Returns
GetSystemKeysAsync()
[RequireScope("apikey:system-manage")]
IAsyncEnumerable<IApiKey> GetSystemKeysAsync()
Returns
LockKeyAsync(string, string)
[RequireScope("apikey:manage")]
Task LockKeyAsync(string teamKey, string key)
Parameters
Returns
LockSystemKeyAsync(string)
[RequireScope("apikey:system-manage")]
Task LockSystemKeyAsync(string key)
Parameters
keystring
Returns
RefreshKeyAsync(string, string)
[RequireScope("apikey:manage")]
Task<IApiKey> RefreshKeyAsync(string teamKey, string key)
Parameters
Returns
RefreshSystemKeyAsync(string)
[RequireScope("apikey:system-manage")]
Task<IApiKey> RefreshSystemKeyAsync(string key)
Parameters
keystring
Returns
SetRolesAsync(string, string, string[])
[RequireScope("apikey:manage")]
Task SetRolesAsync(string teamKey, string key, string[] roles)
Parameters
Returns
SetScopeOverridesAsync(string, string, string[])
[RequireScope("apikey:manage")]
Task SetScopeOverridesAsync(string teamKey, string key, string[] scopes)