googleoidc

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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) AddAuth

func (g *GoogleOIDC) AddAuth(ctx context.Context, r *http.Request, params interface{}) error

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 (g *GoogleOIDCAuth) Authenticate(ctx context.Context, r *http.Request, params interface{}) bool

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.

Jump to

Keyboard shortcuts

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