Introduce Project bot user
What does this MR do?
This MR adds a new type if user - Project bot.
The idea is to utilize Task bot users as a means to generate project level access token.
In order to differentiate this user from other kind of users, we save the user_type
as project_bot
.
The user has it's own set of policies defined, as it's expected behavior does not map to any of the existing user types that we have.
Also, Project Bots are excluded from licenses.
Query for active users:
SELECT
COUNT(*)
FROM
"users"
WHERE ("users"."state" IN ('active'))
AND (ghost IS NOT TRUE)
AND ("users"."user_type" IS NULL
OR "users"."user_type" NOT IN (2, 1, 3));
Execution Time:
Time: 1.849 s
- planning: 0.287 ms
- execution: 1.849 s
- I/O read: 0.000 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 404983 (~3.10 GiB) from the buffer pool
- reads: 0 from the OS file cache, including disk I/O
- dirtied: 14 (~112.00 KiB)
- writes: 0
Query Plan:
https://explain.depesz.com/s/qRBm
Ref: #210057 (closed)
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 Peter Leitzen