Documentation
¶
Overview ¶
Package access keeps the named API keys issued by the gateway.
Index ¶
- Constants
- func ConfigureLAN(on, rotate bool) error
- func Managed(secret string) bool
- func MigrateLegacyLANKey() error
- func MigrateLegacyLANKeyBestEffort()
- func Path() string
- func Restore(keys []Key) error
- func Update(action string, in Change) (string, error)
- func WithIdentity(ctx context.Context, who Identity) context.Context
- type Change
- type Identity
- type Key
Constants ¶
View Source
const Prefix = "sk-magpie-key-"
Variables ¶
This section is empty.
Functions ¶
func ConfigureLAN ¶
ConfigureLAN starts sharing with a named key. Rotation preserves the key's identity, name and enabled state.
func MigrateLegacyLANKey ¶
func MigrateLegacyLANKey() error
MigrateLegacyLANKey makes the old Settings key a normal, revocable caller key. Keep LANKey for older Magpie versions; LANKeyID marks a completed migration so the retained credential cannot resurrect a removed key.
func MigrateLegacyLANKeyBestEffort ¶
func MigrateLegacyLANKeyBestEffort()
Types ¶
type Identity ¶
type Identity struct{ KeyID, KeyName string }
func Authenticate ¶
Authenticate reloads the store so revocation takes effect in running gateways.
type Key ¶
type Key struct {
ID string `json:"id"`
Name string `json:"name"`
Off bool `json:"off,omitempty"`
LAN bool `json:"lan,omitempty"` // default key and durable migration marker
Secret string `json:"secret,omitempty"`
Masked string `json:"masked,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.