Skip to content
Snippets Groups Projects

Duo Workflow: Update sequence diagram with auth

Merged Jessie Young requested to merge jy-remote-execution-duo-workflow-auth into main
All threads resolved!
@@ -134,12 +134,14 @@ sequenceDiagram
participant ai_gateway as AI Gateway
end
participant llm_provider as LLM Provider
ide->>gitlab_rails: Request AI Gateway JWT using OAuth token or PAT
ide->>executor: start executor with JWT
user->>ide: trigger workflow from IDE
ide->>gitlab_rails: Create the workflow
gitlab_rails->>gitlab_rails: Create JWT for Duo Workflow Service
gitlab_rails->>gitlab_rails: Create ai_workflow scoped OAuth token
gitlab_rails->>gitlab_rails: Create the workflow
gitlab_rails->>ide: Return the workflow details and JWT and OAuth tokens
ide->>executor: start executor with workflow details and JWT and OAuth token
executor->>+duo_workflow_service: Solve this issue (open grpc connection auth'd with AI Gateway JWT)
duo_workflow_service->>gitlab_rails: Request ai_workflow scoped OAuth token using AI Gateway JWT
duo_workflow_service->>gitlab_rails: Create the workflow (auth'd with ai_workflow OAuth token)
duo_workflow_service->>llm_provider: Ask LLM what to do
llm_provider->>duo_workflow_service: Run rails new my_new_app
duo_workflow_service->>executor: execute `rails new my_new_app`
@@ -150,7+152,7 @@
duo_workflow_service->>gitlab_rails: Save checkpoint and mark completed
duo_workflow_service->>gitlab_rails: Revoke ai_workflow scoped OAuth token
deactivate duo_workflow_service
gitlab_rails->>user: Workflow done!
```
#### With Remote (CI pipeline) execution
```mermaid
sequenceDiagram
participant user as User
participant gitlab_rails as GitLab Rails
box CI-Runner
participant executor as Duo Workflow Executor
end
box AI-gateway service
participant duo_workflow_service as Duo Workflow Service
participant ai_gateway as AI Gateway
end
participant llm_provider as LLM Provider
user->>gitlab_rails: trigger workflow from Web UI
gitlab_rails->>executor: start executor (sends AI Gateway JWT with request)
executor->>+duo_workflow_service: Solve this issue (open grpc connection auth'd with AI Gateway JWT)
duo_workflow_service->>gitlab_rails: Request ai_workflow scoped OAuth token using AI Gateway JWT
duo_workflow_service->>gitlab_rails: Create the workflow (auth'd with ai_workflow OAuth token)
duo_workflow_service->>llm_provider: Ask LLM what to do
llm_provider->>duo_workflow_service: Run rails new my_new_app
duo_workflow_service->>executor: execute `rails new my_new_app`
executor->>duo_workflow_service: result `rails new my_new_app`
duo_workflow_service->>gitlab_rails: Save checkpoint
duo_workflow_service->>llm_provider: What's next?
llm_provider->>duo_workflow_service: You're finished
duo_workflow_service->>gitlab_rails: Save checkpoint and mark completed
duo_workflow_service->>gitlab_rails: Revoke ai_workflow scoped OAuth token
deactivate duo_workflow_service
gitlab_rails->>user: Workflow done!
autonumber
participant user as User
participant gitlab_rails as GitLab Rails
box CI-Runner #LightYellow
participant executor as Duo Workflow Executor
end
box AI-gateway service #LightBlue
participant duo_workflow_service as Duo Workflow Service
participant ai_gateway as AI Gateway
end
participant llm_provider as LLM Provider
note over user,gitlab_rails: User is logged in via web
user->>gitlab_rails: trigger workflow from Web UI
gitlab_rails->>gitlab_rails: Create JWT for Duo Workflow Service
gitlab_rails->>gitlab_rails: Create ai_workflow scoped composite identity OAuth token
gitlab_rails->>gitlab_rails: Create the workflow
gitlab_rails->>executor: start executor in CI pipeline with workflow details and JWT and composite identity OAuth token
note over executor,duo_workflow_service: AI Gateway JWT
executor->>+duo_workflow_service: Solve this issue (open gRPC connection)
note over duo_workflow_service,llm_provider: API Key (from env)
duo_workflow_service->>llm_provider: Ask LLM what to do
llm_provider-->>duo_workflow_service: Run rails new my_new_app
note over duo_workflow_service,executor: Authenticated gRPC
duo_workflow_service->>executor: execute `rails new my_new_app`
executor-->>duo_workflow_service: command result
note over duo_workflow_service,gitlab_rails: Composite OAuth token
duo_workflow_service->>gitlab_rails: Save checkpoint
note over duo_workflow_service,llm_provider: API Key (from env)
duo_workflow_service->>llm_provider: What's next?
llm_provider-->>duo_workflow_service: You're finished
note over duo_workflow_service,gitlab_rails: Composite OAuth token
duo_workflow_service->>gitlab_rails: Save checkpoint & mark completed
duo_workflow_service->>gitlab_rails: Revoke Composite OAuth token
deactivate duo_workflow_service
note over gitlab_rails,user: No Auth Required
gitlab_rails->>user: Workflow done!
```
### Self-managed architecture
Loading