12#define RECORD_API_TOKENS "api_tokens"
13#define API_TOKENS_LENGTH (32)
14#define API_TOKENS_SHORT_ID_LENGTH (8)
19 ApiApiTokensEntryTypeHashed,
20 ApiApiTokensEntryTypeFull,
21 ApiApiTokensEntryTypeMax,
22} ApiApiTokensEntryType;
28 ApiApiTokensEntryType type;
40typedef void (*ApiTokenInfoCallback)(
const ApiTokensEntry* entry,
void* context);
53 ApiTokenInfoCallback callback,
void api_tokens_list(ApiTokens *tokens, ApiTokenInfoCallback callback, void *context)
List all HTTP API access tokens.
Definition api_tokens.c:357
void api_tokens_mint(ApiTokens *tokens, const char *owner, ApiTokenInfoCallback callback, void *context)
Generates a new HTTP API access token.
Definition api_tokens.c:315
bool api_tokens_validate_and_record_usage(ApiTokens *tokens, const char *full_token)
Check that the provided access token is valid, and update its last_used_at property.
Definition api_tokens.c:421
bool api_tokens_revoke(ApiTokens *tokens, const char *short_id)
Revoke one HTTP API access token.
Definition api_tokens.c:371
void api_tokens_reset_all(ApiTokens *tokens)
Revoke all HTTP API access tokens.
Definition api_tokens.c:403
Information about an HTTP API access token.
Definition api_tokens.h:27
Definition api_tokens.c:29
TIME (Simple Network Time Protocol) service API.