Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureBoltBucketExists ¶
func LookupBoltJson ¶
func StoreBoltJson ¶
Types ¶
type AuthenticatedHandler ¶
type AuthenticatedHandler func(w http.ResponseWriter, r *http.Request, credentials *Credentials)
Like an http.HandleFunc, but accepts a credentials object as a third argument.
type Credentials ¶
type Credentials struct {
// Shortname of site they are authenticated with
Site string
// Oauth token for user.
Token *oauth2.Token
// Http client with oauth credentials ready to go.
Client *http.Client
}
Container for a user's oauth credentials
type SSO ¶
type SSO interface {
//Redirect the request to the provider's authorization page
RedirectToLogin(w http.ResponseWriter, r *http.Request)
//Handle callback from authorization page. This needs to be hosted at the url that is registered with the provider.
ExchangeCodeForToken(w http.ResponseWriter, r *http.Request)
//Lookup the credentials for a given request from the cookie. Will return nil if no valid cookie is found.
LookupToken(r *http.Request) *Credentials
//Basic http handler that looks up the token for you and provides credentials to your handler. Credentials may be nil.
Handle(handler AuthenticatedHandler) http.HandlerFunc
//Select a handler based on whether the user has a valid cookie or not.
Route(loggedOut http.HandlerFunc, loggedIn AuthenticatedHandler) http.HandlerFunc
ClearCookie(w http.ResponseWriter)
}
Core interface for working with a third-party website
Click to show internal directories.
Click to hide internal directories.