Implement Duplicate Functionality for API Keys #3395
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces a convenient "Duplicate" option for API keys within the GoAlert application. Users can now effortlessly create a new API key based on an existing one, streamlining key management and improving user efficiency. This feature applies to both active and expired keys, ensuring a continuous workflow. With user experience in mind, the duplication process is designed to be intuitive and seamless, mirroring the expiration characteristics of the source key relative to the current time.
Which issue(s) this PR fixes:
This is part of #3007
Out of Scope:
Visual updates for expired keys and special sorting considerations for nearly expired keys are out of scope for this PR.
Screenshots:
Describe any introduced user-facing changes:
Users will notice a new "Duplicate" option when managing API keys. This option allows the generation of a new key with an incremented name and an expiration period set to an equivalent duration from the current moment, just as the original key was set from its creation time.
Describe any introduced API changes:
N/A
Additional Info:
This PR also includes a fix for the previously unsorted API keys. Now, keys will be sorted by name, recognizing numeric values which will improve the findability and management of multiple keys. The "Duplicate" feature respects the expiration paradigm of the original key, maintaining consistency in key lifecycle management.
Note: This feature is behind an experimental flag, start with
make start EXPERIMENTAL=gql-api-keys