-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Handle auto-creation of API user along Super User #2322
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR @Amphaal. API secrets are randomly generated, so it doesn't seem right to pass a manually constructed random looking secret into the DB from the CLI. Doesn't seem semantically right. I do agree that it'd be good to have a way to generate a fully capable API user programmatically. Would be good to know how other apps approach this. Have you seen examples? |
No problem @knadh ! I agree with you, this is kind of an hack to allow "admin" permissions - like we would have pre v4 - which allows me to setup listmonk using automation. What I am used to regarding token usage are:
Regarding current implementation, the first solution seems to fit. Let me know your thoughts about this ! |
Thanks @Amphaal. API tokens are auto-generated strings, so passing a manually constructed string seems off. It then allows for string patterns (including proper words) to be passed as tokens, which technically is fine, but semantically, incorrect. I think a more semantic, but slightly clunky approach is to auto-generate a token (when |
Hi @Amphaal. Would you be able to amend the PR with a |
hi @knadh, sure ! Been under the water the past 2 weeks, but I should be able to push something nice this weekend :) If not, do not hesitate to ping back ! |
Are there any workarounds while this is not implemented? I wrote a little shell script inserting the API user into the DB, but for some reasons auth won't work for him However, if I log in manually as superuser and add another user in the dashboard, the original API user auth magically starts working 😀 The issue is that I need this for integration tests in CI so using dashboard is a bit problematic |
Hi, still under the water, but just a quick heads-up; I used a workaround for my CI / IaC (using Ansible), and it looks like this:
This worked for me in the meantime. |
Would fix #2314