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:

    # Get the service URL
    kubectl get service -n <your-namespace>
    
    # Health check
    curl http://<service-url>/schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D
    

Deploy with Helm

# 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

# Create ArgoCD Application
kubectl apply -f - <<EOF
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: hades
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://cnoe.localtest.me:8443/gitea/giteaAdmin/hades-service
    path: helm/hades
    targetRevision: HEAD
  destination:
    server: https://kubernetes.default.svc
    namespace: hades
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
EOF

Configuration

Helm Values

Key configuration options in helm/hades/values.yaml:

# Docker image
image:
  repository: localhost:5001/europe-west1-docker.pkg.dev/os-docker-images/onlinesales/prod/services/java/hadesv2
  tag: "1764243003606"

# Resources
resources:
  limits:
    cpu: 2000m
    memory: 2Gi
  requests:
    cpu: 500m
    memory: 512Mi

# Database connection
database:
  host: "mysql.default.svc.cluster.local"
  port: "3306"
  name: "hades"
  username: "hades_user"
  password: "changeme"

# Custom configuration files
config:
  enabled: true
  files:
    hades.cfg: |
      # Your Hades configuration
    hibernate.cfg.xml: |
      <!-- Hibernate configuration -->

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

# Authenticate user
POST /authenticate
Content-Type: application/json

{
  "username": "user@example.com",
  "password": "password123"
}

Authorization

# Authorize token
POST /authorize
Content-Type: application/json

{
  "token": "your-auth-token"
}

Health Check

# Health check
GET /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D

Development

Local Development

# 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

# 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:

Alerts

Key alerts configured:

  • Service unavailable (5xx errors)
  • High response time (> 2s)
  • Database connection failures
  • Memory usage > 80%

Troubleshooting

Pod not starting

# Check pod status
kubectl get pods -n <namespace>

# Check logs
kubectl logs -f <pod-name> -n <namespace>

# Describe pod
kubectl describe pod <pod-name> -n <namespace>

Database connection issues

# Check database connectivity
kubectl exec -it <pod-name> -n <namespace> -- curl mysql:3306

# Check database credentials
kubectl get secret <secret-name> -n <namespace> -o yaml

Health check failing

# Test health endpoint
kubectl exec -it <pod-name> -n <namespace> -- 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

License

Proprietary - © Your Company

Description
No description provided
Readme 1.1 MiB
Languages
Smarty 100%