34 #ifndef GRPCXX_SECURITY_CREDENTIALS_H 35 #define GRPCXX_SECURITY_CREDENTIALS_H 48 class ChannelArguments;
50 class SecureChannelCredentials;
51 class CallCredentials;
52 class SecureCallCredentials;
67 const std::shared_ptr<ChannelCredentials>& channel_creds,
68 const std::shared_ptr<CallCredentials>& call_creds);
75 const std::shared_ptr<ChannelCredentials>& creds,
78 virtual std::shared_ptr<Channel> CreateChannel(
92 virtual bool ApplyToCall(
grpc_call* call) = 0;
96 const std::shared_ptr<ChannelCredentials>& channel_creds,
97 const std::shared_ptr<CallCredentials>& call_creds);
100 const std::shared_ptr<CallCredentials>& creds1,
101 const std::shared_ptr<CallCredentials>& creds2);
156 const grpc::string& json_key,
long token_lifetime_seconds);
193 const std::shared_ptr<ChannelCredentials>& channel_creds,
194 const std::shared_ptr<CallCredentials>& call_creds);
198 const std::shared_ptr<CallCredentials>& creds1,
199 const std::shared_ptr<CallCredentials>& creds2);
214 virtual const char*
GetType()
const {
return ""; }
221 virtual Status GetMetadata(
224 std::multimap<grpc::string, grpc::string>* metadata) = 0;
228 std::unique_ptr<MetadataCredentialsPlugin> plugin);
232 #endif // GRPCXX_SECURITY_CREDENTIALS_H struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:62
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
std::string string
Definition: config.h:118
virtual SecureChannelCredentials * AsSecureCredentials()=0
Options for channel creation.
Definition: channel_arguments.h:52
Class encapsulating the Authentication Information.
Definition: auth_context.h:80
std::shared_ptr< CallCredentials > GoogleComputeEngineCredentials()
Builds credentials for use when running in GCE.
std::shared_ptr< CallCredentials > CompositeCallCredentials(const std::shared_ptr< CallCredentials > &creds1, const std::shared_ptr< CallCredentials > &creds2)
Combines two call credentials objects into a composite call credentials.
std::shared_ptr< CallCredentials > GoogleRefreshTokenCredentials(const grpc::string &json_refresh_token)
Builds refresh token credentials.
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:53
friend std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
Create a new custom Channel pointing to target.
friend std::shared_ptr< ChannelCredentials > CompositeChannelCredentials(const std::shared_ptr< ChannelCredentials > &channel_creds, const std::shared_ptr< CallCredentials > &call_creds)
Combines a channel credentials and a call credentials into a composite channel credentials.
std::shared_ptr< ChannelCredentials > SslCredentials(const SslCredentialsOptions &options)
Builds SSL Credentials given SSL specific options.
grpc::string pem_root_certs
The buffer containing the PEM encoding of the server root certificates.
Definition: credentials.h:113
Options used to build SslCredentials.
Definition: credentials.h:107
grpc::string pem_cert_chain
The buffer containing the PEM encoding of the client's certificate chain.
Definition: credentials.h:122
grpc::string pem_private_key
The buffer containing the PEM encoding of the client's private key.
Definition: credentials.h:117
This class is a non owning reference to a string.
Definition: string_ref.h:56
std::shared_ptr< CallCredentials > ServiceAccountJWTAccessCredentials(const grpc::string &json_key, long token_lifetime_seconds)
Builds Service Account JWT Access credentials.
A channel credentials object encapsulates all the state needed by a client to authenticate with a ser...
Definition: credentials.h:60
Did it work? If it didn't, why?
Definition: status.h:45
std::shared_ptr< CallCredentials > GoogleIAMCredentials(const grpc::string &authorization_token, const grpc::string &authority_selector)
Builds IAM credentials.
A call credentials object encapsulates the state needed by a client to authenticate with a server for...
Definition: credentials.h:86
std::shared_ptr< ChannelCredentials > GoogleDefaultCredentials()
Builds credentials with reasonable defaults.
std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin)
std::shared_ptr< CallCredentials > AccessTokenCredentials(const grpc::string &access_token)
Builds access token credentials.