tftsr-devops_investigation/src-tauri
Shaun Arman 01474fb5f2 feat: implement OAuth2 token exchange and AES-256-GCM encryption
Phase 2.2: OAuth2 flow - Part 1 (Token exchange + encryption)

Implemented:
- OAuth2 authorization code exchange with PKCE
  * Real HTTP POST to token endpoint
  * Parses access_token, refresh_token, expires_in, token_type
  * Calculates expires_at timestamp

- AES-256-GCM token encryption
  * Uses TFTSR_ENCRYPTION_KEY env var (or dev default)
  * Random nonce per encryption (12 bytes)
  * Base64-encoded output with nonce prepended
  * Proper key derivation (32 bytes)

- Updated credential storage
  * store_pat() now encrypts tokens before DB storage
  * get_pat() decrypts tokens on retrieval
  * Stores both token_hash (audit) and encrypted_token (actual)

Dependencies added:
- mockito 1.7.2 (dev) - HTTP mocking for tests
- aes-gcm 0.10 - AES-256-GCM encryption
- rand 0.8 - Cryptographically secure RNG

TDD tests (20 passing with --test-threads=1):
- OAuth exchange: success, missing token, HTTP error, network error
- Encryption: roundtrip, different nonces, invalid data, wrong key
- PAT storage: store/retrieve, nonexistent service, replacement

Note: Tests require single-threaded execution due to env var
test isolation. This is acceptable for CI/CD.
2026-04-03 14:32:17 -05:00
..
.cargo fix: suppress MinGW auto-export to resolve Windows DLL ordinal overflow 2026-03-29 12:33:24 -05:00
capabilities feat: initial implementation of TFTSR IT Triage & RCA application 2026-03-14 22:36:25 -05:00
gen/schemas fix: UI contrast issues and ARM64 build failure 2026-04-03 08:05:58 -05:00
icons fix: replace empty icon placeholder files with real app icons 2026-03-15 20:31:52 -05:00
src feat: implement OAuth2 token exchange and AES-256-GCM encryption 2026-04-03 14:32:17 -05:00
target security: rotate exposed token, redact from PLAN.md, add secret patterns to .gitignore 2026-03-15 14:04:49 -05:00
build.rs feat: initial implementation of TFTSR IT Triage & RCA application 2026-03-14 22:36:25 -05:00
Cargo.lock feat: implement OAuth2 token exchange and AES-256-GCM encryption 2026-04-03 14:32:17 -05:00
Cargo.toml feat: implement OAuth2 token exchange and AES-256-GCM encryption 2026-04-03 14:32:17 -05:00
tauri.conf.json chore: bump version to 0.2.2 2026-04-03 13:51:25 -05:00