Support setting customizable timeouts for git CLI 2FA via UI & API
What does this MR do?
For #296669 (closed)
This feature will be available only in GitLab Premium and above.
This change
-
uses the value in ApplicationSettings#git_two_factor_session_expiry
to enforce session timeouts for Git CLI operations -
allows to set this value via the UI (via admin/application_settings/general
->Account and limit
section) -
allows to set this value via the settings API
Assumptions on this new value:
-
The default is 15 minutes. -
The minimum allowed is 1 minute. -
The maximum allowed is 1 week (= 10080 minutes) - We do not currently allow setting
unlimited
/no expiry
, but this change be easily changed later via easing the model validations.
Screenshots (strongly suggested)
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