Documentation
¶
Index ¶
- Constants
- func Authenticate(doc *UsersFile, principal, token string) error
- func FindDefaultRemote(cfg *remoteapi.AuthConfig) (*remoteapi.RemoteConfig, bool)
- func GenerateKey() (string, error)
- func GenerateToken() (string, error)
- func HashToken(token string) string
- func LoadAuthConfig(path string) (*remoteapi.AuthConfig, error)
- func LoadKey(path string) ([]byte, error)
- func SaveAuthConfig(path string, cfg *remoteapi.AuthConfig) error
- func SaveUsers(path string, doc *UsersFile) error
- func UpsertRemote(cfg *remoteapi.AuthConfig, remote remoteapi.RemoteConfig)
- func UpsertUser(doc *UsersFile, user User)
- func VerifyToken(token, hash string) bool
- type Identity
- type Issuer
- type StoreVerifier
- type User
- type UsersFile
- type Verifier
Constants ¶
View Source
const HashPrefix = "sha256:"
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func FindDefaultRemote ¶
func FindDefaultRemote(cfg *remoteapi.AuthConfig) (*remoteapi.RemoteConfig, bool)
func GenerateKey ¶
GenerateKey returns a 32-byte random HMAC key as hex.
func GenerateToken ¶
func LoadAuthConfig ¶
func LoadAuthConfig(path string) (*remoteapi.AuthConfig, error)
func SaveAuthConfig ¶
func SaveAuthConfig(path string, cfg *remoteapi.AuthConfig) error
func UpsertRemote ¶
func UpsertRemote(cfg *remoteapi.AuthConfig, remote remoteapi.RemoteConfig)
func UpsertUser ¶
func VerifyToken ¶
Types ¶
type StoreVerifier ¶
StoreVerifier checks signature, expiry, principal, and jti revocation against the DB.
Click to show internal directories.
Click to hide internal directories.