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
Click to show internal directories.
Click to hide internal directories.