Skip to content

Add Authentication Support (OAuth2/JWT) for BaSyx Environments #2

@ptrstn

Description

@ptrstn

The shellsmith project currently lacks authentication support in both the Python SDK and CLI. This prevents users from connecting to secured BaSyx environments that require authentication, limiting its use to development environments only.

Current State

✅ What's Already Available

  • Basic HTTP client infrastructure using httpx
  • Configuration system for host and timeout settings
  • Complete CRUD operations for shells and submodels

❌ What's Missing

  • Python SDK: No authentication in HTTP requests
  • CLI Tool: No authentication parameters or token management
  • Configuration: No auth-related settings in config system
  • Documentation: No guides for authenticated environments

Problem Statement

Users cannot use shellsmith with production BaSyx environments that require authentication. The current implementation only works with unsecured environments, limiting its real-world applicability.

Proposed Solution

1. Configuration Support

Add authentication configuration to config.py

So that it can be configured via environment variables:

SHELLSMITH_AUTH_ENABLED=true
SHELLSMITH_OAUTH2_CLIENT_ID=myapp

2. Authentication Client

Create src/shellsmith/auth.py

3. Update HTTP Clients

Modify clients.py and CRUD functions to include authentication

4. CLI Authentication Support

Add authentication options to CLI commands

5. Token Management

  • Automatic token refresh for OAuth2
  • Token caching to avoid repeated authentication
  • Secure token storage (keyring integration?)
  • Token expiration handling

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions