Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .env.auth.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Authentication Configuration Example
#
# Copy this file to .env and configure for your environment
# These settings control JWT and API key authentication

# ========================================
# JWT Configuration
# ========================================

# REQUIRED: Secret key for signing JWT tokens
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
AUTH_JWT_SECRET_KEY=your-super-secret-key-change-this-in-production

# JWT algorithm (default: HS256)
AUTH_JWT_ALGORITHM=HS256

# JWT token expiration in minutes (default: 60)
AUTH_JWT_ACCESS_TOKEN_EXPIRE_MINUTES=60

# JWT issuer (default: contextiq)
AUTH_JWT_ISSUER=contextiq

# ========================================
# API Key Configuration
# ========================================

# Enable API key authentication (default: true)
AUTH_API_KEY_ENABLED=true

# ========================================
# Authentication Enforcement
# ========================================

# Require authentication for all endpoints (default: true)
# Set to false to disable authentication globally
AUTH_REQUIRE_AUTH=true

# Comma-separated list of paths exempt from authentication
# These paths will be accessible without authentication
AUTH_REQUIRE_AUTH_EXCEPTIONS=/health,/health/live,/health/ready,/docs,/redoc,/openapi.json,/metrics

# ========================================
# Example API Keys
# ========================================

# In production, store API keys in a secure database
# This is just for development/testing

# Example API key (generated): ck_xxxxx...
# To generate: python -c "from shared.auth.api_key import APIKeyHandler; print(APIKeyHandler().generate_api_key())"

# Example user_id for API key: user_123
# Example org_id for API key: org_456
Loading
Loading