Documentation ¶
Overview ¶
Package iapclient enables programmatic access to IAP-secured services. See https://cloud.google.com/iap/docs/authentication-howto.
Login will be done as necessary using offline browser-based authentication, similarly to gcloud auth login. Credentials will be stored in the user's config directory.
Index ¶
- func GRPCClient(ctx context.Context, addr string) (*grpc.ClientConn, error)
- func HTTPClient(ctx context.Context) (*http.Client, error)
- func TokenSource(ctx context.Context) (oauth2.TokenSource, error)
- func TokenSourceForceLogin(ctx context.Context) (oauth2.TokenSource, error)
- type AuthenticationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCClient ¶
GRPCClient returns a *gprc.ClientConn that can access Go's IAP-protected servers. It will prompt for login if necessary.
func HTTPClient ¶
HTTPClient returns an http.Client that can be used to access Go's IAP-protected sites. It will prompt for login if necessary.
func TokenSource ¶
func TokenSource(ctx context.Context) (oauth2.TokenSource, error)
TokenSource returns a TokenSource that can be used to access Go's IAP-protected sites. It will prompt for login if necessary.
func TokenSourceForceLogin ¶
func TokenSourceForceLogin(ctx context.Context) (oauth2.TokenSource, error)
TokenSource returns a TokenSource that can be used to access Go's IAP-protected sites. It will delete any existing authentication token credentials and prompt for login.
Types ¶
type AuthenticationError ¶
AuthenticationError records an authentication error.
func (AuthenticationError) Error ¶
func (ar AuthenticationError) Error() string
func (AuthenticationError) Unwrap ¶
func (ar AuthenticationError) Unwrap() error