-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
30 lines (26 loc) · 996 Bytes
/
types.go
File metadata and controls
30 lines (26 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package keysmith
import (
"time"
"github.com/xraph/keysmith/id"
"github.com/xraph/keysmith/key"
"github.com/xraph/keysmith/policy"
)
// CreateKeyInput contains the parameters for creating a new API key.
type CreateKeyInput struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Prefix string `json:"prefix"`
Environment key.Environment `json:"environment"`
PolicyID *id.PolicyID `json:"policy_id,omitempty"`
Scopes []string `json:"scopes,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
// ValidationResult is returned from key validation.
type ValidationResult struct {
Key *key.Key `json:"key"`
Scopes []string `json:"scopes"`
Policy *policy.Policy `json:"policy,omitempty"`
}