Use composite oauth token for Duo Workflows CI execution

What does this MR do and why?

Summary of Changes

This merge request adds support for service accounts to execute Duo Workflows in CI/CD pipelines. The key changes include:

  1. Modifying the workflow policy to allow service accounts to access and update workflows they don't own
  2. Creating a new service that generates composite OAuth access tokens for workflows running in CI
  3. Updating the API to use these composite tokens instead of regular OAuth tokens based on the use_service_account parameter.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Onboard duo workflow following steps in !182894 (merged) or via the admin UI.
  2. Fetch the Duo Workflow service account user, ::Ai::Setting.instance.duo_workflow_service_account_user .
  3. Enable FF Feature.enable(:duo_workflow, service_account_user)
  4. Manually add developer access for the project where you want to run Duo Workflow. project.add_developer(service_account_user)
  5. Run a CI workflow, following instructions, it should run without any errors. This workflow will use composite identity token for accessing all the GitLab apis and git tools.
Edited by Surabhi Suman

Merge request reports

Loading