Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GingerlyData247/SOTeam4-P2/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Trustworthy Model Registry API is designed for deployment flexibility with configurable authentication. The current implementation focuses on AWS-based deployment with environment-based configuration.The API currently operates in open mode for development and testing. Production deployments should implement token-based authentication as described below.
Authentication Methods
Environment-Based Authentication
For production deployments, the API can be configured to require authentication using theAUTH_TOKEN environment variable.
Setup
- Set the
AUTH_TOKENenvironment variable in your deployment:
- For AWS Lambda deployments, configure via AWS Systems Manager Parameter Store or Secrets Manager
-
For local development, add to your
.envfile:
.env
CORS-Based Origin Validation
The API uses CORS middleware to restrict access to approved origins:Making Authenticated Requests
Using Authorization Header
When token authentication is enabled, include the token in theAuthorization header:
Python Example
JavaScript/TypeScript Example
CORS Configuration
The API is configured with strict CORS policies to ensure secure cross-origin requests.Allowed Headers
Allowed Methods
Preflight Requests
The API handles OPTIONS preflight requests globally:Token Management
Token Generation
For production deployments, generate secure tokens using:Token Storage
Recommended approaches:-
AWS Secrets Manager (Production)
- Store tokens securely in AWS Secrets Manager
- Configure Lambda to access secrets at runtime
- Automatic rotation support
-
Environment Variables (Development)
- Use
.envfiles (add to.gitignore) - Load via
python-dotenv - Easy local testing
- Use
-
AWS Systems Manager Parameter Store (Production)
- Hierarchical parameter storage
- Fine-grained access control via IAM
- Version tracking
Token Rotation
The current implementation does not enforce token expiration. For production use, implement token rotation policies:
- Rotate tokens every 90 days minimum
- Use short-lived tokens where possible
- Implement token versioning for zero-downtime rotation
AWS Lambda Authentication
When deployed to AWS Lambda with API Gateway, additional authentication layers are available:API Gateway API Keys
IAM Authentication
Use AWS Signature Version 4 signing for IAM-based authentication:Security Best Practices
Use HTTPS Only
Use HTTPS Only
Always use HTTPS endpoints in production. The deployed API uses AWS API Gateway with TLS 1.2+.
Rotate Credentials Regularly
Rotate Credentials Regularly
Implement a credential rotation policy:
- API tokens: Every 90 days
- AWS access keys: Every 180 days
- Service accounts: Annual review
Implement Request Rate Limiting
Implement Request Rate Limiting
While the API doesn’t enforce rate limits, implement client-side throttling:
- Maximum 100 requests per minute per client
- Exponential backoff for retries
- Circuit breaker pattern for resilience
Monitor Authentication Failures
Monitor Authentication Failures
Track and alert on authentication failures:
- Failed token validation attempts
- CORS policy violations
- Unusual access patterns
Error Responses
Unauthorized Access
When authentication is required but not provided:Invalid Token
When an invalid token is provided:CORS Violation
When requests originate from non-whitelisted origins:Testing Authentication
Health Check Endpoint
Use the health endpoint to verify authentication setup:Environment Verification
Check current environment configuration:Next Steps
API Overview
Learn about API structure and capabilities
Artifacts API
Explore detailed endpoint documentation