Skip to content

Introduce Project bot user

Aishwarya Subramanian requested to merge task_bot into master

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

Availability and Testing

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

Merge request reports