-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incoherent behaviour of publicEndpoints option in authenticationMiddleware #220
Comments
It makes no sense to inherit the secure level of sub resources - at least if the resource itself is public (e.g. if the sub resource containing confidential data). Therefore a predicate like equals makes more sense. On the other hand, equals is not feasible, as |
It would be possible to use req.route to get the route of the request. So you could do The only issue is that if you mount express sub apps you would probably need to create middleware instances for each so that the route is given correctly. |
Indeed I think inheriting is not a good idea. To really solve the issue I guess we need to support passing a regexp to `publicEndpoints?! |
Maybe just a callback where users can define their own logic? So everyone can use whatever they prefer. I feel that honestly users should just apply middleware only where needed, so that you wouldn't need to use this at all. If this is not possible they could then do it in whatever way they like (regex, route parsing, perhaps even header based if there is a possiblity of an auth proxy in front). |
authmosphere/src/express-tooling.ts
Line 183 in e47c422
When a public endpoint
test
is added, than all endpoints starting withtest
(e.g.test-another
) will also be public which is not expected.We should discuss how to handle subressources like
test/another
=> should they also be public by default or not?The text was updated successfully, but these errors were encountered: