Add integration tests for NodeProfile and SchemaMigration, implement login rate limiting, and enhance password encoding
- Introduced `NodeProfileIT` for testing application-node.yml and login functionality with existing Sequelize tables. - Created `SchemaMigrationIT` to validate schema migrations and ensure data integrity across various scenarios. - Added `LoginRateLimitFilterTest` to verify independent rate limiting for login attempts from different IP addresses. - Implemented `MigrationPasswordEncoderTest` to ensure compatibility with legacy password formats and enforce password policies. - Developed tests for email templates in `ResetPasswordEmailTemplateTest` and `SmtpResetMailSenderTest` to validate HTML escaping and email content. - Added SQL fixture `sequelize-schema.sql` to support integration tests with predefined database structure and data.
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:18
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME:-genesis_auth}
|
||||
POSTGRES_USER: ${DB_USER:-genesis}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:?Define DB_PASSWORD en .env}
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 15
|
||||
restart: unless-stopped
|
||||
auth:
|
||||
build: .
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
environment:
|
||||
DB_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-genesis_auth}
|
||||
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-}
|
||||
DB_USER: ${DB_USER:-genesis}
|
||||
DB_PASSWORD: ${DB_PASSWORD:?Define DB_PASSWORD en .env}
|
||||
JWT_PUBLIC_KEY: file:/run/keys/public.pem
|
||||
JWT_PRIVATE_KEY: file:/run/keys/private.pem
|
||||
JWT_ISSUER: ${JWT_ISSUER:-http://localhost:8080}
|
||||
JWT_AUDIENCE: ${JWT_AUDIENCE:-genesis-api}
|
||||
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:3000}
|
||||
AUTH_MAX_ACTIVE_SESSIONS: ${AUTH_MAX_ACTIVE_SESSIONS:-5}
|
||||
AUTH_ALLOW_LEGACY_PASSWORDS: ${AUTH_ALLOW_LEGACY_PASSWORDS:-false}
|
||||
PASSWORD_MIN_LENGTH: ${PASSWORD_MIN_LENGTH:-10}
|
||||
PASSWORD_MAX_LENGTH: ${PASSWORD_MAX_LENGTH:-128}
|
||||
PASSWORD_MIN_CLASSES: ${PASSWORD_MIN_CLASSES:-3}
|
||||
PASSWORD_REQUIRE_COMPLEXITY: ${PASSWORD_REQUIRE_COMPLEXITY:-true}
|
||||
AUTH_RECOVERY_ENABLED: ${AUTH_RECOVERY_ENABLED:-false}
|
||||
APP_NAME: ${APP_NAME:-Genesis}
|
||||
PASSWORD_RESET_URL: ${PASSWORD_RESET_URL:-http://localhost:3000/reset-password}
|
||||
MAIL_FROM: ${MAIL_FROM:-}
|
||||
MAIL_HOST: ${MAIL_HOST:-localhost}
|
||||
MAIL_PORT: ${MAIL_PORT:-587}
|
||||
MAIL_USERNAME: ${MAIL_USERNAME:-}
|
||||
MAIL_PASSWORD: ${MAIL_PASSWORD:-}
|
||||
MAIL_AUTH: ${MAIL_AUTH:-true}
|
||||
MAIL_SSL: ${MAIL_SSL:-false}
|
||||
MAIL_STARTTLS: ${MAIL_STARTTLS:-true}
|
||||
volumes:
|
||||
- ./.secrets:/run/keys:ro
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=64m
|
||||
cap_drop: [ALL]
|
||||
security_opt: [no-new-privileges:true]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user