Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
Basic config for authentication
func (Basic) Authenticate ¶
Authenticate implements the docshelf.Authenticator interface. It looks the user up by email and hashes their given password using bcrypt. If the hash matches what was returned from the userStore, the login is successful.
type Github ¶
type Github struct { ClientID string ClientSecret string // contains filtered or unexported fields }
Github config for authenticating through oauth.
func NewGithub ¶
NewGithub creates a new Github authenticator with the given clientID and clientSecret.
func (Github) Authenticate ¶
Authenticate implements the dochself.Authenticator interface. It takes a temporary auth code and uses it to request an access token from github. If authorization is successful, the primary email for the authorized user is used to login or. The email argument is completely ignored, but required to implement the docshelf.Authenticator interface.
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
Google config for oauth authentication.
func (Google) Authenticate ¶
Authenticate implements the docshelf.Authenticator interface. The email is ignored and the token is expected to be a google auth ID token. The token is validated using google's public keys and the email and name are extracted from the verified JWT claims. If the ID token is valid, then auth is successful.