insecure_security_connector.h
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2020 gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //
18 
19 #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_INSECURE_INSECURE_SECURITY_CONNECTOR_H
20 #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_INSECURE_INSECURE_SECURITY_CONNECTOR_H
22 
23 #include <utility>
24 
25 #include "absl/status/status.h"
26 #include "absl/strings/string_view.h"
27 
28 #include <grpc/grpc.h>
29 #include <grpc/grpc_security.h>
31 
42 
43 namespace grpc_core {
44 
45 extern const char kInsecureTransportSecurityType[];
46 
47 // Exposed for testing purposes only.
48 // Create an auth context which is necessary to pass the santiy check in
49 // client_auth_filter that verifies if the peer's auth context is obtained
50 // during handshakes.
51 RefCountedPtr<grpc_auth_context> TestOnlyMakeInsecureAuthContext();
52 
55  public:
61 
63  absl::string_view host, grpc_auth_context* auth_context) override;
64 
66  grpc_pollset_set* /* interested_parties */,
67  HandshakeManager* handshake_manager) override;
68 
69  void check_peer(tsi_peer peer, grpc_endpoint* ep,
71  grpc_closure* on_peer_checked) override;
72 
73  void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
74  grpc_error_handle error) override {
76  }
77 
78  int cmp(const grpc_security_connector* other_sc) const override;
79 };
80 
82  public:
85  : grpc_server_security_connector("" /* url_scheme */,
86  std::move(server_creds)) {}
87 
89  grpc_pollset_set* /* interested_parties */,
90  HandshakeManager* handshake_manager) override;
91 
92  void check_peer(tsi_peer peer, grpc_endpoint* ep,
94  grpc_closure* on_peer_checked) override;
95 
96  void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
97  grpc_error_handle error) override {
99  }
100 
101  int cmp(const grpc_security_connector* other) const override;
102 };
103 
104 } // namespace grpc_core
105 
106 #endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_INSECURE_INSECURE_SECURITY_CONNECTOR_H \
107  */
grpc_core::InsecureServerSecurityConnector::cancel_check_peer
void cancel_check_peer(grpc_closure *, grpc_error_handle error) override
Definition: insecure_security_connector.h:96
grpc_core::InsecureServerSecurityConnector
Definition: insecure_security_connector.h:81
grpc_core::InsecureChannelSecurityConnector
Definition: insecure_security_connector.h:53
grpc_core::InsecureServerSecurityConnector::cmp
int cmp(const grpc_security_connector *other) const override
Definition: insecure_security_connector.cc:114
grpc_auth_context
Definition: security_context.h:63
grpc_server_security_connector
Definition: security_connector.h:171
grpc_core
Definition: call_metric_recorder.h:31
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
error
grpc_error_handle error
Definition: retry_filter.cc:499
closure.h
grpc_core::InsecureChannelSecurityConnector::cancel_check_peer
void cancel_check_peer(grpc_closure *, grpc_error_handle error) override
Definition: insecure_security_connector.h:73
grpc_core::InsecureChannelSecurityConnector::check_peer
void check_peer(tsi_peer peer, grpc_endpoint *ep, RefCountedPtr< grpc_auth_context > *auth_context, grpc_closure *on_peer_checked) override
Definition: insecure_security_connector.cc:78
grpc_security.h
credentials.h
grpc_channel_args
Definition: grpc_types.h:132
grpc_core::kInsecureTransportSecurityType
const char kInsecureTransportSecurityType[]
Definition: insecure_security_connector.cc:39
grpc_core::InsecureChannelSecurityConnector::InsecureChannelSecurityConnector
InsecureChannelSecurityConnector(RefCountedPtr< grpc_channel_credentials > channel_creds, RefCountedPtr< grpc_call_credentials > request_metadata_creds)
Definition: insecure_security_connector.h:56
grpc_types.h
grpc_security_connector
Definition: security_connector.h:61
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::RefCountedPtr< grpc_channel_credentials >
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
grpc.h
security_connector.h
arena_promise.h
error.h
grpc_core::InsecureChannelSecurityConnector::CheckCallHost
ArenaPromise< absl::Status > CheckCallHost(absl::string_view host, grpc_auth_context *auth_context) override
Definition: insecure_security_connector.cc:61
transport_security_interface.h
grpc_core::InsecureChannelSecurityConnector::add_handshakers
void add_handshakers(const grpc_channel_args *args, grpc_pollset_set *, HandshakeManager *handshake_manager) override
Registers handshakers with handshake_mgr.
Definition: insecure_security_connector.cc:69
grpc_core::InsecureServerSecurityConnector::InsecureServerSecurityConnector
InsecureServerSecurityConnector(RefCountedPtr< grpc_server_credentials > server_creds)
Definition: insecure_security_connector.h:83
tsi_peer
Definition: transport_security_interface.h:238
grpc_core::ArenaPromise
Definition: arena_promise.h:152
grpc_core::TestOnlyMakeInsecureAuthContext
RefCountedPtr< grpc_auth_context > TestOnlyMakeInsecureAuthContext()
Definition: insecure_security_connector.cc:57
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc_core::InsecureServerSecurityConnector::check_peer
void check_peer(tsi_peer peer, grpc_endpoint *ep, RefCountedPtr< grpc_auth_context > *auth_context, grpc_closure *on_peer_checked) override
Definition: insecure_security_connector.cc:105
handshaker.h
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
ref_counted_ptr.h
grpc_channel_security_connector
Definition: security_connector.h:118
grpc_core::HandshakeManager
Definition: handshaker.h:98
iomgr_fwd.h
endpoint.h
grpc_server_security_connector::server_creds
const grpc_server_credentials * server_creds() const
Definition: security_connector.h:181
grpc_channel_security_connector::channel_creds
const grpc_channel_credentials * channel_creds() const
Definition: security_connector.h:135
grpc_error
Definition: error_internal.h:42
grpc_core::InsecureChannelSecurityConnector::cmp
int cmp(const grpc_security_connector *other_sc) const override
Definition: insecure_security_connector.cc:87
grpc_closure
Definition: closure.h:56
grpc_channel_security_connector::request_metadata_creds
const grpc_call_credentials * request_metadata_creds() const
Definition: security_connector.h:141
grpc_endpoint
Definition: endpoint.h:105
grpc_core::InsecureServerSecurityConnector::add_handshakers
void add_handshakers(const grpc_channel_args *args, grpc_pollset_set *, HandshakeManager *handshake_manager) override
Definition: insecure_security_connector.cc:96
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:20