Skip to content

feat(providers): add JWT Bearer Authorization provider#152

Merged
TarasSpashchenko merged 7 commits intomainfrom
feat/jwt-bearer-auth
Feb 26, 2026
Merged

feat(providers): add JWT Bearer Authorization provider#152
TarasSpashchenko merged 7 commits intomainfrom
feat/jwt-bearer-auth

Conversation

@TarasSpashchenko
Copy link
Collaborator

Summary

Adds JWT Bearer Authorization as a new authentication provider for CodeMie CLI. Users can now configure JWT-based authentication where tokens are provided at
runtime via CLI or environment variables, rather than during setup. This is ideal for environments with external token management systems, CI/CD pipelines, or
testing scenarios.

Changes

  • New bearer-auth provider with simplified setup (only asks for API URL, token provided later)
  • JWT authentication proxy plugin with Bearer token injection and expiration validation
  • --jwt-token CLI option added to all agent commands for runtime token provision
  • JWT health check added to codemie doctor for token validation and expiration monitoring
  • All agents (Claude, Gemini, OpenCode, CodeMie Code) now support bearer-auth provider
  • Shared URL normalization utility (ensureApiBase) for consistent /code-assistant-api suffix handling
  • JWT credential storage with AES-256-CBC encryption matching SSO security standards
  • Configuration follows SSO pattern with codeMieUrl (user input) and baseUrl (full API URL)
  • Comprehensive documentation in docs/AUTHENTICATION.md with setup, usage examples, and troubleshooting

Impact

Before:

# Only SSO authentication
codemie setup  # Browser-based flow
codemie-claude "analyze code"

After:

# New JWT option during setup
codemie setup
? Choose provider: Bearer Authorization
? CodeMie base URL: https://codemie.lab.epam.com
✓ Configuration saved

Provide token at runtime

export CODEMIE_JWT_TOKEN="eyJhbG..."
codemie-claude "analyze code"

Or via CLI

codemie-claude --jwt-token "eyJhbG..." "analyze code"

Users benefit from simplified setup for JWT environments and flexible token management at runtime.

Checklist

  • Self-reviewed
  • Manual testing performed
  • Documentation updated
  • No breaking changes

TarasSpashchenko and others added 6 commits February 26, 2026 18:10
…tion

- Add new JWT Bearer Authorization provider (bearer-auth)
- Implement setup flow asking only for API URL (token provided at runtime)
- Add URL normalization utility (ensureApiBase) to handle /code-assistant-api suffix
- Update agent plugins to support bearer-auth provider (Claude, Gemini, OpenCode, CodeMie Code)
- Skip apiKey validation for JWT and SSO authentication methods in AgentCLI
- Add codeMieUrl field to JWT config following SSO pattern
- Remove redundant apiUrl from jwtConfig (uses baseUrl instead)
- Add jwtConfig support to LegacyConfig type

Users can now configure JWT authentication with:
  codemie setup -> Bearer Authorization
  codemie-claude --jwt-token <token> --base-url <url>

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
- Add comprehensive JWT authentication section to AUTHENTICATION.md
- Document JWT setup flow, token provision methods, and validation
- Include CI/CD pipeline examples and troubleshooting guide
- Add JWT vs SSO comparison table
- Update README.md to mention JWT Bearer Auth in provider list

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
- Add max pages limit (20) and ID-based deduplication in
  fetchCodeMieIntegrations to prevent infinite pagination loop when
  the API ignores page/per_page params
- Add ora spinner around integration fetch so users see progress
  instead of a silent hang
- Filter integrations strictly by credential_type === 'LiteLLM'
  instead of just checking the field is non-empty
- Hide JWT Bearer provider from interactive setup (hidden: true)
- Add hidden field to ProviderTemplate interface

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
… plugin

Adds chalk, CodeMieCode, loadCodeMieConfig, renderProfileInfo,
getRandomWelcomeMessage and getRandomGoodbyeMessage imports that
are used by the customRunHandler introduced in the Bearer Auth commit.

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
…t subcommand

Add ownedSubcommands metadata field so agents can declare which subcommands
their binary owns. AgentCLI now skips registering the framework init command
for any agent that lists 'init' in ownedSubcommands, fixing the shadowing
bug for codemie-opencode (and codemie-code) whose binaries have a native init.

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@TarasSpashchenko TarasSpashchenko merged commit 1d141fd into main Feb 26, 2026
5 checks passed
@TarasSpashchenko TarasSpashchenko deleted the feat/jwt-bearer-auth branch February 26, 2026 17:51
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