Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenNotFound = errors.New("no token found")
ErrTokenNotFound is returned when a token is not found
Functions ¶
This section is empty.
Types ¶
type AuthenticateService ¶
type AuthenticateService interface {
// Authenticate the user with the given host.
// The function will return a user name and a token if the authentication is successful.
Authenticate(ctx context.Context, host string, verify Verify) (string, *Token, error)
}
AuthenticateService is an interface that defines a method for authenticating users.
type DeviceAuthResponse ¶
type DeviceAuthResponse struct {
// VerificationURI is the URI where the user can verify the authentication.
VerificationURI string
// UserCode is the code that the user needs to enter to verify the authentication.
UserCode string
}
DeviceAuthResponse represents the response from a device authentication request.
type TokenEntry ¶
TokenEntry represents a stored token with its host and owner
func (TokenEntry) String ¶
func (t TokenEntry) String() string
type TokenService ¶
type TokenService interface {
// Get retrieves a token for the specified host and owner
Get(host, owner string) (Token, error)
// Set stores a token for the specified host and owner
Set(host, owner string, token Token) error
// Delete removes a token for the specified host and owner
Delete(host, owner string) error
// Has checks if a token exists for the specified host and owner
Has(host, owner string) bool
// Entries returns all stored token entries
Entries() []TokenEntry
store.Content
}
TokenService provides access to authentication tokens
func NewTokenService ¶
func NewTokenService() TokenService
type TokenStore ¶
type TokenStore store.Store[TokenService]
TokenStore is a service for saving and loading tokens
Click to show internal directories.
Click to hide internal directories.