Commit 5bf1d51
committed
Add OAuth2 PKCE authentication for Berget AI
Implements OAuth2 Authorization Code flow with PKCE for authenticating
with Berget AI's Keycloak instance. Users can now authenticate via OAuth2
instead of manually entering API keys.
Changes:
- Add OAuth2 PKCE module (src/auth/oauth2.rs)
- Add Berget API client for creating API keys (src/auth/berget_api.rs)
- Update auth command to offer OAuth2 flow for Berget AI
- Create config file automatically if it doesn't exist
- Add dependencies: oauth2, base64, rand, sha2, hex, serde_json, url
Features:
- PKCE code verifier and challenge generation
- Local HTTP server for OAuth2 callback (port 8787)
- Browser integration for user authentication
- Automatic API key creation using OAuth token
- 5-minute timeout on authentication
- Beautiful HTML responses for success/error states
- Comprehensive test coverage1 parent d6094d0 commit 5bf1d51
File tree
7 files changed
+721
-21
lines changed- src
- auth
- commands
7 files changed
+721
-21
lines changed
0 commit comments