Table of Contents

Interface IApiKey

Namespace
BiExcellence.OpenBi.Api.ApiKeys
Assembly
BiExcellence.OpenBi.Api.Client.dll

An API key: a non-interactive credential. Its Id and Secret are the client_id and client_secret that CreateAccessTokenAsync(IOpenBiApiClient, string, string, string?, CancellationToken) sends with the client_credentials grant, and the token it returns acts as the user the key belongs to.

public interface IApiKey

Properties

Created

When the key was created. Set by the server.

DateTimeOffset Created { get; init; }

Property Value

DateTimeOffset

Id

The key's id, which is also its OAuth2 client_id. Generated by the server when left unset on create.

string? Id { get; init; }

Property Value

string

LastUsed

When an access token was last issued for the key, null if never. Set by the server.

DateTimeOffset? LastUsed { get; init; }

Property Value

DateTimeOffset?

Name

The display name of the key, so its owner can tell several keys apart.

string? Name { get; init; }

Property Value

string

Scope

The permission ids the key may use, space delimited, as openbi.<resource>.<read|write|delete>. Empty or null means unrestricted, not powerless: a token then gets the permissions of the key's user. A key that names scopes gets those, and a token request may narrow them further. A token never gets a permission the key's user does not hold when it is issued; such a scope is dropped.

string? Scope { get; init; }

Property Value

string

Secret

The key's OAuth2 client_secret, in the one response that generates it - a create, or CreateApiKeySecretAsync(IOpenBiApiClient, string, CancellationToken) - and null in every other: the server keeps only a hash. Ignored in a request.

string? Secret { get; init; }

Property Value

string

UserId

The username of the user the key acts as. Always the calling user, unless the caller holds openbi.user.write; left unset on an update, the owner stays.

string? UserId { get; init; }

Property Value

string