Documentation
¶
Index ¶
- func HandleAuthRequest[AuthModel any](authHandler Handler[AuthModel], r *http.Request) (AuthModel, error)
- type APIKeyAuthConfig
- type APIKeyAuthHandlerFunc
- type APIKeyAuthType
- func (t APIKeyAuthType[AuthModel]) GetDescription() string
- func (t APIKeyAuthType[AuthModel]) GetFieldName() string
- func (t APIKeyAuthType[AuthModel]) GetFormat() string
- func (t APIKeyAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
- func (t APIKeyAuthType[AuthModel]) GetIn() oapi.In
- func (t APIKeyAuthType[AuthModel]) GetName() string
- func (t APIKeyAuthType[AuthModel]) GetType() openapiModels.AuthType
- type AuthHandlerFunc
- type BasicAuthConfig
- type BasicAuthHandlerFunc
- type BasicAuthType
- func (t BasicAuthType[AuthModel]) GetDescription() string
- func (t BasicAuthType[AuthModel]) GetFieldName() string
- func (t BasicAuthType[AuthModel]) GetFormat() string
- func (t BasicAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
- func (t BasicAuthType[AuthModel]) GetIn() oapi.In
- func (t BasicAuthType[AuthModel]) GetName() string
- func (t BasicAuthType[AuthModel]) GetType() openapiModels.AuthType
- type BearerAuthConfig
- type BearerAuthHandlerFunc
- type BearerAuthType
- func (t BearerAuthType[AuthModel]) GetDescription() string
- func (t BearerAuthType[AuthModel]) GetFieldName() string
- func (t BearerAuthType[AuthModel]) GetFormat() string
- func (t BearerAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
- func (t BearerAuthType[AuthModel]) GetIn() oapi.In
- func (t BearerAuthType[AuthModel]) GetName() string
- func (t BearerAuthType[AuthModel]) GetType() openapiModels.AuthType
- type Handler
- func APIKeyAuth[AuthModel any](handler APIKeyAuthHandlerFunc[AuthModel], config APIKeyAuthConfig) Handler[AuthModel]
- func BasicAuth[AuthModel any](handler BasicAuthHandlerFunc[AuthModel], config BasicAuthConfig) Handler[AuthModel]
- func BearerAuth[AuthModel any](handler BearerAuthHandlerFunc[AuthModel], config BearerAuthConfig) Handler[AuthModel]
- func SessionCookieAuth[AuthModel any](handler SessionCookieAuthHandlerFunc[AuthModel], ...) Handler[AuthModel]
- type SessionCookieAuthConfig
- type SessionCookieAuthHandlerFunc
- type SessionCookieAuthType
- func (t SessionCookieAuthType[AuthModel]) GetDescription() string
- func (t SessionCookieAuthType[AuthModel]) GetFieldName() string
- func (t SessionCookieAuthType[AuthModel]) GetFormat() string
- func (t SessionCookieAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
- func (t SessionCookieAuthType[AuthModel]) GetIn() oapi.In
- func (t SessionCookieAuthType[AuthModel]) GetName() string
- func (t SessionCookieAuthType[AuthModel]) GetType() openapiModels.AuthType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyAuthConfig ¶
type APIKeyAuthHandlerFunc ¶
type APIKeyAuthHandlerFunc[AuthModel any] func(ctx context.Context, apiKey string) (AuthModel, error)
APIKeyAuthHandlerFunc is a function that handles API key authentication. This is the function that should be implemented by the user. It should return the user model if the API key is valid, otherwise it should return an error.
type APIKeyAuthType ¶
type APIKeyAuthType[AuthModel any] struct { Name string FieldName string In oapi.In Description string Handler APIKeyAuthHandlerFunc[AuthModel] }
func (APIKeyAuthType[AuthModel]) GetDescription ¶
func (t APIKeyAuthType[AuthModel]) GetDescription() string
func (APIKeyAuthType[AuthModel]) GetFieldName ¶
func (t APIKeyAuthType[AuthModel]) GetFieldName() string
func (APIKeyAuthType[AuthModel]) GetFormat ¶
func (t APIKeyAuthType[AuthModel]) GetFormat() string
func (APIKeyAuthType[AuthModel]) GetHandler ¶
func (t APIKeyAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
func (APIKeyAuthType[AuthModel]) GetIn ¶
func (t APIKeyAuthType[AuthModel]) GetIn() oapi.In
func (APIKeyAuthType[AuthModel]) GetName ¶
func (t APIKeyAuthType[AuthModel]) GetName() string
func (APIKeyAuthType[AuthModel]) GetType ¶
func (t APIKeyAuthType[AuthModel]) GetType() openapiModels.AuthType
type AuthHandlerFunc ¶
AuthHandlerFunc is a function that handles authentication for a route.
type BasicAuthConfig ¶
type BasicAuthHandlerFunc ¶
type BasicAuthHandlerFunc[AuthModel any] func(ctx context.Context, username, password string) (AuthModel, error)
BasicAuthHandlerFunc is a function that handles basic auth. This is the function that should be implemented by the user. It should return the user model if the username and password are valid, otherwise it should return an error.
type BasicAuthType ¶
type BasicAuthType[AuthModel any] struct { Name string Description string Handler BasicAuthHandlerFunc[AuthModel] }
func (BasicAuthType[AuthModel]) GetDescription ¶
func (t BasicAuthType[AuthModel]) GetDescription() string
func (BasicAuthType[AuthModel]) GetFieldName ¶
func (t BasicAuthType[AuthModel]) GetFieldName() string
func (BasicAuthType[AuthModel]) GetFormat ¶
func (t BasicAuthType[AuthModel]) GetFormat() string
func (BasicAuthType[AuthModel]) GetHandler ¶
func (t BasicAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
func (BasicAuthType[AuthModel]) GetIn ¶
func (t BasicAuthType[AuthModel]) GetIn() oapi.In
func (BasicAuthType[AuthModel]) GetName ¶
func (t BasicAuthType[AuthModel]) GetName() string
func (BasicAuthType[AuthModel]) GetType ¶
func (t BasicAuthType[AuthModel]) GetType() openapiModels.AuthType
type BearerAuthConfig ¶
type BearerAuthHandlerFunc ¶
type BearerAuthHandlerFunc[AuthModel any] func(ctx context.Context, token string) (AuthModel, error)
BearerAuthHandlerFunc is a function that handles bearer token authentication. This is the function that should be implemented by the user. It should return the user model if the token is valid, otherwise it should return an error.
type BearerAuthType ¶
type BearerAuthType[AuthModel any] struct { Name string Format string Description string Handler BearerAuthHandlerFunc[AuthModel] }
func (BearerAuthType[AuthModel]) GetDescription ¶
func (t BearerAuthType[AuthModel]) GetDescription() string
func (BearerAuthType[AuthModel]) GetFieldName ¶
func (t BearerAuthType[AuthModel]) GetFieldName() string
func (BearerAuthType[AuthModel]) GetFormat ¶
func (t BearerAuthType[AuthModel]) GetFormat() string
func (BearerAuthType[AuthModel]) GetHandler ¶
func (t BearerAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
func (BearerAuthType[AuthModel]) GetIn ¶
func (t BearerAuthType[AuthModel]) GetIn() oapi.In
func (BearerAuthType[AuthModel]) GetName ¶
func (t BearerAuthType[AuthModel]) GetName() string
func (BearerAuthType[AuthModel]) GetType ¶
func (t BearerAuthType[AuthModel]) GetType() openapiModels.AuthType
type Handler ¶
type Handler[AuthModel any] interface { GetType() openapiModels.AuthType GetName() string GetFieldName() string GetFormat() string GetDescription() string GetIn() oapi.In GetHandler() AuthHandlerFunc[AuthModel] }
func APIKeyAuth ¶
func APIKeyAuth[AuthModel any]( handler APIKeyAuthHandlerFunc[AuthModel], config APIKeyAuthConfig, ) Handler[AuthModel]
APIKeyAuth creates an API key auth handler with configuration
func BasicAuth ¶
func BasicAuth[AuthModel any]( handler BasicAuthHandlerFunc[AuthModel], config BasicAuthConfig, ) Handler[AuthModel]
BasicAuth creates a basic auth handler with configuration
func BearerAuth ¶
func BearerAuth[AuthModel any]( handler BearerAuthHandlerFunc[AuthModel], config BearerAuthConfig, ) Handler[AuthModel]
BearerAuth creates a bearer auth handler with configuration
func SessionCookieAuth ¶
func SessionCookieAuth[AuthModel any]( handler SessionCookieAuthHandlerFunc[AuthModel], config SessionCookieAuthConfig[AuthModel], ) Handler[AuthModel]
SessionCookieAuth creates a session cookie auth handler with configuration
type SessionCookieAuthConfig ¶
type SessionCookieAuthHandlerFunc ¶
type SessionCookieAuthHandlerFunc[AuthModel any] func(ctx context.Context, cookie string) (AuthModel, error)
SessionCookieAuthHandlerFunc is a function that handles session cookie authentication. This is the function that should be implemented by the user. It should return the user model if the API key is valid, otherwise it should return an error.
type SessionCookieAuthType ¶
type SessionCookieAuthType[AuthModel any] struct { CookieName string Description string Handler SessionCookieAuthHandlerFunc[AuthModel] }
func (SessionCookieAuthType[AuthModel]) GetDescription ¶
func (t SessionCookieAuthType[AuthModel]) GetDescription() string
func (SessionCookieAuthType[AuthModel]) GetFieldName ¶
func (t SessionCookieAuthType[AuthModel]) GetFieldName() string
func (SessionCookieAuthType[AuthModel]) GetFormat ¶
func (t SessionCookieAuthType[AuthModel]) GetFormat() string
func (SessionCookieAuthType[AuthModel]) GetHandler ¶
func (t SessionCookieAuthType[AuthModel]) GetHandler() AuthHandlerFunc[AuthModel]
func (SessionCookieAuthType[AuthModel]) GetIn ¶
func (t SessionCookieAuthType[AuthModel]) GetIn() oapi.In
func (SessionCookieAuthType[AuthModel]) GetName ¶
func (t SessionCookieAuthType[AuthModel]) GetName() string
func (SessionCookieAuthType[AuthModel]) GetType ¶
func (t SessionCookieAuthType[AuthModel]) GetType() openapiModels.AuthType