Documentation
¶
Index ¶
- Constants
- Variables
- func AddUploadIDContext(next http.Handler) http.Handler
- func InitStore(config appconfig.OauthConfig) error
- func TracingMiddleware(next http.Handler) http.Handler
- type AuthMiddleware
- type Claims
- type HTTPError
- type IntrospectionResponse
- type UserSession
- func (s *UserSession) Data() UserSessionData
- func (s *UserSession) Delete(r *http.Request, w http.ResponseWriter) error
- func (s *UserSession) SetRedirect(r *http.Request, w http.ResponseWriter, redirect string) error
- func (s *UserSession) SetToken(r *http.Request, w http.ResponseWriter, token string, expiry int) error
- type UserSessionData
Constants ¶
View Source
const LoginRedirectCookieName = "login_redirect"
View Source
const UserSessionCookieName = "phdo_session"
Variables ¶
View Source
var ErrAuthHeaderInvalidFormat = errors.New("authorization header format is invalid")
View Source
var ErrNoAuthHeader = errors.New("authorization header missing")
View Source
var ErrTokenNotFound = errors.New("authorization token not found")
View Source
var UploadID key
Functions ¶
func InitStore ¶
func InitStore(config appconfig.OauthConfig) error
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthMiddleware ¶
func NewAuthMiddleware(ctx context.Context, config appconfig.OauthConfig) (*AuthMiddleware, error)
func (AuthMiddleware) Validator ¶
func (a AuthMiddleware) Validator() oauth.Validator
func (AuthMiddleware) VerifyOAuthTokenMiddleware ¶
func (a AuthMiddleware) VerifyOAuthTokenMiddleware(next http.Handler) http.Handler
func (AuthMiddleware) VerifyUserSession ¶
func (a AuthMiddleware) VerifyUserSession(next http.Handler) http.Handler
type HTTPError ¶
func NewHTTPError ¶
type IntrospectionResponse ¶
type UserSession ¶
type UserSession struct {
// contains filtered or unexported fields
}
func GetUserSession ¶
func GetUserSession(r *http.Request) (*UserSession, error)
func (*UserSession) Data ¶
func (s *UserSession) Data() UserSessionData
func (*UserSession) Delete ¶
func (s *UserSession) Delete(r *http.Request, w http.ResponseWriter) error
func (*UserSession) SetRedirect ¶
func (s *UserSession) SetRedirect(r *http.Request, w http.ResponseWriter, redirect string) error
func (*UserSession) SetToken ¶
func (s *UserSession) SetToken(r *http.Request, w http.ResponseWriter, token string, expiry int) error
type UserSessionData ¶
Click to show internal directories.
Click to hide internal directories.