fixes #2355 implement API key management system

- Added API key get, creation, editing, and revocation methods.

- Updated the profile template to include API key management features.

- Updated the database schema to support the new API key system, including additional fields for key management.

- Added client-side JavaScript functionality to handle API key operations and display responses.

- Update tools/htm.ws with the new way to authenticate.

- Restriction of certain api methods when used with an api key

- Backward compatibility with older apps
This commit is contained in:
Linty
2025-06-09 20:35:57 +02:00
parent 2624be1c90
commit ae740ba3af
20 changed files with 1937 additions and 102 deletions
+39
View File
@@ -477,3 +477,42 @@ $lang['Choose how you want to see your gallery'] = 'Choose how you want to see y
$lang['Change your password'] = 'Change your password';
$lang['Options'] = 'Options';
$lang['Your changes have been applied.'] = 'Your changes have been applied.';
$lang['Create API Keys to secure your acount'] = 'Create API Keys to secure your account';
$lang['API Keys'] = 'API Keys';
$lang['Created at'] = 'Created at';
$lang['Last use'] = 'Last use';
$lang['Expires in'] = 'Expires in';
$lang['Expired on'] = 'Expired on';
$lang['Never'] = 'Never';
$lang['New API Key'] = 'New API Key';
$lang['Show expired keys'] = 'Show expired keys';
$lang['Hide expired keys'] = 'Hide expired keys';
$lang['Generate API Key'] = 'Generate API Key';
$lang['Create a new API key to secure your account.'] = 'Create a new API key to secure your account.';
$lang['API Key name'] = 'API Key name';
$lang['Duration'] = 'Duration';
$lang['Custom date'] = 'Custom date';
$lang['Generate key'] = 'Generate key';
$lang['Save your secret Key and ID'] = 'Save your secret Key and ID';
$lang['This will not be displayed again. You must copy it to continue.'] = 'This will not be displayed again. You must copy it to continue.';
$lang['Done'] = 'Done';
$lang['Public key copied.'] = 'Public key copied.';
$lang['Secret key copied. Keep it in a safe place.'] = 'Secret key copied. Keep it in a safe place.';
$lang['Impossible to copy automatically. Please copy manually.'] = 'Impossible to copy automatically. Please copy manually.';
$lang['The api key has been successfully created.'] = 'The API key has been successfully created.';
$lang['API Key not found'] = 'API Key not found';
$lang['Expired'] = 'Expired';
$lang['API Key has been successfully revoked.'] = 'API Key has been successfully revoked.';
$lang['API Key has been successfully edited.'] = 'API Key has been successfully edited.';
$lang['No expiration'] = 'No expiration';
$lang['must not be empty'] = 'must not be empty';
$lang['The secret key can no longer be displayed.'] = 'The secret key can no longer be displayed.';
$lang['Revoked'] = 'Revoked';
$lang['Revoke'] = 'Revoke';
$lang['The email %s will be used to notify you when your API key is about to expire.'] = 'The email %s will be used to notify you when your API key is about to expire.';
$lang['You have no email address, so you will not be notified when your API key is about to expire.'] = 'You have no email address, so you will not be notified when your API key is about to expire.';
$lang['you must choose a date'] = 'you must choose a date';
$lang['This API key was manually revoked on %s'] = 'This API key was manually revoked on %s';
$lang['Edit API Key'] = 'Edit API Key';
$lang['Do you really want to revoke the "%s" API key?'] = 'Do you really want to revoke the "%s" API key?';
$lang['To manage your API keys, please log in with your username/password.'] = 'To manage your API keys, please log in with your username/password.';