diff options
author | Craig Tiller <ctiller@google.com> | 2016-11-29 12:31:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 12:31:14 -0800 |
commit | 3b45b8d60b9f0a1678f5f497345e21f7bc71675a (patch) | |
tree | 5d4f24b130613123358609bbcf742c0a7d6940a8 /test/cpp/util/test_credentials_provider.h | |
parent | 3b04e7e3795f9f5e339ae7dfc40babb19485cfaf (diff) |
Revert "Test credentials provider update"
Diffstat (limited to 'test/cpp/util/test_credentials_provider.h')
-rw-r--r-- | test/cpp/util/test_credentials_provider.h | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 0bc52ebe4d..1fb311e556 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -59,39 +59,23 @@ class CredentialTypeProvider { virtual std::shared_ptr<ServerCredentials> GetServerCredentials() = 0; }; -// Provide test credentials. Thread-safe. -class CredentialsProvider { - public: - virtual ~CredentialsProvider() {} - - // Add a secure type in addition to the defaults. The default provider has - // (kInsecureCredentialsType, kTlsCredentialsType). - virtual void AddSecureType( - const grpc::string& type, - std::unique_ptr<CredentialTypeProvider> type_provider) = 0; - - // Provide channel credentials according to the given type. Alter the channel - // arguments if needed. Return nullptr if type is not registered. - virtual std::shared_ptr<ChannelCredentials> GetChannelCredentials( - const grpc::string& type, ChannelArguments* args) = 0; - - // Provide server credentials according to the given type. - // Return nullptr if type is not registered. - virtual std::shared_ptr<ServerCredentials> GetServerCredentials( - const grpc::string& type) = 0; - - // Provide a list of secure credentials type. - virtual std::vector<grpc::string> GetSecureCredentialsTypeList() = 0; -}; - -// Get the current provider. Create a default one if not set. -// Not thread-safe. -CredentialsProvider* GetCredentialsProvider(); - -// Set the global provider. Takes ownership. The previous set provider will be -// destroyed. -// Not thread-safe. -void SetCredentialsProvider(CredentialsProvider* provider); +// Add a secure type in addition to the defaults above +// (kInsecureCredentialsType, kTlsCredentialsType) that can be returned from the +// functions below. +void AddSecureType(const grpc::string& type, + std::unique_ptr<CredentialTypeProvider> type_provider); + +// Provide channel credentials according to the given type. Alter the channel +// arguments if needed. +std::shared_ptr<ChannelCredentials> GetChannelCredentials( + const grpc::string& type, ChannelArguments* args); + +// Provide server credentials according to the given type. +std::shared_ptr<ServerCredentials> GetServerCredentials( + const grpc::string& type); + +// Provide a list of secure credentials type. +std::vector<grpc::string> GetSecureCredentialsTypeList(); } // namespace testing } // namespace grpc |