panel
panel copied to clipboard
feature: Closes #1831 - Add an artisan command to create an API key from the command line
This PR add an artisan command that allows for someone to create an API key from the command line.
This allows the creation of both a (deprecated) ApiKey::TYPE_APPLICATION and a ApiKey::TYPE_ACCOUNT.
The TYPE_APPLICATION key may be needed in cases where someone would want to automate the deployment of the panel and Wings instances without using the Panel which is the case when you want to deploy the project using a tool like Ansible, thus why it was implemented even though Deprecated.
You aren't actually checking the user password.
IMO the command should only be able to create application api keys. Also I don't think application api keys are meant to be deprecated, not sure why there is a comment saying so.
I do understand, I am going to make the changes towards the authentication of the user. I do agree that only application keys should be able to be created using that, I was confused with the "deprecated" statement regarding them, I will make changes regarding that too.
Actually, I am questionning if I should be authenticating the user here because of the fact that it's especially for the admin panel on the installation. It will most likely used right after the creation of the admin user for the Panel and would assing the token to it.
If I am loggin in the user, should I use the Pterodactyl\Http\Controllers\Auth\LoginController or should I simply validate the password in a login request? I am really trying to learn about best practices for that PR.
Actually, I am questionning if I should be authenticating the user here because of the fact that it's especially for the admin panel on the installation. It will most likely used right after the creation of the admin user for the Panel and would assing the token to it.
Yeah, for just application api keys I don't see a reason for any auth.
Also I don't think application api keys are meant to be deprecated, not sure why there is a comment saying so.
Don't know if new management has decided to reverse the decision, but they were deprecated by Dane, the comment is no mistake. https://discord.com/channels/122900397965705216/936744899787784282/1018218699909505157