Skip to content
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

Authorize does not work and custom endpoints within bundle extensions #22

Open
ludi81 opened this issue Nov 29, 2023 · 1 comment
Open

Comments

@ludi81
Copy link

ludi81 commented Nov 29, 2023

Hi,

Thanks a lot for your plugin. It's almost perfekt ;)

I have two problems.

  1. 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.
2023-11-29_19-24-48

But on the /users/me the lock is missing and therefore the header will not be send.
2023-11-29_19-26-09

How can I add the lock symbol to all endpoints.

  1. 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

@ludi81 ludi81 changed the title Authorize does not work and custome endpoints in with bundle extensions Authorize does not work and custom endpoints within bundle extensions Nov 30, 2023
@sacconazzo
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants