tftsr-devops_investigation/src-tauri/src/commands
Shaun Arman 75302a1cc7
Some checks are pending
Auto Tag / auto-tag (push) Waiting to run
Test / rust-fmt-check (push) Waiting to run
Test / rust-clippy (push) Waiting to run
Test / rust-tests (push) Waiting to run
Test / frontend-typecheck (push) Waiting to run
Test / frontend-tests (push) Waiting to run
feat: add OAuth2 Tauri commands for integration authentication
Phase 2.2: OAuth2 flow - Part 2 (Tauri commands)

Implemented:
- initiate_oauth command
  * Generates PKCE challenge
  * Creates state key for OAuth session
  * Stores verifier in global OAuth state
  * Returns authorization URL for Confluence/ADO
  * ServiceNow uses basic auth (not OAuth2)

- handle_oauth_callback command
  * Retrieves and removes verifier from state
  * Exchanges authorization code for access token
  * Encrypts and stores token in DB
  * Logs audit event for successful OAuth

- OAuthInitResponse type for frontend
  * auth_url: Full OAuth authorization URL
  * state: Session key for callback matching

- Global OAUTH_STATE storage (lazy_static)
  * Thread-safe HashMap for PKCE verifiers
  * Temporary storage during OAuth flow
  * Automatically cleaned up after exchange

Service configuration:
- Confluence: auth.atlassian.com OAuth2
- Azure DevOps: login.microsoftonline.com OAuth2
- ServiceNow: Basic auth (not OAuth2)

Client IDs from env vars:
- CONFLUENCE_CLIENT_ID
- ADO_CLIENT_ID

Dependencies added:
- lazy_static 1.4 - Global static initialization

TDD tests (3 passing):
- OAuth state storage and retrieval
- Multiple key management
- OAuthInitResponse serialization

Commands registered in lib.rs generate_handler![]

Next: Local HTTP callback server for OAuth redirects
2026-04-03 14:50:13 -05:00
..
ai.rs fix: UI visibility issues, export errors, filtering, and audit log enhancement 2026-04-03 08:37:47 -05:00
analysis.rs fix: inline format args for Rust 1.88 clippy compatibility 2026-03-15 13:28:59 -05:00
db.rs fix: UI visibility issues, export errors, filtering, and audit log enhancement 2026-04-03 08:37:47 -05:00
docs.rs fix: implement native DOCX export without pandoc dependency 2026-04-03 12:53:36 -05:00
integrations.rs feat: add OAuth2 Tauri commands for integration authentication 2026-04-03 14:50:13 -05:00
mod.rs feat: initial implementation of TFTSR IT Triage & RCA application 2026-03-14 22:36:25 -05:00
system.rs style: apply cargo fmt formatting 2026-03-15 12:43:46 -05:00