-
I am wondering if there is a known approach to making the docs private. I tried creating a subclass of OpenAPIController with guards specified, but this approach did not seem to work for me. The guard I am using works for other controllers, but when applied to the OpenAPIController, there is an issue with the guard trying to access "auth" in scope that is not there for some reason. I am open to other approaches, but for the sake of discussion, here is what I have: The error when trying to access any of the schema endpoints:
What I did to get here:
That controller is specified in the OpenAPI config, and then:
It may be worth noting that Also, here is the guard:
Again, maybe there is just a standard way to do this and I can chuck all of the above. Otherwise, any thoughts on going about troubleshooting this would be much appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It turns out that I had "/schema" as an exclude path on my SessionAuth instance. I removed that and my approach above now seems to be working. The gist of it is simply to subclass OpenAPIController and provide it with whatever guards you would normally use on a controller for your authentication approach:
Then specify that as the |
Beta Was this translation helpful? Give feedback.
It turns out that I had "/schema" as an exclude path on my SessionAuth instance. I removed that and my approach above now seems to be working. The gist of it is simply to subclass OpenAPIController and provide it with whatever guards you would normally use on a controller for your authentication approach:
Then specify that as the
openapi_controller
on the OpenAPIConfig.