Documentation ¶
Index ¶
Constants ¶
View Source
const AuthDirName = "auth"
View Source
const AuthTokenSuffix = ".token"
Variables ¶
View Source
var ErrAuthNotFound error = fmt.Errorf("Authorization not found")
Functions ¶
Types ¶
type AuthClient ¶
AuthClient is an *http.Client that is able to automatically negotiate authentication with a server from an AuthStore.
type AuthStore ¶
type AuthStore interface { // Get reads and decodes the authentication token from storage. Get(schemeId string, endpoint string) (*TokenInfo, error) // Set stores an authentication token. Set(token *TokenInfo, endpoint string) error }
AuthTokenStore stores authentication tokens by their scheme and endpoint.
type FileAuthStore ¶
type FileAuthStore struct {
// contains filtered or unexported fields
}
FileAuthStore stores an affinity client's authentication credential in a directory structure with file naming convention.
func NewFileAuthStore ¶
func NewFileAuthStore(baseDir string) (*FileAuthStore, error)
NewFileAuthStore creates a new FileAuthStore at the given directory.
func (*FileAuthStore) Get ¶
func (s *FileAuthStore) Get(schemeId string, endpoint string) (*TokenInfo, error)
Get retrieves a token for a scheme and endpoint.
func (*FileAuthStore) Set ¶
func (s *FileAuthStore) Set(token *TokenInfo, endpoint string) error
Set stores a token.
Click to show internal directories.
Click to hide internal directories.