Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(ctx context.Context, config *gcpjwt.IAMConfig, audience string) func(http.Handler) http.Handler
NewHandler will return a middleware that will try and validate tokens in incoming HTTP requests. The token is expected as a Bearer token in the Authorization header and expected to have an Issuer claim equal to the ServiceAccount the provided IAMConfig is configured for. This will also validate the Audience claim to the one provided, or use https:// + request.Host if blank. NOTE: If using the signJwt method, you MUST call gcpjwt.SigningMethodIAMJWT.Override().
Complimentary to https://github.com/someone1/gcp-jwt-go/oauth2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.