Documentation
¶
Overview ¶
Package proxiap provides methods and structs to handle authentication to resources behind Google's Identity-Aware Proxy (IAP).
Package proxiap provides methods and structs to handle authentication to resources behind Google's Identity-Aware Proxy (IAP).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIapClient ¶
NewIapClient returns a new http.Client with a Transport that handles IAP authentication. If iapId is empty, it returns nil.
func SetIapTransport ¶
SetIapTransport replaces http.Transport in the provided http.Client with a one that will handle authentication behind IAP. If iapId is empty, it returns the same clie
func TokensourceInit ¶
func TokensourceInit(ctx context.Context, audience string, opts ...option.ClientOption) oauth2.TokenSource
TokensourceInit initializes a new TokenSource using the provided audience and client options. It panics if it encounters an error during initialization.
Types ¶
type IapAuthTransport ¶
type IapAuthTransport struct { Transport http.RoundTripper Tokensource oauth2.TokenSource CurrentToken oauth2.Token }
IapAuthTransport is a custom http.RoundTripper that adds IAP authentication to the http.Requests. It assumes a default service account with permission to access the resource.