Provide option to disable project access tokens
What does this MR do?
Customers with strong internal access controls may not want the option to use project access tokens, as they obfuscate which user performed a task. This MR adds the option to enable/disable project access tokens on the group level.
Enabling and disabling of project access tokens can only be done in root groups. All subgroups under them will follow the setting of their group ancestor. Projects in personal namespaces will be able to use project access tokens.
Migration output:
% rails db:migrate
== 20210308195708 AddResourceAccessTokensEnabledToNamespaceSettings: migrating
-- add_column(:namespace_settings, :resource_access_tokens_enabled, :boolean, {:default=>true, :null=>false})
-> 0.0075s
== 20210308195708 AddResourceAccessTokensEnabledToNamespaceSettings: migrated (0.0137s)
% rails db:rollback STEP=1
== 20210308195708 AddResourceAccessTokensEnabledToNamespaceSettings: reverting
-- remove_column(:namespace_settings, :resource_access_tokens_enabled)
-> 0.0019s
== 20210308195708 AddResourceAccessTokensEnabledToNamespaceSettings: reverted (0.0084s)
Screenshots (strongly suggested)
Under Group > Settings > General > Permissions, LFS, 2FA:
At the very bottom of the Project access tokens docs page: (help/user/project/settings/project_access_tokens)
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
Related to #287707 (closed)