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

Method GetRequestMetadata

credentials/oauth/oauth.go:130–138  ·  view source on GitHub ↗
(ctx context.Context, _ ...string)

Source from the content-addressed store, hash-verified

128}
129
130func (oa oauthAccess) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) {
131 ri, _ := credentials.RequestInfoFromContext(ctx)
132 if err := credentials.CheckSecurityLevel(ri.AuthInfo, credentials.PrivacyAndIntegrity); err != nil {
133 return nil, fmt.Errorf("unable to transfer oauthAccess PerRPCCredentials: %v", err)
134 }
135 return map[string]string{
136 "authorization": oa.token.Type() + " " + oa.token.AccessToken,
137 }, nil
138}
139
140func (oa oauthAccess) RequireTransportSecurity() bool {
141 return true

Callers

nothing calls this directly

Calls 4

RequestInfoFromContextFunction · 0.92
CheckSecurityLevelFunction · 0.92
ErrorfMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected