Documentation ¶
Index ¶
- func DummyAuth(c *web.C, h http.Handler) http.Handler
- func DummyLoginHandler(w http.ResponseWriter, r *http.Request)
- func DummyLogoutHandler(w http.ResponseWriter, r *http.Request)
- type Auth
- type GithubAuth
- func (a *GithubAuth) AuthCallbackHandler(w http.ResponseWriter, r *http.Request)
- func (a *GithubAuth) AuthorizeOrForbid(c *web.C, h http.Handler) http.Handler
- func (a *GithubAuth) AuthorizeOrForbidAdmin(c *web.C, h http.Handler) http.Handler
- func (a *GithubAuth) ExpireDisplayName(h http.Handler) http.Handler
- func (a *GithubAuth) LoginHandler(w http.ResponseWriter, r *http.Request)
- func (a *GithubAuth) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (a *GithubAuth) User(r *http.Request) *User
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DummyLoginHandler ¶
func DummyLoginHandler(w http.ResponseWriter, r *http.Request)
DummyLoginHandler logs the unknown user in automatically.
func DummyLogoutHandler ¶
func DummyLogoutHandler(w http.ResponseWriter, r *http.Request)
DummyLogoutHandler logs the unknown user out.
Types ¶
type Auth ¶
type Auth interface { AuthorizeOrForbid(c *web.C, h http.Handler) http.Handler AuthorizeOrForbidAdmin(c *web.C, h http.Handler) http.Handler ExpireDisplayName(h http.Handler) http.Handler LoginHandler(w http.ResponseWriter, r *http.Request) LogoutHandler(w http.ResponseWriter, r *http.Request) AuthCallbackHandler(w http.ResponseWriter, r *http.Request) User(r *http.Request) *User }
Auth is the interface managing user auth flow
type GithubAuth ¶
type GithubAuth struct { RequiredOrg string // If empty, membership will not be tested AdminTeam string LoginURL string LoginTTL time.Duration CookieStore *sessions.CookieStore // contains filtered or unexported fields }
GithubAuth is an object managing the auth flow with github
func (*GithubAuth) AuthCallbackHandler ¶
func (a *GithubAuth) AuthCallbackHandler(w http.ResponseWriter, r *http.Request)
AuthCallbackHandler receives the callback portion of the auth flow
func (*GithubAuth) AuthorizeOrForbid ¶
AuthorizeOrForbid requires the user be logged in and a member of the proper org (therefore allowed write access to Ace schemas), else 403s.
func (*GithubAuth) AuthorizeOrForbidAdmin ¶
AuthorizeOrForbidAdmin requires the user be logged in and a member of the admin team (therefore allowed write access to maintenance modes and Kinesis streams), else 403s.
func (*GithubAuth) ExpireDisplayName ¶
func (a *GithubAuth) ExpireDisplayName(h http.Handler) http.Handler
ExpireDisplayName expires the display name if the github auth is no longer valid.
func (*GithubAuth) LoginHandler ¶
func (a *GithubAuth) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler handles the login portion of the auth flow
func (*GithubAuth) LogoutHandler ¶
func (a *GithubAuth) LogoutHandler(w http.ResponseWriter, r *http.Request)
LogoutHandler handles the logout step of the auth flow