Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("credential not found")
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Get(key string) ([]byte, error)
Set(key string, value []byte) error
Delete(key string) error
}
func NewFileBackend ¶
NewFileBackend stores each opaque credential key in its own private file. The key is hashed instead of normalized so character replacement cannot collapse distinct profile names to the same filesystem name.
func NewNativeBackendForRoot ¶ added in v0.1.9
NewNativeBackendForRoot 在应用根目录内保存 Linux ProxyCommand 主机密钥, 供 WSL 与无桌面环境使用,不依赖桌面 Keyring。
type Repository ¶
type Repository struct {
Backend Backend
}
func (Repository) Delete ¶
func (r Repository) Delete(profile string) error
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type,omitempty"`
ClientID string `json:"client_id"`
Site string `json:"site"`
ExpiresAt time.Time `json:"expires_at"`
RefreshedAt time.Time `json:"refreshed_at"`
}
Token is the sensitive OAuth state stored in the operating system's native credential store. It must never be serialized into config.toml or logs.