Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyAuthDisabled = scopedkey.ErrAuthDisabled ErrKeyAdminRequired = scopedkey.ErrAdminRequired ErrKeyScopeRequired = scopedkey.ErrScopeRequired ErrKeySecretMissing = scopedkey.ErrSecretMissing ErrKeyInvalid = scopedkey.ErrInvalid ErrKeyExpired = scopedkey.ErrExpired )
Functions ¶
This section is empty.
Types ¶
type ScopedKeyClaims ¶
type ScopedKeyClaims struct {
Timestamp string `json:"t,omitempty"`
ExpiresAt string `json:"exp,omitempty"`
Admin *bool `json:"ad,omitempty"`
WorkspaceID string `json:"w,omitempty"`
PeerID string `json:"p,omitempty"`
SessionID string `json:"s,omitempty"`
}
func VerifyScopedKey ¶
func VerifyScopedKey(token, secret string, now time.Time) (ScopedKeyClaims, error)
type ScopedKeyParams ¶
type ScopedKeyResult ¶
type ScopedKeyResult struct {
Key string `json:"key"`
Claims ScopedKeyClaims `json:"claims"`
}
func CreateScopedKey ¶
func CreateScopedKey(params ScopedKeyParams) (ScopedKeyResult, error)
Click to show internal directories.
Click to hide internal directories.