|
|
|
@ -33,6 +33,7 @@ |
|
|
|
|
#include "src/core/lib/debug/trace.h" |
|
|
|
|
#include "src/core/lib/gprpp/ref_counted.h" |
|
|
|
|
#include "src/core/lib/gprpp/ref_counted_ptr.h" |
|
|
|
|
#include "src/core/lib/gprpp/unique_type_name.h" |
|
|
|
|
#include "src/core/lib/iomgr/closure.h" |
|
|
|
|
#include "src/core/lib/iomgr/endpoint.h" |
|
|
|
|
#include "src/core/lib/iomgr/error.h" |
|
|
|
@ -66,7 +67,6 @@ class grpc_security_connector |
|
|
|
|
? "security_connector_refcount" |
|
|
|
|
: nullptr), |
|
|
|
|
url_scheme_(url_scheme) {} |
|
|
|
|
~grpc_security_connector() override = default; |
|
|
|
|
|
|
|
|
|
static absl::string_view ChannelArgName() { |
|
|
|
|
return GRPC_ARG_SECURITY_CONNECTOR; |
|
|
|
@ -94,6 +94,8 @@ class grpc_security_connector |
|
|
|
|
|
|
|
|
|
absl::string_view url_scheme() const { return url_scheme_; } |
|
|
|
|
|
|
|
|
|
virtual grpc_core::UniqueTypeName type() const = 0; |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
absl::string_view url_scheme_; |
|
|
|
|
}; |
|
|
|
@ -119,7 +121,6 @@ class grpc_channel_security_connector : public grpc_security_connector { |
|
|
|
|
absl::string_view url_scheme, |
|
|
|
|
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds, |
|
|
|
|
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds); |
|
|
|
|
~grpc_channel_security_connector() override; |
|
|
|
|
|
|
|
|
|
/// Checks that the host that will be set for a call is acceptable.
|
|
|
|
|
/// Returns ok if the host is acceptable, otherwise returns an error.
|
|
|
|
@ -144,6 +145,8 @@ class grpc_channel_security_connector : public grpc_security_connector { |
|
|
|
|
return request_metadata_creds_.get(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc_core::UniqueTypeName type() const override; |
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
|
// Helper methods to be used in subclasses.
|
|
|
|
|
int channel_security_connector_cmp( |
|
|
|
@ -170,7 +173,6 @@ class grpc_server_security_connector : public grpc_security_connector { |
|
|
|
|
grpc_server_security_connector( |
|
|
|
|
absl::string_view url_scheme, |
|
|
|
|
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds); |
|
|
|
|
~grpc_server_security_connector() override; |
|
|
|
|
|
|
|
|
|
virtual void add_handshakers(const grpc_channel_args* args, |
|
|
|
|
grpc_pollset_set* interested_parties, |
|
|
|
@ -183,6 +185,8 @@ class grpc_server_security_connector : public grpc_security_connector { |
|
|
|
|
return server_creds_.get(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc_core::UniqueTypeName type() const override; |
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
|
// Helper methods to be used in subclasses.
|
|
|
|
|
int server_security_connector_cmp( |
|
|
|
|