Documentation
¶
Index ¶
- func RegisterAuthRoutes(oidc *iam.OIDC, mux *AuthMux) error
- func SetOriginHeader(h http.Handler) http.Handler
- type AuthMux
- func (p *AuthMux) Handle(pattern string, handler http.Handler)
- func (p *AuthMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (p *AuthMux) HandleProtected(pattern string, handler http.Handler, checker iam.Checker, role string)
- func (p *AuthMux) HandleProtectedFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (p *AuthMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Options
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthRoutes ¶
RegisterAuthRoutes registers the OAuth2 authentication routes
func SetOriginHeader ¶
SetOriginHeader is middleware that copies the Origin header from the request to the response This is necessary when using AllowAllOrigins because the browser will complain if the response header is the "*" and not the same origin as on the request. The cors handler in the connect library doesn't do this by default.
Types ¶
type AuthMux ¶
type AuthMux struct {
// contains filtered or unexported fields
}
AuthMux wraps http.ServeMux to add protected route handling
func NewAuthMux ¶
NewAuthMux creates a new AuthMux
func (*AuthMux) HandleFunc ¶
HandleFunc registers a handler function for the given pattern
func (*AuthMux) HandleProtected ¶
func (p *AuthMux) HandleProtected(pattern string, handler http.Handler, checker iam.Checker, role string)
HandleProtected registers a protected handler for the given pattern
func (*AuthMux) HandleProtectedFunc ¶
func (p *AuthMux) HandleProtectedFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
HandleProtectedFunc registers a protected handler function for the given pattern
type Options ¶
type Options struct {
Telemetry *config.TelemetryConfig
Server *config.AssistantServerConfig
WebApp *pbcfg.WebAppConfig
IAMPolicy *api.IAMPolicy
}