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

Interface PerRPCCredentials

credentials/credentials.go:38–52  ·  credentials/credentials.go::PerRPCCredentials

PerRPCCredentials defines the common interface for the credentials which need to attach security information to every RPC (e.g., oauth2).

Source from the content-addressed store, hash-verified

36// PerRPCCredentials defines the common interface for the credentials which need to
37// attach security information to every RPC (e.g., oauth2).
38type PerRPCCredentials interface {
39 // GetRequestMetadata gets the current request metadata, refreshing tokens
40 // if required. This should be called by the transport layer on each
41 // request, and the data should be populated in headers or other
42 // context. If a status code is returned, it will be used as the status for
43 // the RPC (restricted to an allowable set of codes as defined by gRFC
44 // A54). uri is the URI of the entry point for the request. When supported
45 // by the underlying implementation, ctx can be used for timeout and
46 // cancellation. Additionally, RequestInfo data will be available via ctx
47 // to this call.
48 GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
49 // RequireTransportSecurity indicates whether the credentials requires
50 // transport security.
51 RequireTransportSecurity() bool
52}
53
54// SecurityLevel defines the protection level on an established connection.
55//

Implementers 13

TokenSourcecredentials/oauth/oauth.go
jwtAccesscredentials/oauth/oauth.go
oauthAccesscredentials/oauth/oauth.go
serviceAccountcredentials/oauth/oauth.go
callCredscredentials/sts/sts.go
testPerRPCCredscredentials/google/google_test.go
dualPerRPCCredscredentials/google/google.go
jwtTokenFileCallCredscredentials/jwt/token_file_call_creds.
testPerRPCCredentialsbalancer/rls/control_channel_test.go
failPreRPCCredbalancer/grpclb/grpclb_test.go
methodTestCredstest/creds_test.go
testPerRPCCredentialstest/creds_test.go

Calls

no outgoing calls

Tested by

no test coverage detected