support per-route authz override - #7623
Conversation
8d3c18a to
ae100e5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7623 +/- ##
==========================================
+ Coverage 82.34% 82.40% +0.05%
==========================================
Files 130 130
Lines 15879 15980 +101
==========================================
+ Hits 13076 13168 +92
- Misses 2516 2522 +6
- Partials 287 290 +3
🚀 New features to boost your workflow:
|
0e8ff8c to
7dcfe20
Compare
|
IMHO, the test coverage is sufficient. However, I’d appreciate any guidance on how to satisfy Codecov! The PR is also ready for review. |
|
Hi. |
|
Sorry for pinging again — I just wanted to follow up on this. 🙏 Would it be possible to at least add a Support for per-route authz overrides would be a huge help to us, so we’d really appreciate having this on the radar for an upcoming release. |
|
A true pre-AI-era PR =). Not a single line here was written with the help of an LLM. |
Signed-off-by: therealak12 <ak12hastam@gmail.com>
Signed-off-by: therealak12 <ak12hastam@gmail.com>
Signed-off-by: therealak12 <ak12hastam@gmail.com>
Signed-off-by: therealak12 <ak12hastam@gmail.com>
fb60513 to
afd98ca
Compare
Signed-off-by: therealak12 <ak12hastam@gmail.com>
|
I've added support for the |
|
Hi @therealak12 and sorry for the delay! 👋😊 I have some concerns about reusing the full configuration struct at the route level. Route-level overrides with complete ext_authz configs distribute the settings across multiple locations. I had similar concerns previously for the ext_proc design (#5866) which proposed this same approach. Could we define a list of named authorization providers at the virtualhost level and reference them by name in individual routes instead? This matches the pattern used in JWT verification. spec:
virtualhost:
fqdn: app.example.com
tls:
secretName: app-tls
# New list of named authorization providers.
# Deprecates the singular "authorization" field.
authorizationProviders:
- name: default-auth
# Default: true applies to all routes that don't explicitly pick a provider.
# At most one provider can be marked default.
default: true
extensionRef:
name: default-authz
namespace: auth
- name: billing-auth
extensionRef:
name: billing-authz
namespace: billing
# serviceType defaults to grpc, same as today
- name: partner-auth
extensionRef:
name: partner-authz
namespace: partners
serviceType: http
httpSettings:
pathPrefix: /check
routes:
- conditions:
- prefix: /billing
# authPolicy is extended with "require"
authPolicy:
# Require picks a named provider from authorizationProviders
require: billing-auth
context:
scope: billing
services:
- name: billing-svc
port: 80
- conditions:
- prefix: /public
authPolicy:
disabled: true
services:
- name: public-svc
port: 80
- conditions:
- prefix: /
# no authPolicy so it uses default "default-auth" provider automatically
services:
- name: app-svc
port: 80It should provide the same flexibility while keeping providers and routes defined separately, allowing multiple routes to share a single provider configuration without duplication (by referring to same name). |
|
Hi @tsaarni, never mind 🌷. Thanks for your suggestion. IMO, this is better and helps readability. |
|
I've added a design doc. We can discuss the design in the Markdown file, and the implementation will be straightforward afterward. In the meantime, I'm proceeding with the implementation of the proposed design. |
|
I think there’s a potential issue with this design. Per-route JWT provider selection is the model that Envoy exposes. However, ext authz is modeled differently in Envoy. It has separate configuration support per virtual host and per route. If we deprecate the existing |
The PR adds a new
authzOverridefield to HTTPProxy routes, allowing individual routes to use a different external authorization configuration from the virtualhost.For backward compatibility, existing
route.authPolicyand virtual-host/global authz behavior are preserved; However, the legacy field is ignored when authzOverride is set.