MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / CreateAPIKey

Method CreateAPIKey

internal/identity/store.go:3386–3388  ·  view source on GitHub ↗

CreateAPIKey issues a fresh ACCOUNT-scoped API key for the user. expiresAt is the optional hard expiration; pass nil to issue a never-expiring key (the backward-compatible default). This is the account-tier convenience wrapper over CreateScopedAPIKey — the self-host default key.

(ctx context.Context, userID, name string, expiresAt *time.Time)

Source from the content-addressed store, hash-verified

3384// backward-compatible default). This is the account-tier convenience wrapper
3385// over CreateScopedAPIKey — the self-host default key.
3386func (s *Store) CreateAPIKey(ctx context.Context, userID, name string, expiresAt *time.Time) (*APIKey, error) {
3387 return s.CreateScopedAPIKey(ctx, userID, name, ScopeAccount, "", expiresAt)
3388}
3389
3390// CreateScopedAPIKey issues a fresh API key with an explicit scope (Slice 5a).
3391// - ScopeAccount: account-wide admin; agentID must be empty; prefix e2a_acct_.

Callers 15

TestCreateAPIKeyFunction · 0.95
TestListAPIKeysFunction · 0.95
TestDeleteAPIKeyFunction · 0.95
TestGetUserByAPIKeyFunction · 0.95
StartContractServerFunction · 0.95
newAPIWithIdempotencyFunction · 0.95
mainFunction · 0.95
writeCLIHandoffPageMethod · 0.80

Implementers 1

Storeinternal/identity/store.go

Calls 1

CreateScopedAPIKeyMethod · 0.95