Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
test
core
util
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
18
#include <
grpc/support/port_platform.h
>
19
20
#include <list>
21
22
#include "
src/core/lib/resource_quota/resource_quota.h
"
23
#include "
src/core/lib/security/authorization/evaluate_args.h
"
24
#include "
src/core/lib/security/context/security_context.h
"
25
#include "
test/core/util/mock_authorization_endpoint.h
"
26
27
namespace
grpc_core
{
28
29
class
EvaluateArgsTestUtil
{
30
public
:
31
EvaluateArgsTestUtil
() =
default
;
32
33
~EvaluateArgsTestUtil
() {
delete
channel_args_
; }
34
35
void
AddPairToMetadata
(
const
char
*
key
,
const
char
*
value
) {
36
metadata_
.
Append
(
key
,
Slice::FromStaticString
(
value
),
37
[](
absl::string_view
,
const
Slice
&) {
38
// We should never ever see an error here.
39
abort();
40
});
41
}
42
43
void
SetLocalEndpoint
(
absl::string_view
local_uri) {
44
endpoint_
.
SetLocalAddress
(local_uri);
45
}
46
47
void
SetPeerEndpoint
(
absl::string_view
peer_uri) {
48
endpoint_
.
SetPeer
(peer_uri);
49
}
50
51
void
AddPropertyToAuthContext
(
const
char
*
name
,
const
char
*
value
) {
52
auth_context_
.
add_cstring_property
(
name
,
value
);
53
}
54
55
EvaluateArgs
MakeEvaluateArgs
() {
56
channel_args_
=
57
new
EvaluateArgs::PerChannelArgs
(&
auth_context_
, &
endpoint_
);
58
return
EvaluateArgs
(&
metadata_
,
channel_args_
);
59
}
60
61
private
:
62
MemoryAllocator
allocator_
=
63
ResourceQuota::Default
()->
memory_quota
()->CreateMemoryAllocator(
64
"EvaluateArgsTestUtil"
);
65
ScopedArenaPtr
arena_
=
MakeScopedArena
(1024, &
allocator_
);
66
grpc_metadata_batch
metadata_
{
arena_
.get()};
67
MockAuthorizationEndpoint
endpoint_
{
/*local_uri=*/
""
,
/*peer_uri=*/
""
};
68
grpc_auth_context
auth_context_
{
nullptr
};
69
EvaluateArgs::PerChannelArgs
*
channel_args_
=
nullptr
;
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