Table of Contents

Interface IApiKeyManagementService

Namespace
Tharga.Team
Assembly
Tharga.Team.dll

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

teamKey string
name string
accessLevel AccessLevel
roles string[]
scopeOverrides string[]
expiryDate DateTime?
tags IReadOnlyList<Tag>

Returns

Task<IApiKey>

CreateSystemKeyAsync(string, string[], DateTime?)

[RequireScope("apikey:system-manage")]
Task<IApiKey> CreateSystemKeyAsync(string name, string[] scopes, DateTime? expiryDate = null)

Parameters

name string
scopes string[]
expiryDate DateTime?

Returns

Task<IApiKey>

DeleteKeyAsync(string, string)

[RequireScope("apikey:manage")]
Task DeleteKeyAsync(string teamKey, string key)

Parameters

teamKey string
key string

Returns

Task

DeleteSystemKeyAsync(string)

[RequireScope("apikey:system-manage")]
Task DeleteSystemKeyAsync(string key)

Parameters

key string

Returns

Task

GetKeysAsync(string)

[RequireScope("apikey:manage")]
IAsyncEnumerable<IApiKey> GetKeysAsync(string teamKey)

Parameters

teamKey string

Returns

IAsyncEnumerable<IApiKey>

GetSystemKeysAsync()

[RequireScope("apikey:system-manage")]
IAsyncEnumerable<IApiKey> GetSystemKeysAsync()

Returns

IAsyncEnumerable<IApiKey>

LockKeyAsync(string, string)

[RequireScope("apikey:manage")]
Task LockKeyAsync(string teamKey, string key)

Parameters

teamKey string
key string

Returns

Task

LockSystemKeyAsync(string)

[RequireScope("apikey:system-manage")]
Task LockSystemKeyAsync(string key)

Parameters

key string

Returns

Task

RefreshKeyAsync(string, string)

[RequireScope("apikey:manage")]
Task<IApiKey> RefreshKeyAsync(string teamKey, string key)

Parameters

teamKey string
key string

Returns

Task<IApiKey>

RefreshSystemKeyAsync(string)

[RequireScope("apikey:system-manage")]
Task<IApiKey> RefreshSystemKeyAsync(string key)

Parameters

key string

Returns

Task<IApiKey>

SetRolesAsync(string, string, string[])

[RequireScope("apikey:manage")]
Task SetRolesAsync(string teamKey, string key, string[] roles)

Parameters

teamKey string
key string
roles string[]

Returns

Task

SetScopeOverridesAsync(string, string, string[])

[RequireScope("apikey:manage")]
Task SetScopeOverridesAsync(string teamKey, string key, string[] scopes)

Parameters

teamKey string
key string
scopes string[]

Returns

Task