Go to the documentation of this file.
22 #include "absl/memory/memory.h"
23 #include "absl/strings/string_view.h"
36 switch (permission.
type) {
38 std::vector<std::unique_ptr<AuthorizationMatcher>>
matchers;
45 std::vector<std::unique_ptr<AuthorizationMatcher>>
matchers;
52 return absl::make_unique<NotAuthorizationMatcher>(
55 return absl::make_unique<AlwaysAuthorizationMatcher>();
57 return absl::make_unique<HeaderAuthorizationMatcher>(
60 return absl::make_unique<PathAuthorizationMatcher>(
63 return absl::make_unique<IpAuthorizationMatcher>(
66 return absl::make_unique<PortAuthorizationMatcher>(permission.
port);
68 return absl::make_unique<MetadataAuthorizationMatcher>(permission.
invert);
70 return absl::make_unique<ReqServerNameAuthorizationMatcher>(
78 switch (principal.
type) {
80 std::vector<std::unique_ptr<AuthorizationMatcher>>
matchers;
87 std::vector<std::unique_ptr<AuthorizationMatcher>>
matchers;
94 return absl::make_unique<NotAuthorizationMatcher>(
97 return absl::make_unique<AlwaysAuthorizationMatcher>();
99 return absl::make_unique<AuthenticatedAuthorizationMatcher>(
102 return absl::make_unique<IpAuthorizationMatcher>(
105 return absl::make_unique<IpAuthorizationMatcher>(
109 return absl::make_unique<IpAuthorizationMatcher>(
112 return absl::make_unique<HeaderAuthorizationMatcher>(
115 return absl::make_unique<PathAuthorizationMatcher>(
118 return absl::make_unique<MetadataAuthorizationMatcher>(principal.
invert);
125 if (!matcher->Matches(
args)) {
134 if (matcher->Matches(
args)) {
169 address =
args.GetLocalAddress();
175 address =
args.GetPeerAddress();
199 std::vector<absl::string_view> uri_sans =
args.GetUriSans();
200 if (!uri_sans.empty()) {
201 for (
const auto& uri : uri_sans) {
207 std::vector<absl::string_view> dns_sans =
args.GetDnsSans();
208 if (!dns_sans.empty()) {
209 for (
const auto& dns : dns_sans) {
static std::unique_ptr< AuthorizationMatcher > Create(Rbac::Permission permission)
std::unique_ptr< AuthorizationMatcher > principals_
bool Matches(const EvaluateArgs &args) const override
std::vector< std::unique_ptr< Permission > > permissions
XdsRouteConfigResource::Route::Matchers matchers
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE
const uint32_t prefix_len_
const StringMatcher matcher_
HeaderMatcher header_matcher
grpc_resolved_address subnet_address_
IpAuthorizationMatcher(Type type, Rbac::CidrRange range)
std::unique_ptr< AuthorizationMatcher > permissions_
bool Matches(const EvaluateArgs &args) const override
bool grpc_sockaddr_match_subnet(const grpc_resolved_address *address, const grpc_resolved_address *subnet_address, uint32_t mask_bits)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
def c_str(s, encoding='ascii')
const StringMatcher matcher_
grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address *out, const char *addr, int port)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
absl::optional< StringMatcher > string_matcher
const absl::optional< StringMatcher > matcher_
bool Matches(const EvaluateArgs &args) const override
std::vector< std::unique_ptr< Principal > > principals
bool Match(absl::string_view value) const
bool Matches(const EvaluateArgs &args) const override
StringMatcher string_matcher
HeaderMatcher header_matcher
std::unique_ptr< AuthorizationMatcher > matcher_
bool Matches(const EvaluateArgs &args) const override
std::string grpc_error_std_string(grpc_error_handle error)
std::vector< std::unique_ptr< AuthorizationMatcher > > matchers_
bool Matches(const EvaluateArgs &args) const override
#define GRPC_ERROR_UNREF(err)
#define GRPC_TLS_TRANSPORT_SECURITY_TYPE
std::vector< std::unique_ptr< AuthorizationMatcher > > matchers_
bool Matches(const EvaluateArgs &args) const override
bool Matches(const EvaluateArgs &args) const override
void grpc_sockaddr_mask_bits(grpc_resolved_address *address, uint32_t mask_bits)
bool Matches(const EvaluateArgs &) const override
#define GRPC_ERROR_IS_NONE(err)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:22