Documentation
¶
Index ¶
- Variables
- type AuthConfig
- type AuthType
- type BasicAuthProvider
- type Credential
- type CredentialsStore
- func (c *CredentialsStore) Add(username string, password string) error
- func (c *CredentialsStore) Check(username, password string) bool
- func (c *CredentialsStore) CheckRequest(b BasicAuthProvider) bool
- func (c *CredentialsStore) Load(r io.Reader) error
- func (c *CredentialsStore) Remove(username string) error
- func (c *CredentialsStore) Snapshot(w io.Writer) error
- func (c *CredentialsStore) Update(username, newPassword string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Basic = AuthType("Basic") Noop = AuthType("Noop") )
View Source
var ( ErrUnsupportedAuthType = errors.New("unsupported auth type") )
View Source
var ( ErrUserExists = errors.New("user exists") ErrUserNotExists = errors.New("user not exists") )
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type BasicAuthProvider ¶
BasicAuthProvider is the interface an object must support to return basic auth information.
type Credential ¶
type Credential struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
Credential represents authentication and authorization configuration for a single user.
type CredentialsStore ¶
type CredentialsStore struct {
// contains filtered or unexported fields
}
CredentialsStore stores authentication and authorization information for all users.
func NewCredentialsStore ¶
func NewCredentialsStore() *CredentialsStore
NewCredentialsStore returns a new instance of a CredentialStore.
func (*CredentialsStore) Add ¶
func (c *CredentialsStore) Add(username string, password string) error
Add adds a Account
func (*CredentialsStore) Check ¶
func (c *CredentialsStore) Check(username, password string) bool
Check returns true if the password is correct for the given username.
func (*CredentialsStore) CheckRequest ¶
func (c *CredentialsStore) CheckRequest(b BasicAuthProvider) bool
CheckRequest returns true if b contains a valid username and password.
func (*CredentialsStore) Load ¶
func (c *CredentialsStore) Load(r io.Reader) error
Load loads credential information from a reader.
func (*CredentialsStore) Remove ¶
func (c *CredentialsStore) Remove(username string) error
Remove removes a Account
func (*CredentialsStore) Snapshot ¶
func (c *CredentialsStore) Snapshot(w io.Writer) error
Snapshot takes a snapshot
func (*CredentialsStore) Update ¶
func (c *CredentialsStore) Update(username, newPassword string) error
Update updates a Account
Click to show internal directories.
Click to hide internal directories.