MCPcopy
hub / github.com/grpc/grpc-go / overrideNewCredsFuncs

Function overrideNewCredsFuncs

credentials/google/google_test.go:83–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81)
82
83func overrideNewCredsFuncs() func() {
84 origNewTLS := newTLS
85 newTLS = func() credentials.TransportCredentials {
86 return testTLS
87 }
88 origNewALTS := newALTS
89 newALTS = func() credentials.TransportCredentials {
90 return testALTS
91 }
92 origNewADC := newADC
93 newADC = func(context.Context) (credentials.PerRPCCredentials, error) {
94 // We do not use perRPC creds in this test. It is safe to return nil here.
95 return nil, nil
96 }
97
98 return func() {
99 newTLS = origNewTLS
100 newALTS = origNewALTS
101 newADC = origNewADC
102 }
103}
104
105// TestClientHandshakeBasedOnClusterName that by default (without switching
106// modes), ClientHandshake does either tls or alts base on the cluster name in

Calls

no outgoing calls

Tested by

no test coverage detected