First class support for path based APIs in AuthConfig #485
Replies: 5 comments 5 replies
-
Thanks for opening this discussion, @eshepelyuk! Have you considered specifying the This is described in the Host lookup section of the docs. Basically it means the A Envoy, for example, allows you to set context extensions per-route (i.e. per HTTP path, or any HTTP route matcher really). You can define as many AuthConfigs as route path matchers. Just inject a different |
Beta Was this translation helpful? Give feedback.
-
The main problem with path-based lookup is that paths are complex structs, often including variable parts and requiring matching rules beyond 'exact match'. Say, e.g., Say we support path prefixes, would Another problem is path with variables, especially variables in the middle of the path, where the disambiguation may depend on what comes after the variable value but possibly also on the variable value itself. E.g. If one can index an AuthConfig to be looked up from the path of the request, should we allow only a path with no host at all? E.g. And why stop at paths? Should we also support query string params? Headers? Hopefully, it's becoming clear that either it would be a very limited feature (e.g. exact path match only, always requiring a host name preceding it) or what we want to replace Currently, the AuthConfig lookup is very efficient. This is because the index is modeled as a trie, whose only complexity added comes from the host wildcards and sub-domains. Paths (and possibly other kinds of matchers) add new dimensions to this data struct, which may no longer be able to navigate as efficiently. Likely, the whole lookup model would have to change to iterating through a list of matchers, evaluating one by one. I don't know what that would mean for the falling back to an upper AuthConfig when we miss a specific host domain today but still have one indexed to a super domain (see the "Host lookup with wildcards" example.) Sorry for the text wall. But, at the same time, thank you for the opportunity to document this. It's not the first time path-based lookup comes around. It's important for contributors to understand the complexity involved with this request, as much as it is for us to understand the concrete use cases... which I hope you can share more about. |
Beta Was this translation helpful? Give feedback.
-
As for host overriding being hard (impossible) to use via Gateway API, unfortunately that is true. I wish there's something the implementations could about it. Maybe Envoy Gateway can work on its SecurityPolicy so perhaps a I know Istio AuthorizationPolicy will hardly support context extensions, due to it's approach combining Envoy RBAC filter instead of proper per-route ext-authz. |
Beta Was this translation helpful? Give feedback.
-
First of all, I am appreciated for such detailed answers. Unfortunately any proposed options are not suitable for my project case. But because it's in a "startup stage" we've decided to change our API exposure approach from path based to host based, to be able to leverage Authorino. And we are already using it for protecting some of the endpoints. But let me be frank with you, the lack of path based routing support will be a red flag for any big established project that uses path based routing, when assesing Authorino. My experience maybe limited but I haven't met the host based API exposure approach in any real life project I've been working on. So if you're open for advices, I do suggest you folks to implement incomplete, very basic but first class path based routing in Authorino itself. Even if it would cover 50% of users needs - it will be a huge benefit for Authorino, since peoples of CTO\principal architects\tech lead positions woud be much more eager to consider and adopt Authorino in their existing project with parh based routing. Thanks for your work and community support. |
Beta Was this translation helpful? Give feedback.
-
This discussion goes out of control a bit, but I'd like to share some info i recently discovered. Users of Envoy Gateway can leverage |
Beta Was this translation helpful? Give feedback.
-
Currently,
AuthConfig
should be unique per host. In case of path based API, i.e. when routing is path based, using the same host,AuthConfig
becames monstrous, since rules for every API should be put inside the sameAuthConfig
. Another disadvantage is that rules must be delivered seperately from API, i.e. when API is deployed or removed, the centralAuthConfig
must be patched.It would be great to have path based support as 1st level functionality, so every path based API could bring its own
AuthConfig
without needling to maintain single monolithic instance.I am aware of this functionality
https://github.com/Kuadrant/authorino/blob/main/docs/user-guides/host-override.md
but its main disadvantage - is mandatory access to raw Envoy config, that may be impossible if Envoy is used as a part of API Gateway product like Envoy Gateway or Contour etc
Beta Was this translation helpful? Give feedback.
All reactions