Atlas › Test

TestTokenCredentials_RequireTransportSecurity

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

Package
go.temporal.io/server/common/rpc/auth
Suite / test hierarchy
TestTokenCredentials_RequireTransportSecurity
Test
TestTokenCredentials_RequireTransportSecurity
Introduced at
token_credentials.go ×1 Frontier kind: Joint frontier
Covered ranges
2
Covered lines
9
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 9 covered LOC · 2 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) {
42
43 // RequireTransportSecurity returns true so the bearer never attaches to plaintext dials, per RFC 9700.
44 > func (c *TokenCredentials) RequireTransportSecurity() bool { token_credentials.go
45 > return true
46 > }