diff options
author | 2018-09-12 16:58:44 -0700 | |
---|---|---|
committer | 2018-09-26 19:25:30 -0700 | |
commit | a1598c5abfadf9e622d21a5cc0f754b412378314 (patch) | |
tree | 2f1358e3a781f503d29fe670107732cc2227f6d7 /include/grpcpp/security | |
parent | c3db7d21ce1dfbd6f25bde500af62fd1c197928f (diff) |
Create interfaces and initial plumbing for interception API
Diffstat (limited to 'include/grpcpp/security')
-rw-r--r-- | include/grpcpp/security/credentials.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index bfadc15df5..53f0131c00 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -24,6 +24,7 @@ #include <vector> #include <grpc/grpc_security_constants.h> +#include <grpcpp/impl/codegen/client_interceptor.h> #include <grpcpp/impl/codegen/grpc_library.h> #include <grpcpp/security/auth_context.h> #include <grpcpp/support/status.h> @@ -38,6 +39,18 @@ class SecureChannelCredentials; class CallCredentials; class SecureCallCredentials; +class ChannelCredentials; + +namespace experimental { +std::shared_ptr<Channel> CreateCustomChannelWithInterceptors( + const grpc::string& target, + const std::shared_ptr<ChannelCredentials>& creds, + const ChannelArguments& args, + std::unique_ptr<std::vector< + std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>> + interceptor_creators); +} // namespace experimental + /// A channel credentials object encapsulates all the state needed by a client /// to authenticate with a server for a given channel. /// It can make various assertions, e.g., about the client’s identity, role @@ -62,8 +75,23 @@ class ChannelCredentials : private GrpcLibraryCodegen { const std::shared_ptr<ChannelCredentials>& creds, const ChannelArguments& args); + friend std::shared_ptr<Channel> + experimental::CreateCustomChannelWithInterceptors( + const grpc::string& target, + const std::shared_ptr<ChannelCredentials>& creds, + const ChannelArguments& args, + std::unique_ptr<std::vector< + std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>> + interceptor_creators); + virtual std::shared_ptr<Channel> CreateChannel( const grpc::string& target, const ChannelArguments& args) = 0; + + virtual std::shared_ptr<Channel> CreateChannelWithInterceptors( + const grpc::string& target, const ChannelArguments& args, + std::unique_ptr<std::vector< + std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>> + interceptor_creators) = 0; }; /// A call credentials object encapsulates the state needed by a client to |