Documentation ¶
Overview ¶
Package clalbauthn functionality for dealing with requests that passed trough AWS ALB authentication action.
Index ¶
- func AccessToken(ctx context.Context) string
- func ClaimData(ctx context.Context) string
- func Identity(ctx context.Context) string
- func Provide() fx.Option
- func WithAccessToken(ctx context.Context, token string) context.Context
- func WithClaimData(ctx context.Context, data string) context.Context
- func WithIdentity(ctx context.Context, identity string) context.Context
- type Authentication
- type Config
- type UnauthenticatedHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
AccessToken returns the x-amzn-oidc-accesstoken value, or an empty string.
func WithAccessToken ¶
WithAccessToken returns a context with the token value.
func WithClaimData ¶
WithClaimData returns a context with the claim data value.
Types ¶
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
Authentication provides middleware that adds the AWS ALB authentication claims in the request context.
func New ¶
func New(cfg Config, unauthf UnauthenticatedHandler) *Authentication
New inits the authentication middleware.
type Config ¶
type Config struct { // If this is set the middleware will NOT return a 401 if the request does not have all the authn headers. AllowUnauthenticated bool `env:"ALLOW_UNAUTHENTICATED"` }
Config configures this package.
type UnauthenticatedHandler ¶
type UnauthenticatedHandler func(w http.ResponseWriter, msg string, code int)
UnauthenticatedHandler provides a handler for when the request is unauthenticated.
Click to show internal directories.
Click to hide internal directories.