https://kotlinlang.org logo
Title
n

Nezteb

04/25/2019, 9:36 PM
It seems you can’t add routes in between two filters. In my case I want a certain filter to be skipped for a few routes. Is there a way to do that? Only apply a Filter to a couple routes out of many?
d

dave

04/25/2019, 9:47 PM
Nope. You'll have to apply the filter individually, or wrap everything and come up with another way to discriminate. What was your use case?
n

Nezteb

04/25/2019, 9:50 PM
Previously I had an auth filter that would return 401 unless the user passed a specific token. But then I realized there are a few endpoints (mostly health ones) that need to be accessible unathenticated. So I changed it so the auth endpoint now sets a boolean flag, and only checks it for the endpoints that actually do things.
d

dave

04/26/2019, 5:12 AM
Best thing here is to split the API into route block sections and then some filters to the ones you want protected