package transport
import "cloud.google.com/go/auth/internal/transport"
Package transport provided internal helpers for the two transport packages (grpctransport and httptransport).
Index ¶
- func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions
- func DefaultHTTPClientWithTLS(tlsConfig *tls.Config) *http.Client
- func GetClientCertificateProvider(opts *Options) (cert.Provider, error)
- func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error)
- func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context, string, string) (net.Conn, error), error)
- func GetS2AAddress() string
- func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain string) error
- type Options
Functions ¶
func CloneDetectOptions ¶
func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions
CloneDetectOptions clones a user set detect option into some new memory that we can internally manipulate before sending onto the detect package.
func DefaultHTTPClientWithTLS ¶
DefaultHTTPClientWithTLS constructs an HTTPClient using the provided tlsConfig, to support mTLS.
func GetClientCertificateProvider ¶
GetClientCertificateProvider returns a default client certificate source, if not provided by the user.
A nil default source can be returned if the source does not exist. Any exceptions encountered while initializing the default source will be reported as client error (ex. corrupt metadata file).
func GetGRPCTransportCredsAndEndpoint ¶
func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error)
GetGRPCTransportCredsAndEndpoint returns an instance of google.golang.org/grpc/credentials.TransportCredentials, and the corresponding endpoint to use for GRPC client.
func GetHTTPTransportConfig ¶
func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context, string, string) (net.Conn, error), error)
GetHTTPTransportConfig returns a client certificate source and a function for dialing MTLS with S2A.
func GetS2AAddress ¶
func GetS2AAddress() string
GetS2AAddress returns the S2A address to be reached via plaintext connection. Returns empty string if not set or invalid.
func ValidateUniverseDomain ¶
ValidateUniverseDomain verifies that the universe domain configured for the client matches the universe domain configured for the credentials.
Types ¶
type Options ¶
type Options struct {
Endpoint string
DefaultMTLSEndpoint string
DefaultEndpointTemplate string
ClientCertProvider cert.Provider
Client *http.Client
UniverseDomain string
EnableDirectPath bool
EnableDirectPathXds bool
}
Options is a struct that is duplicated information from the individual transport packages in order to avoid cyclic deps. It correlates 1:1 with fields on httptransport.Options and grpctransport.Options.
Source Files ¶
cba.go s2a.go transport.go
Directories ¶
| Path | Synopsis |
|---|---|
| internal/transport/cert | |
| internal/transport/cert/cmd | test_signer.go is a net/rpc server that listens on stdin/stdout, exposing mock methods for testing enterprise certificate proxy flow. |
- Version
- v0.6.1
- Published
- Jul 1, 2024
- Platform
- darwin/amd64
- Imports
- 21 packages
- Last checked
- 44 minutes ago –
Tools for package owners.