Add client for fetching token from Duo Workflow Service
What does this MR do and why?
- This client will be used by the API endpoint being added in: !159569 (merged)
- Using RPC added in gitlab-org/duo-workflow/duo-workflow-service!12 (merged)
- Ruby client here is copied over from files added in gitlab-org/duo-workflow/duo-workflow-service!29 (merged)
- Fixes #471898 (closed)
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.
How to set up and validate locally
- Run Gitlab rails server via GDK
- If you are not running GitLab Rails on
localhost:3000
, updateDUO_WORKFLOW_AUTH__OIDC_GITLAB_URL
value in the .env file on your Duo Workflow Service - Update
.env
in the Duo Workflow service so thatDUO_WORKFLOW_AUTH__ENABLED=true
- Run Duo Workflow Service server (
poetry run python -m duo_workflow_service.server
) - If you are not running the Duo Workflow Service at
localhost:50052
, pass in a different localhost value in the rails console command below. - In gitlab rails console, run:
Ai::DuoWorkflow::DuoWorkflowService::Client.new(duo_workflow_service_url: "localhost:50052", current_user: User.first).generate_token
1.The returned token can be used to authenticate requests to the Duo Workflow Service
Edited by Jessie Young