method

App.CreateAPIKey

func (application *App) CreateAPIKey( ctx context.Context, sessionToken, name string, expiresAt time.Time, ) (APIKey, error)

Mint a revocable API bearer secret for a current session.

Source core/auth.go:569

@param ctx
The ctx value.
@param sessionToken
The sessionToken value.
@param name
The name value.
@param expiresAt
The expiresAt value.
@returns
The declared result.

Requires AuthConfig.APIKeys. The raw Key is returned once; lists expose APIKeyInfo only.

Related types

  • App

    A resolved application bound to operation services.

  • APIKey

    A newly minted API key and its one-time secret.