19 #ifndef GRPCPP_SECURITY_CREDENTIALS_IMPL_H
20 #define GRPCPP_SECURITY_CREDENTIALS_IMPL_H
47 const std::shared_ptr<ChannelCredentials>& creds,
50 namespace experimental {
53 const std::shared_ptr<ChannelCredentials>& creds,
56 std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
57 interceptor_creators);
73 const std::shared_ptr<ChannelCredentials>& channel_creds,
74 const std::shared_ptr<CallCredentials>& call_creds);
81 const std::shared_ptr<ChannelCredentials>& creds,
84 friend std::shared_ptr<Channel>
87 const std::shared_ptr<ChannelCredentials>& creds,
89 std::vector<std::unique_ptr<
91 interceptor_creators);
93 virtual std::shared_ptr<Channel> CreateChannelImpl(
98 virtual std::shared_ptr<Channel> CreateChannelWithInterceptors(
100 std::vector<std::unique_ptr<
121 const std::shared_ptr<ChannelCredentials>& channel_creds,
122 const std::shared_ptr<CallCredentials>& call_creds);
125 const std::shared_ptr<CallCredentials>& creds1,
126 const std::shared_ptr<CallCredentials>& creds2);
221 const std::shared_ptr<ChannelCredentials>& channel_creds,
222 const std::shared_ptr<CallCredentials>& call_creds);
226 const std::shared_ptr<CallCredentials>& creds1,
227 const std::shared_ptr<CallCredentials>& creds2);
242 virtual const char*
GetType()
const {
return ""; }
252 std::multimap<grpc::string, grpc::string>* metadata) = 0;
256 std::unique_ptr<MetadataCredentialsPlugin> plugin);
258 namespace experimental {
Class encapsulating the Authentication Information.
Definition: auth_context.h:65
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
Did it work? If it didn't, why?
Definition: status.h:31
Definition: client_interceptor.h:49
This class is a non owning reference to a string.
Definition: string_ref.h:41
A call credentials object encapsulates the state needed by a client to authenticate with a server for...
Definition: credentials_impl.h:111
friend 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.
Definition: credentials.h:84
virtual bool ApplyToCall(grpc_call *call)=0
Apply this instance's credentials to call.
~CallCredentials()
Definition: credentials_cc.cc:31
virtual SecureCallCredentials * AsSecureCredentials()=0
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.
Definition: credentials.h:77
CallCredentials()
Definition: credentials_cc.cc:29
Options for channel creation.
Definition: channel_arguments_impl.h:43
A channel credentials object encapsulates all the state needed by a client to authenticate with a ser...
Definition: credentials_impl.h:66
~ChannelCredentials()
Definition: credentials_cc.cc:27
ChannelCredentials()
Definition: credentials_cc.cc:25
virtual SecureChannelCredentials * AsSecureCredentials()=0
friend std::shared_ptr< Channel > CreateCustomChannelImpl(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
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.
Definition: credentials.h:77
Definition: secure_credentials.h:58
Definition: secure_credentials.h:36
TLS credentials options, wrapper for grpc_tls_credentials_options.
Definition: tls_credentials_options.h:286
grpc_local_connect_type
Type of local connections for which local channel/server credentials will be applied.
Definition: grpc_security_constants.h:112
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
std::shared_ptr< CallCredentials > StsCredentials(const StsCredentialsOptions &options)
Definition: secure_credentials.cc:253
std::shared_ptr< ChannelCredentials > TlsCredentials(const TlsCredentialsOptions &options)
Builds TLS Credentials given TLS options.
Definition: secure_credentials.cc:282
std::shared_ptr< ChannelCredentials > AltsCredentials(const AltsCredentialsOptions &options)
Builds ALTS Credentials given ALTS specific options.
Definition: secure_credentials.cc:260
grpc::Status StsCredentialsOptionsFromJson(const grpc::string &json_string, StsCredentialsOptions *options)
Creates STS Options from a JSON string.
Definition: secure_credentials.cc:136
std::shared_ptr<::grpc::Channel > CreateCustomChannelWithInterceptors(const grpc::string &target, const std::shared_ptr< grpc::ChannelCredentials > &creds, const ::grpc::ChannelArguments &args, std::vector< std::unique_ptr< grpc::experimental::ClientInterceptorFactoryInterface >> interceptor_creators)
Create a new custom Channel pointing to target with interceptors being invoked per call.
std::shared_ptr< ChannelCredentials > LocalCredentials(grpc_local_connect_type type)
Builds Local Credentials.
Definition: secure_credentials.cc:275
grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions *options)
Creates STS credentials options from the $STS_CREDENTIALS environment variable.
Definition: secure_credentials.cc:201
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
std::shared_ptr<::grpc::Channel > CreateCustomChannelImpl(const grpc::string &target, const std::shared_ptr<::grpc::ChannelCredentials > &creds, const ::grpc::ChannelArguments &args)
Create a new custom Channel pointing to target.
std::shared_ptr< CallCredentials > GoogleRefreshTokenCredentials(const grpc::string &json_refresh_token)
Builds refresh token credentials.
Definition: secure_credentials.cc:313
std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin)
Definition: secure_credentials.cc:368
std::shared_ptr< CallCredentials > ServiceAccountJWTAccessCredentials(const grpc::string &json_key, long token_lifetime_seconds=grpc_impl::kMaxAuthTokenLifetimeSecs)
Builds Service Account JWT Access credentials.
Definition: secure_credentials.cc:298
constexpr long kMaxAuthTokenLifetimeSecs
Definition: credentials_impl.h:175
std::shared_ptr< ChannelCredentials > GoogleDefaultCredentials()
Builds credentials with reasonable defaults.
Definition: secure_credentials.cc:97
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.
Definition: secure_credentials.cc:356
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.
Definition: secure_credentials.cc:339
std::shared_ptr< CallCredentials > GoogleIAMCredentials(const grpc::string &authorization_token, const grpc::string &authority_selector)
Builds IAM credentials.
Definition: secure_credentials.cc:329
std::shared_ptr< CallCredentials > GoogleComputeEngineCredentials()
Builds credentials for use when running in GCE.
Definition: secure_credentials.cc:291
std::shared_ptr< ChannelCredentials > SslCredentials(const SslCredentialsOptions &options)
Builds SSL Credentials given SSL specific options.
Definition: secure_credentials.cc:103
std::shared_ptr< CallCredentials > AccessTokenCredentials(const grpc::string &access_token)
Builds access token credentials.
Definition: secure_credentials.cc:321
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
Definition: insecure_credentials.cc:57
::grpc_impl::SecureChannelCredentials SecureChannelCredentials
Definition: credentials.h:30
::grpc_impl::CallCredentials CallCredentials
Definition: credentials.h:27
::grpc_impl::ChannelCredentials ChannelCredentials
Definition: credentials.h:26
std::string string
Definition: config.h:35
::grpc_impl::SecureCallCredentials SecureCallCredentials
Definition: credentials.h:29
Options used to build SslCredentials.
Definition: credentials_impl.h:132
grpc::string pem_root_certs
The buffer containing the PEM encoding of the server root certificates.
Definition: credentials_impl.h:138
grpc::string pem_private_key
The buffer containing the PEM encoding of the client's private key.
Definition: credentials_impl.h:142
grpc::string pem_cert_chain
The buffer containing the PEM encoding of the client's certificate chain.
Definition: credentials_impl.h:147
Options used to build AltsCredentials.
Definition: credentials_impl.h:325
std::vector< grpc::string > target_service_accounts
service accounts of target endpoint that will be acceptable by the client.
Definition: credentials_impl.h:329
Options for creating STS Oauth Token Exchange credentials following the IETF draft https://tools....
Definition: credentials_impl.h:265
grpc::string token_exchange_service_uri
Definition: credentials_impl.h:266
grpc::string scope
Definition: credentials_impl.h:269
grpc::string resource
Definition: credentials_impl.h:267
grpc::string actor_token_path
Definition: credentials_impl.h:273
grpc::string audience
Definition: credentials_impl.h:268
grpc::string subject_token_type
Definition: credentials_impl.h:272
grpc::string actor_token_type
Definition: credentials_impl.h:274
grpc::string subject_token_path
Definition: credentials_impl.h:271
grpc::string requested_token_type
Definition: credentials_impl.h:270