19 #ifndef GRPCPP_SECURITY_CREDENTIALS_H
20 #define GRPCPP_SECURITY_CREDENTIALS_H
33 static inline std::shared_ptr<grpc_impl::ChannelCredentials>
34 GoogleDefaultCredentials() {
35 return ::grpc_impl::GoogleDefaultCredentials();
38 static inline std::shared_ptr<ChannelCredentials> SslCredentials(
40 return ::grpc_impl::SslCredentials(options);
43 static inline std::shared_ptr<grpc_impl::CallCredentials>
44 GoogleComputeEngineCredentials() {
45 return ::grpc_impl::GoogleComputeEngineCredentials();
52 static inline std::shared_ptr<grpc_impl::CallCredentials>
53 ServiceAccountJWTAccessCredentials(
56 return ::grpc_impl::ServiceAccountJWTAccessCredentials(
57 json_key, token_lifetime_seconds);
60 static inline std::shared_ptr<grpc_impl::CallCredentials>
61 GoogleRefreshTokenCredentials(
const grpc::string& json_refresh_token) {
62 return ::grpc_impl::GoogleRefreshTokenCredentials(json_refresh_token);
65 static inline std::shared_ptr<grpc_impl::CallCredentials>
66 AccessTokenCredentials(
const grpc::string& access_token) {
67 return ::grpc_impl::AccessTokenCredentials(access_token);
70 static inline std::shared_ptr<grpc_impl::CallCredentials> GoogleIAMCredentials(
73 return ::grpc_impl::GoogleIAMCredentials(authorization_token,
77 static inline std::shared_ptr<ChannelCredentials> CompositeChannelCredentials(
78 const std::shared_ptr<ChannelCredentials>& channel_creds,
79 const std::shared_ptr<CallCredentials>& call_creds) {
80 return ::grpc_impl::CompositeChannelCredentials(channel_creds, call_creds);
83 static inline std::shared_ptr<grpc_impl::CallCredentials>
84 CompositeCallCredentials(
const std::shared_ptr<CallCredentials>& creds1,
85 const std::shared_ptr<CallCredentials>& creds2) {
86 return ::grpc_impl::CompositeCallCredentials(creds1, creds2);
89 static inline std::shared_ptr<grpc_impl::ChannelCredentials>
90 InsecureChannelCredentials() {
91 return ::grpc_impl::InsecureChannelCredentials();
96 static inline std::shared_ptr<grpc_impl::CallCredentials>
97 MetadataCredentialsFromPlugin(
98 std::unique_ptr<MetadataCredentialsPlugin> plugin) {
99 return ::grpc_impl::MetadataCredentialsFromPlugin(std::move(plugin));
102 namespace experimental {
106 static inline grpc::Status StsCredentialsOptionsFromJson(
108 return ::grpc_impl::experimental::StsCredentialsOptionsFromJson(json_string,
112 static inline grpc::Status StsCredentialsOptionsFromEnv(
117 static inline std::shared_ptr<grpc_impl::CallCredentials> StsCredentials(
125 static inline std::shared_ptr<grpc_impl::ChannelCredentials> AltsCredentials(
127 return ::grpc_impl::experimental::AltsCredentials(options);
130 static inline std::shared_ptr<grpc_impl::ChannelCredentials> LocalCredentials(
132 return ::grpc_impl::experimental::LocalCredentials(type);
135 static inline std::shared_ptr<grpc_impl::ChannelCredentials> TlsCredentials(
136 const ::grpc_impl::experimental::TlsCredentialsOptions& options) {
137 return ::grpc_impl::experimental::TlsCredentials(options);
Did it work? If it didn't, why?
Definition: status.h:31
grpc_local_connect_type
Type of local connections for which local channel/server credentials will be applied.
Definition: grpc_security_constants.h:112
::grpc_impl::experimental::AltsCredentialsOptions AltsCredentialsOptions
Definition: credentials.h:123
::grpc_impl::experimental::StsCredentialsOptions StsCredentialsOptions
Definition: credentials.h:104
std::shared_ptr< CallCredentials > StsCredentials(const StsCredentialsOptions &options)
Definition: secure_credentials.cc:253
grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions *options)
Creates STS credentials options from the $STS_CREDENTIALS environment variable.
Definition: secure_credentials.cc:201
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
::grpc_impl::SecureChannelCredentials SecureChannelCredentials
Definition: credentials.h:30
::grpc_impl::CallCredentials CallCredentials
Definition: credentials.h:27
constexpr long kMaxAuthTokenLifetimeSecs
Constant for maximum auth token lifetime.
Definition: credentials.h:49
::grpc_impl::MetadataCredentialsPlugin MetadataCredentialsPlugin
Definition: credentials.h:31
::grpc_impl::ChannelCredentials ChannelCredentials
Definition: credentials.h:26
std::string string
Definition: config.h:35
::grpc_impl::SslCredentialsOptions SslCredentialsOptions
Definition: credentials.h:28
::grpc_impl::SecureCallCredentials SecureCallCredentials
Definition: credentials.h:29
Options used to build AltsCredentials.
Definition: credentials_impl.h:325
Options for creating STS Oauth Token Exchange credentials following the IETF draft https://tools....
Definition: credentials_impl.h:265