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

Method IsValid

model/api_key.go:50–53  ·  view source on GitHub ↗

IsValid checks if the API key is valid

()

Source from the content-addressed store, hash-verified

48
49// IsValid checks if the API key is valid
50func (k *APIKey) IsValid() bool {
51 now := time.Now()
52 return !k.IsRevoked && now.Before(k.ExpiresAt)
53}
54
55// HasScope checks if the API key has the required scope
56func (k *APIKey) HasScope(scope string) bool {

Callers 5

TestAPIKey_IsValidFunction · 0.95
TokenizeIdentityFieldMethod · 0.80
AuthenticateMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestAPIKey_IsValidFunction · 0.76