// Handler returns the authenticate service's HTTP request multiplexer, and routes.
Handler returns the authenticate service's HTTP request multiplexer, and routes.
// Handler returns the authenticate service ' s HTTP request multiplexer and routes .
func (a *Authenticate) Handler() http.Handler {
	stdMiddleware := middleware.NewChain()
	stdMiddleware = stdMiddleware.Append(middleware.Healthcheck("/ping", version.UserAgent()))
	stdMiddleware = stdMiddleware.Append(middleware.NewHandler(log.Logger))
	stdMiddleware = stdMiddleware.Append(middleware.AccessHandler(
		func(r *http.Request, status, size int, duration time.Duration) {
			middleware.FromRequest(r).Debug().
				Str("method", r.Method).
				Str("url", r.URL.String()).
				Int("status", status).
				Int("size", size).
				Dur("duration", duration).
				Msg("authenticate: request")
		}))
	stdMiddleware = stdMiddleware.Append(middleware.SetHeaders(securityHeaders))
	stdMiddleware = stdMiddleware.Append(middleware.ForwardedAddrHandler("fwd_ip"))
	stdMiddleware = stdMiddleware.Append(middleware.RemoteAddrHandler("ip"))
	stdMiddleware = stdMiddleware.Append(middleware.UserAgentHandler("user_agent"))
	stdMiddleware = stdMiddleware.Append(middleware.RefererHandler("referer"))
	stdMiddleware = stdMiddleware.Append(middleware.RequestIDHandler("req_id", "Request-Id"))
	validateSignatureMiddleware := stdMiddleware.Append(
		middleware.ValidateSignature(a.SharedKey),
		middleware.ValidateRedirectURI(a.RedirectURL))
	mux := http.NewServeMux()
	mux.Handle("/robots.txt", stdMiddleware.ThenFunc(a.RobotsTxt))
	mux.Handle("/start", stdMiddleware.ThenFunc(a.OAuthStart))
	mux.Handle("/oauth2/callback", stdMiddleware.ThenFunc(a.OAuthCallback))
	mux.Handle("/sign_in", validateSignatureMiddleware.ThenFunc(a.SignIn))
	mux.Handle("/sign_out", validateSignatureMiddleware.ThenFunc(a.SignOut)) 
	return mux
}
func ( a * Authenticate ) Handler ( ) http . Handler { stdMiddleware := middleware . NewChain ( ) stdMiddleware = stdMiddleware . Append ( middleware . Healthcheck ( " " , version . UserAgent ( ) ) ) stdMiddleware = stdMiddleware . Append ( middleware . NewHandler ( log . Logger ) ) stdMiddleware = stdMiddleware . Append ( middleware . AccessHandler ( func ( r * http . Request , status , size int , duration time . Duration ) { middleware . FromRequest ( r ) . Debug ( ) . Str ( " " , r . Method ) . Str ( " " , r . URL . String ( ) ) . Int ( " " , status ) . Int ( " " , size ) . Dur ( " " , duration ) . Msg ( " " ) } ) ) stdMiddleware = stdMiddleware . Append ( middleware . SetHeaders ( securityHeaders ) ) stdMiddleware = stdMiddleware . Append ( middleware . ForwardedAddrHandler ( " " ) ) stdMiddleware = stdMiddleware . Append ( middleware . RemoteAddrHandler ( " " ) ) stdMiddleware = stdMiddleware . Append ( middleware . UserAgentHandler ( " " ) ) stdMiddleware = stdMiddleware . Append ( middleware . RefererHandler ( " " ) ) stdMiddleware = stdMiddleware . Append ( middleware . RequestIDHandler ( " " , " " ) ) validateSignatureMiddleware := stdMiddleware . Append ( middleware . ValidateSignature ( a . SharedKey ) , middleware . ValidateRedirectURI ( a . RedirectURL ) ) mux := http . NewServeMux ( ) mux . Handle ( " " , stdMiddleware . ThenFunc ( a . RobotsTxt ) ) mux . Handle ( " " , stdMiddleware . ThenFunc ( a . OAuthStart ) ) mux . Handle ( " " , stdMiddleware . ThenFunc ( a . OAuthCallback ) ) mux . Handle ( " " , validateSignatureMiddleware . ThenFunc ( a . SignIn ) ) mux . Handle ( " " , validateSignatureMiddleware . ThenFunc ( a . SignOut ) ) return mux }
Handler returns the authenticate service's HTTP request multiplexer, and routes.
Handler returns the authenticate service ' s HTTP request multiplexer and routes .
// set up our standard middlewares // Identity Provider (IdP) callback endpoints and callbacks // authenticate-server endpoints // GET POST