Skip to content

Csp-1609: Update API Authentication#1

Merged
fioreagui merged 5 commits intomainfrom
csp-1609/auth-integration
Jan 30, 2026
Merged

Csp-1609: Update API Authentication#1
fioreagui merged 5 commits intomainfrom
csp-1609/auth-integration

Conversation

@fioreagui
Copy link
Contributor

Summary

Update API authentication to support bearer tokens via Azure AD B2C client credentials, in addition to the existing API key mechanism.

Changes

Authentication

  • Replaced COGSOL_API_TOKEN with COGSOL_API_KEY for the x-api-key header across the entire codebase.
  • Added bearer token authentication using MSAL with Azure AD B2C (COGSOL_AUTH_CLIENT_ID and COGSOL_AUTH_SECRET).
  • Bearer tokens are automatically acquired, cached, and refreshed based on JWT expiry.
  • Introduced _request_with_retry in CogSolClient that retries with a fresh token on 401 responses.

Tool parameters

  • Propagated items type metadata for array-type tool parameters in loader.py and migrate.py.

Dependencies

  • Added msal and PyJWT as project dependencies.

Documentation

  • Updated README, getting-started, and commands docs to reflect the new environment variables and authentication flow.

@fioreagui fioreagui requested a review from nsuruguay05 January 28, 2026 21:02
Copy link
Contributor

@nsuruguay05 nsuruguay05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tremendo!!

- **Migration-Based Deployments**: Track changes via migrations (similar to Django)
- **No Database Required**: Uses JSON files for state tracking
- **API-Synchronized**: Push local definitions to remote CogSol APIs
- **Lightweight**: Minimal dependencies, uses only Python standard library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

### Requirements

- Python 3.9+
- No external dependencies (uses only Python standard library)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@fioreagui fioreagui merged commit 5c90c30 into main Jan 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments