Documentation
¶
Index ¶
- Constants
- func GinContextFromCtx(ctx context.Context) (*gin.Context, error)
- func GinContextToContextMiddleware() gin.HandlerFunc
- func LogResponseMiddleware(out io.Writer) gin.HandlerFunc
- func NewAuthMiddleware(logger *zap.SugaredLogger, authn *auth.Authentication, ...) *authMiddleware
- func Open(databaseUrl string) *generated.Client
- func Run(env string) (<-chan error, error)
- type AuthState
- type Config
- type Handlers
- type OAuth2LoginMode
- type OAuth2Provider
- type OAuth2Providers
- type Server
- type ServerOption
Constants ¶
View Source
const ( ApiKeyHeaderKey = "x-api-key" AuthorizationHeaderKey = "authorization" )
View Source
const ValidationErrorSeparator = "$$$$"
Variables ¶
This section is empty.
Functions ¶
func GinContextFromCtx ¶
GinContext returns the gin context from the request context.
func GinContextToContextMiddleware ¶
func GinContextToContextMiddleware() gin.HandlerFunc
func LogResponseMiddleware ¶
func LogResponseMiddleware(out io.Writer) gin.HandlerFunc
func NewAuthMiddleware ¶
func NewAuthMiddleware( logger *zap.SugaredLogger, authn *auth.Authentication, client *generated.Client, ) *authMiddleware
Types ¶
type AuthState ¶
type AuthState struct {
Nonce string `json:"nonce"`
LoginMode OAuth2LoginMode `json:"login_mode"`
RedirectURI string `json:"redirect_uri"`
Signature string `json:"signature"`
}
type OAuth2LoginMode ¶
type OAuth2LoginMode string
const ( OAuth2LoginModeUser OAuth2LoginMode = "user" OAuth2LoginModeBroadcaster OAuth2LoginMode = "broadcaster" )
func (OAuth2LoginMode) Valid ¶
func (l OAuth2LoginMode) Valid() bool
type OAuth2Provider ¶
type OAuth2Provider interface {
rp.RelyingParty
}
type OAuth2Providers ¶
type OAuth2Providers map[OAuth2LoginMode]OAuth2Provider
type ServerOption ¶
type ServerOption func(*Server)
func WithMiddlewares ¶
func WithMiddlewares(mws ...gin.HandlerFunc) ServerOption
WithMiddlewares adds the given middlewares before registering the main routers.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.