Documentation
¶
Index ¶
- Variables
- func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator
- func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator
- func Authorized() runtime.Authorizer
- func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator
- func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator
- func BasicAuthRealm(realm string, authenticate UserPassAuthentication) runtime.Authenticator
- func BasicAuthRealmCtx(realm string, authenticate UserPassAuthenticationCtx) runtime.Authenticator
- func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator
- func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator
- func FailedBasicAuth(r *http.Request) string
- func FailedBasicAuthCtx(ctx context.Context) string
- func HTTPAuthenticator(handler func(*http.Request) (bool, any, error)) runtime.Authenticator
- func HttpAuthenticator(handler func(*http.Request) (bool, any, error)) runtime.Authenticatordeprecated
- func OAuth2SchemeName(r *http.Request) string
- func OAuth2SchemeNameCtx(ctx context.Context) string
- func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, any, error)) runtime.Authenticator
- type ScopedAuthRequest
- type ScopedTokenAuthentication
- type ScopedTokenAuthenticationCtx
- type TokenAuthentication
- type TokenAuthenticationCtx
- type UserPassAuthentication
- type UserPassAuthenticationCtx
Constants ¶
This section is empty.
Variables ¶
var DefaultRealmName = "API"
Functions ¶
func APIKeyAuth ¶
func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator
APIKeyAuth creates an authenticator that uses a token for authorization. This token can be obtained from either a header or a query string.
func APIKeyAuthCtx ¶
func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator
APIKeyAuthCtx creates an authenticator that uses a token for authorization with support for context.Context. This token can be obtained from either a header or a query string.
func Authorized ¶
func Authorized() runtime.Authorizer
Authorized provides a default implementation of the [Authorizer] interface where all requests are authorized (successful).
func BasicAuth ¶
func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator
BasicAuth creates a basic auth authenticator with the provided authentication function.
func BasicAuthCtx ¶
func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator
BasicAuthCtx creates a basic auth authenticator with the provided authentication function with support for context.Context.
func BasicAuthRealm ¶
func BasicAuthRealm(realm string, authenticate UserPassAuthentication) runtime.Authenticator
BasicAuthRealm creates a basic auth authenticator with the provided authentication function and realm name.
func BasicAuthRealmCtx ¶
func BasicAuthRealmCtx(realm string, authenticate UserPassAuthenticationCtx) runtime.Authenticator
BasicAuthRealmCtx creates a basic auth authenticator with the provided authentication function and realm name with support for context.Context.
func BearerAuth ¶
func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator
BearerAuth for use with oauth2 flows.
func BearerAuthCtx ¶
func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator
BearerAuthCtx for use with oauth2 flows with support for context.Context.
func FailedBasicAuth ¶
func FailedBasicAuthCtx ¶
func HTTPAuthenticator ¶ added in v0.31.0
HTTPAuthenticator is a function that authenticates a HTTP request.
func HttpAuthenticator
deprecated
HttpAuthenticator aliases HTTPAuthenticator for backward-compatibility.
Deprecated: use HTTPAuthenticator instead.
func OAuth2SchemeName ¶
func OAuth2SchemeNameCtx ¶
func ScopedAuthenticator ¶
func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, any, error)) runtime.Authenticator
ScopedAuthenticator is a function that authenticates an http.Request against a list of valid scopes.
Types ¶
type ScopedAuthRequest ¶
ScopedAuthRequest contains both the http.Request and the required scopes for a particular operation.
type ScopedTokenAuthentication ¶
ScopedTokenAuthentication validates a bearer/OAuth2 token along with the scopes required for the operation.
Implementations comparing the token against a known value MUST use crypto/subtle.ConstantTimeCompare; the runtime delegates the comparison here and does not enforce a constant-time posture on the caller's behalf.
type ScopedTokenAuthenticationCtx ¶
type ScopedTokenAuthenticationCtx func(context.Context, string, []string) (context.Context, any, error)
ScopedTokenAuthenticationCtx is the context.Context-aware variant of ScopedTokenAuthentication. The same constant-time-comparison guidance applies.
type TokenAuthentication ¶
TokenAuthentication validates an API-key token.
Implementations comparing the token against a known value MUST use crypto/subtle.ConstantTimeCompare; the runtime delegates the comparison here and does not enforce a constant-time posture on the caller's behalf.
type TokenAuthenticationCtx ¶
TokenAuthenticationCtx is the context.Context-aware variant of TokenAuthentication. The same constant-time-comparison guidance applies.
type UserPassAuthentication ¶
UserPassAuthentication validates a basic-auth credential.
Implementations comparing the password (or any derived secret) against a known value MUST use crypto/subtle.ConstantTimeCompare: the runtime extracts the credential from the request and delegates the comparison here, and does not enforce a constant-time posture on the caller's behalf.
type UserPassAuthenticationCtx ¶
UserPassAuthenticationCtx is the context.Context-aware variant of UserPassAuthentication. The same constant-time-comparison guidance applies.