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

Function overrideSubjectTokenGood

credentials/sts/sts_test.go:155–161  ·  view source on GitHub ↗

Overrides the subject token read to return a const which we can compare in our tests.

()

Source from the content-addressed store, hash-verified

153// Overrides the subject token read to return a const which we can compare in
154// our tests.
155func overrideSubjectTokenGood() func() {
156 origReadSubjectTokenFrom := readSubjectTokenFrom
157 readSubjectTokenFrom = func(string) ([]byte, error) {
158 return []byte(subjectTokenContents), nil
159 }
160 return func() { readSubjectTokenFrom = origReadSubjectTokenFrom }
161}
162
163// Overrides the subject token read to always return an error.
164func overrideSubjectTokenError() func() {

Calls

no outgoing calls

Tested by

no test coverage detected