MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / APIKey

Struct APIKey

model/api_key.go:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7)
8
9type APIKey struct {
10 APIKeyID string `json:"api_key_id" db:"api_key_id"`
11 Key string `json:"key" db:"key"`
12 Name string `json:"name" db:"name"`
13 OwnerID string `json:"owner_id" db:"owner_id"`
14 Scopes []string `json:"scopes" db:"scopes"`
15 ExpiresAt time.Time `json:"expires_at" db:"expires_at"`
16 CreatedAt time.Time `json:"created_at" db:"created_at"`
17 LastUsedAt time.Time `json:"last_used_at" db:"last_used_at"`
18 IsRevoked bool `json:"is_revoked" db:"is_revoked"`
19 RevokedAt *time.Time `json:"revoked_at,omitempty" db:"revoked_at"`
20}
21
22// GenerateKey creates a new secure API key
23func GenerateKey() (string, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected