Atlas › Test

TestTokenCredentials_PropagatesFetchError

Exact test identity: go.temporal.io/server/common/rpc/auth/TestTokenCredentials_PropagatesFetchError

Package
go.temporal.io/server/common/rpc/auth
Suite / test hierarchy
TestTokenCredentials_PropagatesFetchError
Test
TestTokenCredentials_PropagatesFetchError
Introduced at
token_credentials.go ×1 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
11
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/rpc/auth/token_credentials.go 11 covered LOC · 3 ranges

Open complete file

21 headerName string,
22 fetchToken func(context.Context) (string, error),
23 > ) *TokenCredentials { token_credentials.go
24 > return &TokenCredentials{
25 > headerName: headerName,
26 > fetchToken: fetchToken,
27 > }
28 > }
29
30 > func (c *TokenCredentials) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { token_credentials.go
31 > token, err := c.fetchToken(ctx)
32 > if err != nil {
33 > return nil, err token_credentials.go
34 > }
35 if token == "" {
36 return nil, nil