evaluate_args_test_util.h
Go to the documentation of this file.
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
16 #define GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
17 
19 
20 #include <list>
21 
26 
27 namespace grpc_core {
28 
30  public:
31  EvaluateArgsTestUtil() = default;
32 
34 
35  void AddPairToMetadata(const char* key, const char* value) {
37  [](absl::string_view, const Slice&) {
38  // We should never ever see an error here.
39  abort();
40  });
41  }
42 
44  endpoint_.SetLocalAddress(local_uri);
45  }
46 
48  endpoint_.SetPeer(peer_uri);
49  }
50 
51  void AddPropertyToAuthContext(const char* name, const char* value) {
53  }
54 
59  }
60 
61  private:
63  ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
64  "EvaluateArgsTestUtil");
67  MockAuthorizationEndpoint endpoint_{/*local_uri=*/"", /*peer_uri=*/""};
70 };
71 
72 } // namespace grpc_core
73 
74 #endif // GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
grpc_core::EvaluateArgsTestUtil::AddPairToMetadata
void AddPairToMetadata(const char *key, const char *value)
Definition: evaluate_args_test_util.h:35
grpc_core::MakeScopedArena
ScopedArenaPtr MakeScopedArena(size_t initial_size, MemoryAllocator *memory_allocator)
Definition: src/core/lib/resource_quota/arena.h:130
grpc_core::EvaluateArgs
Definition: evaluate_args.h:34
grpc_auth_context
Definition: security_context.h:63
grpc_core::MetadataMap::Append
void Append(absl::string_view key, Slice value, MetadataParseErrorFn on_error)
Definition: metadata_batch.h:1156
grpc_event_engine::experimental::MemoryAllocator
Definition: memory_allocator.h:35
grpc_auth_context::add_cstring_property
void add_cstring_property(const char *name, const char *value)
Definition: security_context.cc:259
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::Slice
Definition: src/core/lib/slice/slice.h:282
grpc_core::slice_detail::StaticConstructors< Slice >::FromStaticString
static Slice FromStaticString(const char *s)
Definition: src/core/lib/slice/slice.h:201
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::EvaluateArgsTestUtil::MakeEvaluateArgs
EvaluateArgs MakeEvaluateArgs()
Definition: evaluate_args_test_util.h:55
grpc_core::EvaluateArgsTestUtil::SetPeerEndpoint
void SetPeerEndpoint(absl::string_view peer_uri)
Definition: evaluate_args_test_util.h:47
setup.name
name
Definition: setup.py:542
grpc_core::MockAuthorizationEndpoint
Definition: mock_authorization_endpoint.h:24
grpc_core::EvaluateArgsTestUtil::AddPropertyToAuthContext
void AddPropertyToAuthContext(const char *name, const char *value)
Definition: evaluate_args_test_util.h:51
evaluate_args.h
grpc_core::EvaluateArgsTestUtil::SetLocalEndpoint
void SetLocalEndpoint(absl::string_view local_uri)
Definition: evaluate_args_test_util.h:43
grpc_core::ScopedArenaPtr
std::unique_ptr< Arena, ScopedArenaDeleter > ScopedArenaPtr
Definition: src/core/lib/resource_quota/arena.h:129
grpc_core::EvaluateArgsTestUtil::EvaluateArgsTestUtil
EvaluateArgsTestUtil()=default
grpc_core::EvaluateArgsTestUtil::~EvaluateArgsTestUtil
~EvaluateArgsTestUtil()
Definition: evaluate_args_test_util.h:33
grpc_core::ResourceQuota::memory_quota
MemoryQuotaRefPtr memory_quota()
Definition: src/core/lib/resource_quota/resource_quota.h:51
grpc_core::EvaluateArgsTestUtil::channel_args_
EvaluateArgs::PerChannelArgs * channel_args_
Definition: evaluate_args_test_util.h:69
grpc_core::MockAuthorizationEndpoint::SetLocalAddress
void SetLocalAddress(absl::string_view local_address)
Definition: mock_authorization_endpoint.h:51
grpc_core::ResourceQuota::Default
static ResourceQuotaRefPtr Default()
Definition: resource_quota.cc:27
grpc_core::EvaluateArgsTestUtil
Definition: evaluate_args_test_util.h:29
grpc_core::EvaluateArgsTestUtil::allocator_
MemoryAllocator allocator_
Definition: evaluate_args_test_util.h:62
resource_quota.h
grpc_core::EvaluateArgsTestUtil::metadata_
grpc_metadata_batch metadata_
Definition: evaluate_args_test_util.h:66
grpc_core::EvaluateArgsTestUtil::auth_context_
grpc_auth_context auth_context_
Definition: evaluate_args_test_util.h:68
value
const char * value
Definition: hpack_parser_table.cc:165
security_context.h
key
const char * key
Definition: hpack_parser_table.cc:164
grpc_core::EvaluateArgs::PerChannelArgs
Definition: evaluate_args.h:38
grpc_core::EvaluateArgsTestUtil::endpoint_
MockAuthorizationEndpoint endpoint_
Definition: evaluate_args_test_util.h:67
mock_authorization_endpoint.h
grpc_metadata_batch
Definition: metadata_batch.h:1259
grpc_core::EvaluateArgsTestUtil::arena_
ScopedArenaPtr arena_
Definition: evaluate_args_test_util.h:65
grpc_core::MockAuthorizationEndpoint::SetPeer
void SetPeer(absl::string_view peer_address)
Definition: mock_authorization_endpoint.h:47
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:16