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);
143 #endif // GRPCPP_SECURITY_CREDENTIALS_H