diff --git a/BUILD b/BUILD index 1acba387931..2f186ff1e84 100644 --- a/BUILD +++ b/BUILD @@ -251,7 +251,6 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/resource_quota.h", "include/grpcpp/security/auth_context.h", "include/grpcpp/security/auth_metadata_processor.h", - "include/grpcpp/security/auth_metadata_processor_impl.h", "include/grpcpp/security/credentials.h", "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", diff --git a/BUILD.gn b/BUILD.gn index 48571619041..867880a76ba 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1313,7 +1313,6 @@ config("grpc_config") { "include/grpcpp/resource_quota.h", "include/grpcpp/security/auth_context.h", "include/grpcpp/security/auth_metadata_processor.h", - "include/grpcpp/security/auth_metadata_processor_impl.h", "include/grpcpp/security/credentials.h", "include/grpcpp/security/credentials_impl.h", "include/grpcpp/security/server_credentials.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 4604bfdb19f..5d9aeed31d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2893,7 +2893,6 @@ foreach(_hdr include/grpcpp/resource_quota.h include/grpcpp/security/auth_context.h include/grpcpp/security/auth_metadata_processor.h - include/grpcpp/security/auth_metadata_processor_impl.h include/grpcpp/security/credentials.h include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h @@ -3590,7 +3589,6 @@ foreach(_hdr include/grpcpp/resource_quota.h include/grpcpp/security/auth_context.h include/grpcpp/security/auth_metadata_processor.h - include/grpcpp/security/auth_metadata_processor_impl.h include/grpcpp/security/credentials.h include/grpcpp/security/credentials_impl.h include/grpcpp/security/server_credentials.h diff --git a/Makefile b/Makefile index 881c0d74997..2c38eba76af 100644 --- a/Makefile +++ b/Makefile @@ -4844,7 +4844,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/resource_quota.h \ include/grpcpp/security/auth_context.h \ include/grpcpp/security/auth_metadata_processor.h \ - include/grpcpp/security/auth_metadata_processor_impl.h \ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ @@ -5539,7 +5538,6 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/resource_quota.h \ include/grpcpp/security/auth_context.h \ include/grpcpp/security/auth_metadata_processor.h \ - include/grpcpp/security/auth_metadata_processor_impl.h \ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 3022305de8c..a9d27228bfe 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2424,7 +2424,6 @@ libs: - include/grpcpp/resource_quota.h - include/grpcpp/security/auth_context.h - include/grpcpp/security/auth_metadata_processor.h - - include/grpcpp/security/auth_metadata_processor_impl.h - include/grpcpp/security/credentials.h - include/grpcpp/security/credentials_impl.h - include/grpcpp/security/server_credentials.h @@ -2813,7 +2812,6 @@ libs: - include/grpcpp/resource_quota.h - include/grpcpp/security/auth_context.h - include/grpcpp/security/auth_metadata_processor.h - - include/grpcpp/security/auth_metadata_processor_impl.h - include/grpcpp/security/credentials.h - include/grpcpp/security/credentials_impl.h - include/grpcpp/security/server_credentials.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 8deac9095d8..7dc4af37cd6 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -164,7 +164,6 @@ Pod::Spec.new do |s| 'include/grpcpp/resource_quota.h', 'include/grpcpp/security/auth_context.h', 'include/grpcpp/security/auth_metadata_processor.h', - 'include/grpcpp/security/auth_metadata_processor_impl.h', 'include/grpcpp/security/credentials.h', 'include/grpcpp/security/credentials_impl.h', 'include/grpcpp/security/server_credentials.h', diff --git a/include/grpcpp/security/auth_metadata_processor.h b/include/grpcpp/security/auth_metadata_processor.h index 1b66b72b967..02654611311 100644 --- a/include/grpcpp/security/auth_metadata_processor.h +++ b/include/grpcpp/security/auth_metadata_processor.h @@ -1,6 +1,6 @@ /* * - * Copyright 2019 gRPC authors. + * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,42 @@ #ifndef GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_H #define GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_H -#include +#include + +#include +#include +#include namespace grpc { -typedef ::grpc_impl::AuthMetadataProcessor AuthMetadataProcessor; +/// Interface allowing custom server-side authorization based on credentials +/// encoded in metadata. Objects of this type can be passed to +/// \a ServerCredentials::SetAuthMetadataProcessor(). +class AuthMetadataProcessor { + public: + typedef std::multimap InputMetadata; + typedef std::multimap OutputMetadata; + + virtual ~AuthMetadataProcessor() {} + + /// If this method returns true, the \a Process function will be scheduled in + /// a different thread from the one processing the call. + virtual bool IsBlocking() const { return true; } + + /// context is read/write: it contains the properties of the channel peer and + /// it is the job of the Process method to augment it with properties derived + /// from the passed-in auth_metadata. + /// consumed_auth_metadata needs to be filled with metadata that has been + /// consumed by the processor and will be removed from the call. + /// response_metadata is the metadata that will be sent as part of the + /// response. + /// If the return value is not Status::OK, the rpc call will be aborted with + /// the error code and error message sent back to the client. + virtual grpc::Status Process(const InputMetadata& auth_metadata, + grpc::AuthContext* context, + OutputMetadata* consumed_auth_metadata, + OutputMetadata* response_metadata) = 0; +}; } // namespace grpc diff --git a/include/grpcpp/security/auth_metadata_processor_impl.h b/include/grpcpp/security/auth_metadata_processor_impl.h deleted file mode 100644 index ba80e488dc6..00000000000 --- a/include/grpcpp/security/auth_metadata_processor_impl.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_IMPL_H -#define GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_IMPL_H - -#include - -#include -#include -#include - -namespace grpc_impl { - -/// Interface allowing custom server-side authorization based on credentials -/// encoded in metadata. Objects of this type can be passed to -/// \a ServerCredentials::SetAuthMetadataProcessor(). -class AuthMetadataProcessor { - public: - typedef std::multimap InputMetadata; - typedef std::multimap OutputMetadata; - - virtual ~AuthMetadataProcessor() {} - - /// If this method returns true, the \a Process function will be scheduled in - /// a different thread from the one processing the call. - virtual bool IsBlocking() const { return true; } - - /// context is read/write: it contains the properties of the channel peer and - /// it is the job of the Process method to augment it with properties derived - /// from the passed-in auth_metadata. - /// consumed_auth_metadata needs to be filled with metadata that has been - /// consumed by the processor and will be removed from the call. - /// response_metadata is the metadata that will be sent as part of the - /// response. - /// If the return value is not Status::OK, the rpc call will be aborted with - /// the error code and error message sent back to the client. - virtual grpc::Status Process(const InputMetadata& auth_metadata, - grpc::AuthContext* context, - OutputMetadata* consumed_auth_metadata, - OutputMetadata* response_metadata) = 0; -}; - -} // namespace grpc_impl - -#endif // GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_IMPL_H diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index fd62c5079da..f1cef6dd8a9 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -1024,7 +1024,6 @@ include/grpcpp/impl/service_type.h \ include/grpcpp/resource_quota.h \ include/grpcpp/security/auth_context.h \ include/grpcpp/security/auth_metadata_processor.h \ -include/grpcpp/security/auth_metadata_processor_impl.h \ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 590de9c19a4..bcc370c876e 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1024,7 +1024,6 @@ include/grpcpp/impl/service_type.h \ include/grpcpp/resource_quota.h \ include/grpcpp/security/auth_context.h \ include/grpcpp/security/auth_metadata_processor.h \ -include/grpcpp/security/auth_metadata_processor_impl.h \ include/grpcpp/security/credentials.h \ include/grpcpp/security/credentials_impl.h \ include/grpcpp/security/server_credentials.h \