Resolve "Introduce an optional expiration date for SSH keys"
What does this MR do?
For #36243 (closed)
This change gives the option to a user to set an (optional, non mandatory) expiry date for SSH keys when creating a new SSH key.
In this iteration, we are not enforcing this expiry or disrupting any workflow of the user, rather we are only providing information messages in the console when performing operations with an expired or soon-to-expire keys, so that users can generate new keys in its place.
In the coming iterations, we plan to enforce the expiry of keys.
Changes made:
- Users have the option to specify an expiry date when creating a new key, this is optional to specify, default is
nil
(Never expires)
- "!" icon in the keys page alongside a key when it is expired.
- The same partial is being reused in the admin/users SSH keys page.
- Console message "INFO: Your SSH key has expired. Please generate a new key" when using an expired key for git operations.
- Console message "INFO: Your SSH key will expire soon. Please generate a new key" when using a key set to expire in the next 7 days.
-
expires_at
attribute is now exposed via the API for keys.
Unchanged:
- No disruption to any git workflow, all operations are performed like before, even if the key has expired.
- No system-wide UI notifications or banners to notify the user of an expired key.
- No emails sent to the user about a soon to be expired key.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Manoj M J [On PTO]