auth

package module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizationHeader = "Authorization"

AuthorizationHeader const for header used for authorization token

Variables

This section is empty.

Functions

This section is empty.

Types

type GCloudServiceAccount

type GCloudServiceAccount struct {
	ServiceAccount string
}

GCloudServiceAccount is a middleware that will check AuthorizationHeader for incoming request. The expected header value is an OpenID Token generated by Google Cloud for given ServiceAccount.

func (GCloudServiceAccount) Doc

func (m GCloudServiceAccount) Doc(builder *openapi.DocBuilder) error

Doc implements the openapi.Documented interface

func (GCloudServiceAccount) IsEligible added in v0.2.1

func (m GCloudServiceAccount) IsEligible(r *http.Request) bool

IsEligible checks if the request is eligible for the middleware

func (GCloudServiceAccount) VerifyServiceAccount added in v0.0.3

func (m GCloudServiceAccount) VerifyServiceAccount(r *http.Request, token string) error

VerifyServiceAccount check if the token was sent by a gcloud service account

func (GCloudServiceAccount) Wrap

Wrap implements the handler.Middleware interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL