19 #ifndef GRPCPP_SECURITY_CREDENTIALS_IMPL_H 20 #define GRPCPP_SECURITY_CREDENTIALS_IMPL_H 46 const std::shared_ptr<ChannelCredentials>& creds,
49 namespace experimental {
52 const std::shared_ptr<ChannelCredentials>& creds,
55 std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
56 interceptor_creators);
72 const std::shared_ptr<ChannelCredentials>& channel_creds,
73 const std::shared_ptr<CallCredentials>& call_creds);
80 const std::shared_ptr<ChannelCredentials>& creds,
83 friend std::shared_ptr<::grpc::Channel>
86 const std::shared_ptr<ChannelCredentials>& creds,
88 std::vector<std::unique_ptr<
90 interceptor_creators);
97 virtual std::shared_ptr<::grpc::Channel> CreateChannelWithInterceptors(
99 std::vector<std::unique_ptr<
101 interceptor_creators) {
116 virtual bool ApplyToCall(
grpc_call* call) = 0;
120 const std::shared_ptr<ChannelCredentials>& channel_creds,
121 const std::shared_ptr<CallCredentials>& call_creds);
124 const std::shared_ptr<CallCredentials>& creds1,
125 const std::shared_ptr<CallCredentials>& creds2);
220 const std::shared_ptr<ChannelCredentials>& channel_creds,
221 const std::shared_ptr<CallCredentials>& call_creds);
225 const std::shared_ptr<CallCredentials>& creds1,
226 const std::shared_ptr<CallCredentials>& creds2);
244 virtual const char*
GetType()
const {
return ""; }
254 std::multimap<grpc::string, grpc::string>* metadata) = 0;
258 std::unique_ptr<MetadataCredentialsPlugin> plugin);
260 namespace experimental {
281 #endif // GRPCPP_SECURITY_CREDENTIALS_IMPL_H struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
std::shared_ptr< ChannelCredentials > GoogleDefaultCredentials()
Builds credentials with reasonable defaults.
std::string string
Definition: config.h:35
A call credentials object encapsulates the state needed by a client to authenticate with a server for...
Definition: credentials_impl.h:110
::grpc_impl::SecureChannelCredentials SecureChannelCredentials
Definition: credentials.h:30
Options used to build AltsCredentials.
Definition: credentials_impl.h:263
grpc::string pem_private_key
The buffer containing the PEM encoding of the client's private key.
Definition: credentials_impl.h:141
::grpc_impl::ChannelCredentials ChannelCredentials
Definition: credentials.h:26
Class encapsulating the Authentication Information.
Definition: auth_context.h:65
std::shared_ptr<::grpc::Channel > CreateChannelImpl(const grpc::string &target, const std::shared_ptr<::grpc::ChannelCredentials > &creds)
Create a new Channel pointing to target.
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
std::shared_ptr< CallCredentials > GoogleIAMCredentials(const grpc::string &authorization_token, const grpc::string &authority_selector)
Builds IAM credentials.
std::shared_ptr< CallCredentials > ServiceAccountJWTAccessCredentials(const grpc::string &json_key, long token_lifetime_seconds=grpc_impl::kMaxAuthTokenLifetimeSecs)
Builds Service Account JWT Access credentials.
Definition: client_interceptor.h:49
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
std::shared_ptr< CallCredentials > GoogleComputeEngineCredentials()
Builds credentials for use when running in GCE.
Options used to build SslCredentials.
Definition: credentials_impl.h:131
std::vector< grpc::string > target_service_accounts
service accounts of target endpoint that will be acceptable by the client.
Definition: credentials_impl.h:267
std::shared_ptr< CallCredentials > AccessTokenCredentials(const grpc::string &access_token)
Builds access token credentials.
::grpc_impl::CallCredentials CallCredentials
Definition: credentials.h:27
Options for channel creation.
Definition: channel_arguments_impl.h:43
grpc::string pem_cert_chain
The buffer containing the PEM encoding of the client's certificate chain.
Definition: credentials_impl.h:146
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:76
A channel credentials object encapsulates all the state needed by a client to authenticate with a ser...
Definition: credentials_impl.h:65
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
constexpr long kMaxAuthTokenLifetimeSecs
Definition: credentials_impl.h:174
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...
This class is a non owning reference to a string.
Definition: string_ref.h:41
::grpc_impl::SecureCallCredentials SecureCallCredentials
Definition: credentials.h:29
Did it work? If it didn't, why?
Definition: status.h:31
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< ChannelCredentials > LocalCredentials(grpc_local_connect_type type)
Builds Local Credentials.
std::shared_ptr< CallCredentials > GoogleRefreshTokenCredentials(const grpc::string &json_refresh_token)
Builds refresh token credentials.
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:83
grpc::string pem_root_certs
The buffer containing the PEM encoding of the server root certificates.
Definition: credentials_impl.h:137
std::shared_ptr< ChannelCredentials > CronetChannelCredentials(void *engine)
Credentials for a channel using Cronet.
std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin)
grpc_local_connect_type
Type of local connections for which local channel/server credentials will be applied.
Definition: grpc_security_constants.h:112
std::shared_ptr< ChannelCredentials > SslCredentials(const SslCredentialsOptions &options)
Builds SSL Credentials given SSL specific options.
std::shared_ptr< ChannelCredentials > AltsCredentials(const AltsCredentialsOptions &options)
Builds ALTS Credentials given ALTS specific options.