Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { PgConn *db.PostgresDriver Log *logrus.Logger // contains filtered or unexported fields }
Interface for Authentication handlers
func NewAuth ¶
func NewAuth(pg *db.PostgresDriver, log *logrus.Logger, oConf *oauth2.Config, redirectUrl string, gitCollabSecret string) *Auth
NewAuth returns initialized Auth handler struct
func (*Auth) GithubRedirectHandler ¶
func (a *Auth) GithubRedirectHandler(w http.ResponseWriter, r *http.Request)
GithubRedirectHandler get the redirect url for github, when login button is clicked, this will be returned to the frontend.
func (*Auth) LoginHandler ¶
func (a *Auth) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler handler for login, occurs when user returns from github redirect. Will first attempt to get code from request body, if valid retrieve a github access token. If this token is good, go ahead and create a JWT for frontend.
func (*Auth) LogoutHandler ¶
func (a *Auth) LogoutHandler(w http.ResponseWriter, r *http.Request)
LogoutHandler adds jwt to the blacklist, these will be picked up by the blacklist middleware and refuse access if found.
Click to show internal directories.
Click to hide internal directories.