Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAuthHandler(handler http.Handler, rejector Rejector) http.Handler
- func GetTeam(r *http.Request) (string, int, bool, bool)
- func IsAuthenticated(r *http.Request) bool
- func NewOAuthBeginHandler(logger lager.Logger, providerFactory ProviderFactory, ...) http.Handler
- func NewOAuthCallbackHandler(logger lager.Logger, providerFactory ProviderFactory, ...) http.Handler
- func NewOAuthHandler(logger lager.Logger, providerFactory ProviderFactory, ...) (http.Handler, error)
- func WrapHandler(handler http.Handler, validator Validator, userContextReader UserContextReader) http.Handler
- type AuthDB
- type BasicAuthRejector
- type BasicAuthValidator
- type CookieSetHandler
- type JWTReader
- type JWTValidator
- type NoopValidator
- type OAuthBeginHandler
- type OAuthCallbackHandler
- type OAuthState
- type ProviderFactory
- type RedirectRejector
- type Rejector
- type TokenGenerator
- type TokenType
- type TokenValue
- type UnauthorizedRejector
- type UserContextReader
- type Validator
- type ValidatorBasket
Constants ¶
View Source
const ( OAuthBegin = "OAuthBegin" OAuthCallback = "OAuthCallback" )
View Source
const CookieAge = 24 * time.Hour
View Source
const CookieName = "ATC-Authorization"
View Source
const OAuthStateCookie = "_concourse_oauth_state"
View Source
const TokenTypeBearer = "Bearer"
Variables ¶
View Source
var ErrUnparsableHeader = errors.New("cannot parse 'Authorization' header")
View Source
var OAuthRoutes = rata.Routes{ {Path: "/auth/:provider", Method: "GET", Name: OAuthBegin}, {Path: "/auth/:provider/callback", Method: "GET", Name: OAuthCallback}, }
View Source
var SigningMethod = jwt.SigningMethodRS256
Functions ¶
func CheckAuthHandler ¶
func IsAuthenticated ¶
func NewOAuthBeginHandler ¶
func NewOAuthBeginHandler( logger lager.Logger, providerFactory ProviderFactory, privateKey *rsa.PrivateKey, ) http.Handler
func NewOAuthCallbackHandler ¶
func NewOAuthCallbackHandler( logger lager.Logger, providerFactory ProviderFactory, privateKey *rsa.PrivateKey, db AuthDB, ) http.Handler
func NewOAuthHandler ¶
func NewOAuthHandler( logger lager.Logger, providerFactory ProviderFactory, signingKey *rsa.PrivateKey, db AuthDB, ) (http.Handler, error)
func WrapHandler ¶
Types ¶
type BasicAuthRejector ¶
type BasicAuthRejector struct{}
func (BasicAuthRejector) Unauthorized ¶
func (BasicAuthRejector) Unauthorized(w http.ResponseWriter, r *http.Request)
type BasicAuthValidator ¶
type BasicAuthValidator struct {
DB AuthDB
}
func (BasicAuthValidator) IsAuthenticated ¶
func (validator BasicAuthValidator) IsAuthenticated(r *http.Request) bool
IsAuthenticated basic authentication for login
type CookieSetHandler ¶
func (CookieSetHandler) ServeHTTP ¶
func (handler CookieSetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type JWTValidator ¶
func (JWTValidator) IsAuthenticated ¶
func (validator JWTValidator) IsAuthenticated(r *http.Request) bool
type NoopValidator ¶
type NoopValidator struct{}
func (NoopValidator) IsAuthenticated ¶
func (NoopValidator) IsAuthenticated(*http.Request) bool
type OAuthBeginHandler ¶
type OAuthBeginHandler struct {
// contains filtered or unexported fields
}
func (*OAuthBeginHandler) ServeHTTP ¶
func (handler *OAuthBeginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OAuthCallbackHandler ¶
type OAuthCallbackHandler struct {
// contains filtered or unexported fields
}
func (*OAuthCallbackHandler) ServeHTTP ¶
func (handler *OAuthCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OAuthState ¶
type OAuthState struct {
Redirect string `json:"redirect"`
}
type ProviderFactory ¶
type RedirectRejector ¶
type RedirectRejector struct {
Location string
}
func (RedirectRejector) Unauthorized ¶
func (rejector RedirectRejector) Unauthorized(w http.ResponseWriter, r *http.Request)
type TokenGenerator ¶
type TokenGenerator interface {
GenerateToken(expiration time.Time, teamName string, teamID int, isAdmin bool) (TokenType, TokenValue, error)
}
func NewTokenGenerator ¶
func NewTokenGenerator(privateKey *rsa.PrivateKey) TokenGenerator
type TokenValue ¶
type TokenValue string
type UnauthorizedRejector ¶
type UnauthorizedRejector struct{}
func (UnauthorizedRejector) Unauthorized ¶
func (UnauthorizedRejector) Unauthorized(w http.ResponseWriter, r *http.Request)
type UserContextReader ¶
type ValidatorBasket ¶
type ValidatorBasket []Validator
func (ValidatorBasket) IsAuthenticated ¶
func (vb ValidatorBasket) IsAuthenticated(r *http.Request) bool
Source Files
¶
- auth_db.go
- basic_auth_rejector.go
- basic_auth_validator.go
- check_auth_handler.go
- cookie_set_handler.go
- extract_username_and_password.go
- get_jwt.go
- get_team.go
- is_authenticated.go
- jwt_reader.go
- jwt_validator.go
- noop_validator.go
- oauth_begin_handler.go
- oauth_callback_handler.go
- oauth_handler.go
- oauth_routes.go
- redirect_rejector.go
- rejector.go
- token_generator.go
- unauthorized_rejector.go
- user_context_reader.go
- validator.go
- validator_basket.go
- wrap_handler.go
Directories
¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
fakes
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.