iapclient

package
v0.0.0-...-e046750 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

README

Go Reference

golang.org/x/build/internal/iapclient

Package iapclient enables programmatic access to IAP-secured services.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCClient

func GRPCClient(ctx context.Context, addr string) (*grpc.ClientConn, error)

GRPCClient returns a *gprc.ClientConn that can access Go's IAP-protected servers. It will prompt for login if necessary.

func HTTPClient

func HTTPClient(ctx context.Context) (*http.Client, error)

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

type AuthenticationError struct {
	Description string
	Err         error
}

AuthenticationError records an authentication error.

func (AuthenticationError) Error

func (ar AuthenticationError) Error() string

func (AuthenticationError) Unwrap

func (ar AuthenticationError) Unwrap() error

Jump to

Keyboard shortcuts

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