Documentation
¶
Index ¶
- Variables
- type GoogleOIDC
- func (g *GoogleOIDC) AddAuth(ctx context.Context, r *http.Request, params interface{}) error
- func (g *GoogleOIDC) Name() string
- func (g *GoogleOIDC) OptionalParams() []string
- func (g *GoogleOIDC) ParseParams(m map[string]interface{}) (interface{}, error)
- func (g *GoogleOIDC) RequiredParams() []string
- type GoogleOIDCAuth
- func (g *GoogleOIDCAuth) Authenticate(ctx context.Context, r *http.Request, params interface{}) bool
- func (g *GoogleOIDCAuth) Identify(r *http.Request, params interface{}) (string, bool)
- func (g *GoogleOIDCAuth) Name() string
- func (g *GoogleOIDCAuth) OptionalParams() []string
- func (g *GoogleOIDCAuth) ParseParams(m map[string]interface{}) (interface{}, error)
- func (g *GoogleOIDCAuth) RequiredParams() []string
- func (g *GoogleOIDCAuth) StripAuth(r *http.Request, params interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var CertsURL = "https://www.googleapis.com/oauth2/v3/certs"
CertsURL is the endpoint returning Google public signing keys. It can be overridden in tests.
View Source
var HTTPClient = &http.Client{Timeout: 5 * time.Second}
HTTPClient is used for metadata requests and can be overridden in tests.
View Source
var MetadataHost = "http://metadata.google.internal"
MetadataHost is the base URL for the metadata server. It is overridden in tests.
Functions ¶
This section is empty.
Types ¶
type GoogleOIDC ¶
type GoogleOIDC struct{}
GoogleOIDC obtains an identity token from the GCP metadata server and sets it on outgoing requests.
func (*GoogleOIDC) Name ¶
func (g *GoogleOIDC) Name() string
func (*GoogleOIDC) OptionalParams ¶
func (g *GoogleOIDC) OptionalParams() []string
func (*GoogleOIDC) ParseParams ¶
func (g *GoogleOIDC) ParseParams(m map[string]interface{}) (interface{}, error)
func (*GoogleOIDC) RequiredParams ¶
func (g *GoogleOIDC) RequiredParams() []string
type GoogleOIDCAuth ¶
type GoogleOIDCAuth struct{}
GoogleOIDCAuth validates Google issued ID tokens from incoming requests.
func (*GoogleOIDCAuth) Authenticate ¶
func (*GoogleOIDCAuth) Identify ¶
func (g *GoogleOIDCAuth) Identify(r *http.Request, params interface{}) (string, bool)
Identify returns the token's subject claim when present.
func (*GoogleOIDCAuth) Name ¶
func (g *GoogleOIDCAuth) Name() string
func (*GoogleOIDCAuth) OptionalParams ¶
func (g *GoogleOIDCAuth) OptionalParams() []string
func (*GoogleOIDCAuth) ParseParams ¶
func (g *GoogleOIDCAuth) ParseParams(m map[string]interface{}) (interface{}, error)
func (*GoogleOIDCAuth) RequiredParams ¶
func (g *GoogleOIDCAuth) RequiredParams() []string
func (*GoogleOIDCAuth) StripAuth ¶ added in v0.2.0
func (g *GoogleOIDCAuth) StripAuth(r *http.Request, params interface{})
StripAuth removes the Authorization header from the request.
Click to show internal directories.
Click to hide internal directories.