-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Applying AuthenticationFunc for subrouter #825
Comments
Were you able to find some help over at |
Hey both - I think this question was largely around "can we tweak the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
I'm using your great library in combination with https://github.com/deepmap/oapi-codegen in order to migrate custom endpoints to openApi one by one.
To reach this I defined openApi endpoints in yml file and used dedicated subrouter.
The problem was that authentication was not properly applied for endpoints defined on subrouter (while on the main router it was working fine).
So for the options:
used like that:
my authentication test doesn't pass
while if I am defining options for the whole router:
mux.NewRouter().Use(chi_middleware.OapiRequestValidatorWithOptions(doc, &opts))
then authentication tests are passed
I want to authenticate with AuthenticationFunc on subrouter as it provides much more flexibility on migration scenarios
Is there a way to fix it?
The text was updated successfully, but these errors were encountered: