Go to the documentation of this file.
19 #ifndef GRPCPP_SECURITY_CREDENTIALS_IMPL_H
20 #define GRPCPP_SECURITY_CREDENTIALS_IMPL_H
46 const std::string& target,
const std::shared_ptr<ChannelCredentials>& creds,
49 namespace experimental {
51 const std::string& target,
const std::shared_ptr<ChannelCredentials>& creds,
54 std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
55 interceptor_creators);
71 const std::shared_ptr<ChannelCredentials>& channel_creds,
72 const std::shared_ptr<CallCredentials>& call_creds);
78 const std::string& target,
79 const std::shared_ptr<ChannelCredentials>& creds,
82 friend std::shared_ptr<Channel>
84 const std::string& target,
85 const std::shared_ptr<ChannelCredentials>& creds,
87 std::vector<std::unique_ptr<
89 interceptor_creators);
91 virtual std::shared_ptr<Channel> CreateChannelImpl(
96 virtual std::shared_ptr<Channel> CreateChannelWithInterceptors(
98 std::vector<std::unique_ptr<
117 return "CallCredentials did not provide a debug string";
122 const std::shared_ptr<ChannelCredentials>& channel_creds,
123 const std::shared_ptr<CallCredentials>& call_creds);
126 const std::shared_ptr<CallCredentials>& creds1,
127 const std::shared_ptr<CallCredentials>& creds2);
184 const std::string& json_key,
196 const std::string& json_refresh_token);
207 const std::string& access_token);
216 const std::string& authorization_token,
217 const std::string& authority_selector);
222 const std::shared_ptr<ChannelCredentials>& channel_creds,
223 const std::shared_ptr<CallCredentials>& call_creds);
227 const std::shared_ptr<CallCredentials>& creds1,
228 const std::shared_ptr<CallCredentials>& creds2);
243 virtual const char*
GetType()
const {
return ""; }
253 std::multimap<std::string, std::string>* metadata) = 0;
256 return "MetadataCredentialsPlugin did not provide a debug string";
261 std::unique_ptr<MetadataCredentialsPlugin> plugin);
263 namespace experimental {
330 std::unique_ptr<MetadataCredentialsPlugin> plugin,
356 #endif // GRPCPP_SECURITY_CREDENTIALS_IMPL_H
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
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
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
This class is a non owning reference to a string.
Definition: string_ref.h:41
virtual SecureChannelCredentials * AsSecureCredentials()=0
std::string pem_root_certs
The buffer containing the PEM encoding of the server root certificates.
Definition: credentials_impl.h:139
grpc::Status StsCredentialsOptionsFromJson(const std::string &json_string, StsCredentialsOptions *options)
Creates STS Options from a JSON string.
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
std::shared_ptr< CallCredentials > StsCredentials(const StsCredentialsOptions &options)
std::string actor_token_type
Definition: credentials_impl.h:279
std::shared_ptr< CallCredentials > GoogleComputeEngineCredentials()
Builds credentials for use when running in GCE.
std::vector< std::string > target_service_accounts
service accounts of target endpoint that will be acceptable by the client.
Definition: credentials_impl.h:338
constexpr long kMaxAuthTokenLifetimeSecs
Definition: credentials_impl.h:176
std::string pem_private_key
The buffer containing the PEM encoding of the client's private key.
Definition: credentials_impl.h:143
std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin, grpc_security_level min_security_level)
std::shared_ptr< ChannelCredentials > TlsCredentials(const TlsCredentialsOptions &options)
Builds TLS Credentials given TLS options.
std::shared_ptr< CallCredentials > GoogleIAMCredentials(const std::string &authorization_token, const std::string &authority_selector)
Builds IAM credentials.
std::string requested_token_type
Definition: credentials_impl.h:275
::grpc_impl::ChannelCredentials ChannelCredentials
Definition: credentials.h:26
std::string actor_token_path
Definition: credentials_impl.h:278
std::shared_ptr< CallCredentials > GoogleRefreshTokenCredentials(const std::string &json_refresh_token)
Builds refresh token credentials.
std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin)
::grpc_impl::SecureCallCredentials SecureCallCredentials
Definition: credentials.h:29
virtual SecureCallCredentials * AsSecureCredentials()=0
Did it work? If it didn't, why?
Definition: status.h:31
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
::grpc_impl::ChannelArguments ChannelArguments
Definition: channel_arguments.h:32
grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions *options)
Creates STS credentials options from the $STS_CREDENTIALS environment variable.
TLS credentials options, wrapper for grpc_tls_credentials_options.
Definition: tls_credentials_options.h:279
std::string token_exchange_service_uri
Definition: credentials_impl.h:271
Options used to build SslCredentials.
Definition: credentials_impl.h:133
std::shared_ptr< ChannelCredentials > SslCredentials(const SslCredentialsOptions &options)
Builds SSL Credentials given SSL specific options.
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
Options for creating STS Oauth Token Exchange credentials following the IETF draft https://tools....
Definition: credentials_impl.h:270
std::string subject_token_type
Definition: credentials_impl.h:277
Class encapsulating the Authentication Information.
Definition: auth_context.h:65
std::string subject_token_path
Definition: credentials_impl.h:276
Options for channel creation.
Definition: channel_arguments_impl.h:43
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
Options used to build AltsCredentials.
Definition: credentials_impl.h:334
friend std::shared_ptr< Channel > CreateCustomChannelImpl(const std::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
grpc_security_level
Definition: grpc_security_constants.h:114
std::string pem_cert_chain
The buffer containing the PEM encoding of the client's certificate chain.
Definition: credentials_impl.h:148
::grpc_impl::SecureChannelCredentials SecureChannelCredentials
Definition: credentials.h:30
std::shared_ptr<::grpc::Channel > CreateCustomChannelImpl(const std::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 > ServiceAccountJWTAccessCredentials(const std::string &json_key, long token_lifetime_seconds=grpc_impl::kMaxAuthTokenLifetimeSecs)
Builds Service Account JWT Access credentials.
::grpc_impl::CallCredentials CallCredentials
Definition: credentials.h:27
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
Definition: client_interceptor.h:49
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
std::string audience
Definition: credentials_impl.h:273
A channel credentials object encapsulates all the state needed by a client to authenticate with a ser...
Definition: credentials_impl.h:64
std::shared_ptr< ChannelCredentials > GoogleDefaultCredentials()
Builds credentials with reasonable defaults.
std::shared_ptr< ChannelCredentials > LocalCredentials(grpc_local_connect_type type)
Builds Local Credentials.
std::shared_ptr<::grpc::Channel > CreateCustomChannelWithInterceptors(const std::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.
A call credentials object encapsulates the state needed by a client to authenticate with a server for...
Definition: credentials_impl.h:109
std::shared_ptr< ChannelCredentials > AltsCredentials(const AltsCredentialsOptions &options)
Builds ALTS Credentials given ALTS specific options.
std::shared_ptr< CallCredentials > AccessTokenCredentials(const std::string &access_token)
Builds access token credentials.
std::string scope
Definition: credentials_impl.h:274
virtual std::string DebugString()
Definition: credentials_impl.h:116
grpc_local_connect_type
Type of local connections for which local channel/server credentials will be applied.
Definition: grpc_security_constants.h:140
virtual bool ApplyToCall(grpc_call *call)=0
Apply this instance's credentials to call.
std::string resource
Definition: credentials_impl.h:272