keys

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 2 Imported by: 0

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 ScopedKeyParams struct {
	WorkspaceID string
	PeerID      string
	SessionID   string
	ExpiresAt   time.Time
	AuthEnabled bool
	Admin       bool
	Secret      string
	Now         time.Time
}

type ScopedKeyResult

type ScopedKeyResult struct {
	Key    string          `json:"key"`
	Claims ScopedKeyClaims `json:"claims"`
}

func CreateScopedKey

func CreateScopedKey(params ScopedKeyParams) (ScopedKeyResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL