Documentation
¶
Overview ¶
Package handshaker provides ALTS handshaking functionality for GCP.
Index ¶
- func NewClientHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, ...) (core.Handshaker, error)
- func NewServerHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, ...) (core.Handshaker, error)
- func ResetConcurrentHandshakeSemaphoreForTesting(numberOfAllowedHandshakes int64)
- type ClientHandshakerOptions
- type ServerHandshakerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientHandshaker ¶
func NewClientHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, opts *ClientHandshakerOptions) (core.Handshaker, error)
NewClientHandshaker creates a core.Handshaker that performs a client-side ALTS handshake by acting as a proxy between the peer and the ALTS handshaker service in the metadata server.
func NewServerHandshaker ¶
func NewServerHandshaker(_ context.Context, conn *grpc.ClientConn, c net.Conn, opts *ServerHandshakerOptions) (core.Handshaker, error)
NewServerHandshaker creates a core.Handshaker that performs a server-side ALTS handshake by acting as a proxy between the peer and the ALTS handshaker service in the metadata server.
func ResetConcurrentHandshakeSemaphoreForTesting ¶ added in v1.57.0
func ResetConcurrentHandshakeSemaphoreForTesting(numberOfAllowedHandshakes int64)
ResetConcurrentHandshakeSemaphoreForTesting resets the handshake semaphores to allow numberOfAllowedHandshakes concurrent handshakes each.
Types ¶
type ClientHandshakerOptions ¶
type ClientHandshakerOptions struct {
// ClientIdentity is the handshaker client local identity.
ClientIdentity *altspb.Identity
// TargetName is the server service account name for secure name
// checking.
TargetName string
// TargetServiceAccounts contains a list of expected target service
// accounts. One of these accounts should match one of the accounts in
// the handshaker results. Otherwise, the handshake fails.
TargetServiceAccounts []string
// RPCVersions specifies the gRPC versions accepted by the client.
RPCVersions *altspb.RpcProtocolVersions
// BoundAccessToken is a bound access token to be sent to the server for authentication.
BoundAccessToken string
}
ClientHandshakerOptions contains the client handshaker options that can provided by the caller.
func DefaultClientHandshakerOptions ¶
func DefaultClientHandshakerOptions() *ClientHandshakerOptions
DefaultClientHandshakerOptions returns the default client handshaker options.
type ServerHandshakerOptions ¶
type ServerHandshakerOptions struct {
// RPCVersions specifies the gRPC versions accepted by the server.
RPCVersions *altspb.RpcProtocolVersions
}
ServerHandshakerOptions contains the server handshaker options that can provided by the caller.
func DefaultServerHandshakerOptions ¶
func DefaultServerHandshakerOptions() *ServerHandshakerOptions
DefaultServerHandshakerOptions returns the default client handshaker options.