# Hades V2 - Authentication & Authorization Service Hades is a Java-based authentication and authorization service providing: - User authentication (username/password, OAuth, SAML) - Token-based authorization with ACL - User and entity management - Multi-tenant context management - Integration with external identity providers ## Quick Start ### Deploy with Backstage 1. **Create Test Environment:** - Navigate to Backstage → Environments (`/environment`) - Click "Create Environment" - Select `hades-service` - Choose resource size and TTL - Click "Create Environment" 2. **Access the Service:** ```bash # Get the service URL kubectl get service -n # Health check curl http:///schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D ``` ### Deploy with Helm ```bash # Add Helm repository (if using a chart repository) helm repo add hades https://charts.company.com # Install Hades helm install hades ./helm/hades \ --namespace hades \ --create-namespace \ --set image.tag=1764243003606 # Upgrade helm upgrade hades ./helm/hades \ --namespace hades \ --set image.tag=latest # Uninstall helm uninstall hades --namespace hades ``` ### Deploy with ArgoCD ```bash # Create ArgoCD Application kubectl apply -f - < ``` ### Environment Variables The service supports the following environment variables: - `JAVA_OPTS`: JVM options (default: `-Xms512m -Xmx2048m`) - `CATALINA_OPTS`: Tomcat options (default: `-Dconfig.path=/app/config`) - `DB_HOST`: Database host - `DB_PORT`: Database port - `DB_NAME`: Database name - `DB_USERNAME`: Database username - `DB_PASSWORD`: Database password ## API Endpoints ### Authentication ```bash # Authenticate user POST /authenticate Content-Type: application/json { "username": "user@example.com", "password": "password123" } ``` ### Authorization ```bash # Authorize token POST /authorize Content-Type: application/json { "token": "your-auth-token" } ``` ### Health Check ```bash # Health check GET /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D ``` ## Development ### Local Development ```bash # Build the application cd /path/to/hades/source ant setup # Build Docker image docker build -t hades:local . # Run locally docker run -p 8080:8080 hades:local ``` ### Testing ```bash # Run unit tests ant unittest # Test deployment helm lint helm/hades # Dry run helm install hades ./helm/hades --dry-run --debug ``` ## Monitoring ### Metrics The service exposes metrics at: - Health: `/schedulerService/jobTrigger` - Application logs: Container stdout/stderr ### Grafana Dashboards View metrics in Grafana: - [Hades Service Dashboard](https://grafana.company.com/d/hades) ### Alerts Key alerts configured: - Service unavailable (5xx errors) - High response time (> 2s) - Database connection failures - Memory usage > 80% ## Troubleshooting ### Pod not starting ```bash # Check pod status kubectl get pods -n # Check logs kubectl logs -f -n # Describe pod kubectl describe pod -n ``` ### Database connection issues ```bash # Check database connectivity kubectl exec -it -n -- curl mysql:3306 # Check database credentials kubectl get secret -n -o yaml ``` ### Health check failing ```bash # Test health endpoint kubectl exec -it -n -- curl localhost:8080/schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D ``` ## Architecture ``` ┌─────────────────┐ │ Load Balancer │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Ingress/Service│ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Hades Pods │ │ (Tomcat 9) │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ MySQL Database │ └─────────────────┘ ``` ## Security - Passwords hashed with BCrypt - Token-based authentication - ACL-based authorization - CAPTCHA support for brute-force protection - IP-based access control - SAML/OAuth integration ## Support - **Documentation**: https://wiki.company.com/hades - **Issues**: https://github.com/yourorg/hades-service/issues - **Slack**: #hades-support - **Email**: platform-team@company.com ## License Proprietary - © Your Company