Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth( authHandler func(ctx huma.Context, username, password string) (nextCtx huma.Context, allow bool), basicRealm string, ) func(ctx huma.Context, next func(huma.Context))
BasicAuth is a middleware that checks for basic auth credentials in the Authorization header. If the credentials are not present or are incorrect, it will return a 401 Unauthorized response. If the credentials are correct, it will call the next middleware in the chain. The authHandler function should return the next context and a boolean indicating if the request should be allowed. The basicRealm is the realm to use in the WWW-Authenticate header.
func SetCtxTransformers ¶
SetCtxTransformers sets transformers slice to the context key. These transformers will be applied to the response in the humaApiWrapper.Transform method. It's for internal library usage, and it will work only if you use `hureg` lib registration functions.
Types ¶
This section is empty.