Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

Feature: Add API Key support (🚧)

Open grablair opened this issue 11 months ago • 8 comments

Resolves https://github.com/HiEventsDev/Hi.Events/issues/339

This is a WIP change to add API keys. The feature is implemented and admins can create API keys and they can be used to access the APIs in a granular fashion. I still need to complete all translations, and want to give @daveearley an opportunity to review this sooner rather than later.

This also adds a migration to add account_id to the token table, so tokens can be set up on a per-account basis, and the auth flow knows which account a token is attached to, as we don't have the JWT payload to tell us. (TODO: May need to implement key filtering from view for multiple-account situations)

Tested with expired tokens, tokens with missing abilities, and valid tokens.

Screenshot 2025-01-18 at 09 46 30 Screenshot 2025-01-18 at 09 46 37 Screenshot 2025-01-18 at 09 46 46 Screenshot 2025-01-18 at 09 47 06

Checklist

  • [X] I have read the contributing guidelines.
  • [X] My code is of good quality and follows the coding standards of the project.
  • [X] I have tested my changes, and they work as expected.

Thank you for your contribution! 🎉

grablair avatar Jan 18 '25 18:01 grablair

Nice! Thanks for contributing this. I'll set aside some time tomorrow to review it.

daveearley avatar Jan 18 '25 20:01 daveearley

Is there somewhere a swagger documentation or the likes for the API?

meilechwieder avatar Jan 20 '25 14:01 meilechwieder

Great work here! Thank you very much for the contribution. If it's OK with you, I can use this branch as the base for auth changes and I can push up some changes/fixes.

You're welcome! Thanks for the review. Definitely feel free to use this as a jumping off point for the auth refactor.

grablair avatar Jan 21 '25 06:01 grablair

@grablair Don't worry about the conflicts here, I'll take care of them

daveearley avatar Mar 06 '25 10:03 daveearley

I haven't forgotten about this! There are a few bugs and performance issues that gave taken priority, but I'll get back to it as soon as I can.

daveearley avatar May 03 '25 21:05 daveearley

any progress on this? can I propose some support to make it merge to upsteam asap?

Mikefluff avatar Jun 10 '25 19:06 Mikefluff

Any progress on this? :)

da-wilky avatar Nov 09 '25 11:11 da-wilky

Good i like it

IbrahimMuhammadyau2019 avatar Nov 09 '25 12:11 IbrahimMuhammadyau2019