aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/security
diff options
context:
space:
mode:
authorGravatar Yihua Zhang <yihuaz@google.com>2018-04-16 15:11:32 -0700
committerGravatar Yihua Zhang <yihuaz@google.com>2018-04-16 15:11:32 -0700
commitfe2fa0c1c869906542cd297c8fa28ec8cee89927 (patch)
treeb60543e8cb8b6f6be49f320dc840bfdb6353f904 /include/grpcpp/security
parent77c1761f5c3cb498ab55799f9ad02ad6297a3960 (diff)
Add C++ experimental API extensions for ALTS C stack
Diffstat (limited to 'include/grpcpp/security')
-rw-r--r--include/grpcpp/security/credentials.h16
-rw-r--r--include/grpcpp/security/server_credentials.h12
2 files changed, 28 insertions, 0 deletions
diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h
index 837a0e43ed..36d95d1b42 100644
--- a/include/grpcpp/security/credentials.h
+++ b/include/grpcpp/security/credentials.h
@@ -21,6 +21,7 @@
#include <map>
#include <memory>
+#include <vector>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/security/auth_context.h>
@@ -219,6 +220,21 @@ class MetadataCredentialsPlugin {
std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
std::unique_ptr<MetadataCredentialsPlugin> plugin);
+namespace experimental {
+
+/// Options used to build AltsCredentials.
+struct AltsCredentialsOptions {
+ /// service accounts of target endpoint that will be acceptable
+ /// by the client. If service accounts are provided and none of them matches
+ /// that of the server, authentication will fail.
+ std::vector<grpc::string> target_service_accounts;
+};
+
+/// Builds ALTS Credentials given ALTS specific options
+std::shared_ptr<ChannelCredentials> AltsCredentials(
+ const AltsCredentialsOptions& options);
+
+} // namespace experimental
} // namespace grpc
#endif // GRPCPP_SECURITY_CREDENTIALS_H
diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h
index 892863ef54..cf57e275f5 100644
--- a/include/grpcpp/security/server_credentials.h
+++ b/include/grpcpp/security/server_credentials.h
@@ -86,6 +86,18 @@ std::shared_ptr<ServerCredentials> SslServerCredentials(
/// Builds insecure server credentials.
std::shared_ptr<ServerCredentials> InsecureServerCredentials();
+namespace experimental {
+
+/// Options to create ServerCredentials with ALTS
+struct AltsServerCredentialsOptions {
+ /// Add fields if needed.
+};
+
+/// Builds ALTS ServerCredentials given ALTS specific options
+std::shared_ptr<ServerCredentials> AltsServerCredentials(
+ const AltsServerCredentialsOptions& options);
+
+} // namespace experimental
} // namespace grpc
#endif // GRPCPP_SECURITY_SERVER_CREDENTIALS_H