| 7 | ) |
| 8 | |
| 9 | type 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 |
| 23 | func GenerateKey() (string, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected