directus-extension-api-docs
directus-extension-api-docs copied to clipboard
Authorize does not work and custom endpoints within bundle extensions
Hi,
Thanks a lot for your plugin. It's almost perfekt ;)
I have two problems.
- I am not able to use Authorize to login to directus and therefore I am not able to test the endpoints. I tried to add Bearer eyJ...... in the HEADER section (second textfield) or the access_token textfield wit eyJ.... I always get the error 401. On the server I receive the message "DEBUG: Invalid user credentials.". If I add the bearer to the url with access_token it works fine.
For example on the GET /presets there is the lock symbol at the right side. At this endpoint the Auhtorisation header will be send.
But on the /users/me the lock is missing and therefore the header will not be send.
How can I add the lock symbol to all endpoints.
- I generated a bundle extension in directus. It seams, your plugin does not load the files in the plugin folder 'src/endpoint_..' My only way to create end points was to create an dummy endpoint in the endpoints/test folder.
Do you have an idea how I can solve my problem? Thanks
Hi ludi81,
Thanks for appreciating this little plugin for Directus and thanks for sharing your feedback.
I respond to the points made:
-
for custom endpoints you can create a security schema in the oas.yaml file and the swagger interface will work fine with the padlock. As for the endpoints autogenerated by directus, these are not gonfigurable from the YAML file of this plugin, so the output received by swagger for these endpoints is directly produced by Directus. We could think about reworking these endpoints too, it would require a new evolution on the plugin.
-
at the moment it is possible to include it as a dependency in a Directus project, this plugin has not yet been developed to be included in an extension bundle, it requires some updates on the logic for retrieving the configuration files. Maybe if you can share an example of your extension-bundle I can think about how to implement it.
I hope soon to be able to make some improvements to the plugin, in the meantime I thank you and if you have any advice or fixes, they are welcome.
🤠😎🙏 Giona