Commit Graph

119 Commits

Author SHA1 Message Date
4b33ed522d fix(scripts): install make in pre-commit container 2025-11-07 09:52:45 +01:00
bc740f7b1f fix(scripts): use make fmt-check instead of go fmt 2025-11-07 09:52:17 +01:00
e98e4d3099 fix(scripts): use make fmt-check in pre-commit script 2025-11-07 09:51:23 +01:00
93623e6865 fix(scripts): install Go 1.25.3 in pre-commit container and fix formatting 2025-11-07 09:47:50 +01:00
b531f92436 feat(ci): add pre-commit check script using wirelos/pre-commit image 2025-11-07 09:46:35 +01:00
31e8ca7ce9 fix(lint): use explicit safe type conversions for gosec
Some checks failed
CI / Test (pull_request) Successful in 51s
CI / Lint (pull_request) Failing after 26s
CI / Build (pull_request) Successful in 38s
CI / Format Check (pull_request) Failing after 2s
Use separate variables with explicit else branches to make type
conversions safe and satisfy gosec integer overflow checks.
2025-11-07 09:37:53 +01:00
e673fcae6f fix(lint): fix all linting errors
Some checks failed
CI / Test (pull_request) Successful in 53s
CI / Lint (pull_request) Failing after 26s
CI / Build (pull_request) Successful in 39s
CI / Format Check (pull_request) Failing after 2s
- Check BindEnv return values in config.go
- Add bounds checks for int->int32/uint32 conversions to prevent overflow
- Remove unused test helper functions
2025-11-07 09:34:38 +01:00
131e44f3d4 fix(ci): install latest golangci-lint using official script
Some checks failed
CI / Test (pull_request) Successful in 52s
CI / Lint (pull_request) Failing after 26s
CI / Build (pull_request) Successful in 38s
CI / Format Check (pull_request) Successful in 2s
2025-11-07 09:29:49 +01:00
0d6094267a fix(ci): install golangci-lint v2.4.0 for Go 1.25 and config v2 support 2025-11-07 09:27:27 +01:00
4b8536e34a fix(ci): use official install script for golangci-lint 2025-11-07 09:27:17 +01:00
e509faea25 fix(ci): install golangci-lint v2 for config compatibility
Some checks failed
CI / Test (pull_request) Successful in 51s
CI / Build (pull_request) Successful in 37s
CI / Lint (pull_request) Failing after 5s
CI / Format Check (pull_request) Successful in 3s
2025-11-07 09:27:02 +01:00
355008a3a2 fix(ci): build golangci-lint from source for Go 1.25 support
Some checks failed
CI / Build (pull_request) Successful in 37s
CI / Test (pull_request) Successful in 51s
CI / Lint (pull_request) Failing after 5s
CI / Format Check (pull_request) Successful in 2s
2025-11-07 09:24:58 +01:00
c8d944e9ea fix(ci): let golangci-lint-action auto-select compatible version
Some checks failed
CI / Test (pull_request) Successful in 52s
CI / Lint (pull_request) Failing after 7s
CI / Build (pull_request) Successful in 37s
CI / Format Check (pull_request) Successful in 2s
2025-11-07 09:22:52 +01:00
d24bb96d62 fix(ci): use golangci-lint v1.64.0 2025-11-07 09:22:33 +01:00
61d614690f fix(ci): use golangci-lint v1.65.0 for Go 1.25 support
Some checks failed
CI / Test (pull_request) Successful in 52s
CI / Lint (pull_request) Failing after 6s
CI / Build (pull_request) Successful in 37s
CI / Format Check (pull_request) Successful in 2s
2025-11-07 09:19:54 +01:00
5f2e1104f2 fix(ci): use golangci-lint latest version
Some checks failed
CI / Test (pull_request) Successful in 52s
CI / Lint (pull_request) Failing after 6s
CI / Build (pull_request) Successful in 37s
CI / Format Check (pull_request) Successful in 2s
2025-11-07 09:17:22 +01:00
7c0aefb7f4 fix(fmt): formatting 2025-11-07 09:10:22 +01:00
8cfdfbc951 fix(schema): remove duplicate auditlog.go schema 2025-11-07 09:04:05 +01:00
0912f0f81b feat(schema): restore complete Ent schema files 2025-11-07 09:03:43 +01:00
1f8c2626dc fix(gitignore): allow ent/schema/ directory 2025-11-07 08:42:06 +01:00
fb10051443 fix(ci): generate Ent from ent/schema and copy to internal/ent 2025-11-07 08:41:03 +01:00
8bb36b5735 fix(ci): correctly copy Ent files excluding schema directory 2025-11-07 08:39:43 +01:00
837b04b433 fix(ci): use find to copy all Ent generated files 2025-11-07 08:39:26 +01:00
868649d6d2 fix(ci): add debug output to Ent generation step 2025-11-07 08:38:22 +01:00
13da884a21 fix(ci): exclude generate.go from Ent code copy 2025-11-07 08:21:40 +01:00
c2e2ab01f2 fix(ci): generate Ent code and copy to internal/ent 2025-11-07 08:21:31 +01:00
8c10c3dba9 fix(ci): use full module path for Ent target directory 2025-11-07 08:20:56 +01:00
b6eb8d75bb fix(ci): generate Ent code to internal/ent directory 2025-11-07 08:17:32 +01:00
4c62817cff fix(ci): revert to use apk for Alpine runner 2025-11-06 22:49:45 +01:00
0edeb67075 test: add comprehensive tests and fix CI build 2025-11-06 22:49:13 +01:00
b3c8f68989 fix(ci): update to use Makefile commands 2025-11-06 22:42:17 +01:00
3f18163313 fix(gitignore): exclude generated protobuf and Ent files 2025-11-06 22:39:55 +01:00
d42b1cd5f1 fix(proto): fix protobuf generation and update gateway tests 2025-11-06 22:39:43 +01:00
471a057d25 fix(ci): fix CI build and update Makefile to build all services 2025-11-06 22:34:49 +01:00
ad4ecaed1f fix(ci): update to use Alpine package manager (apk) 2025-11-06 22:30:39 +01:00
6ce1007f73 fix(ci): update CI to generate protobuf and Ent ORM files 2025-11-06 22:26:54 +01:00
4e6db9995f fix(gitignore): remove generated files from git tracking 2025-11-06 22:15:08 +01:00
dbe29bfb82 fix(consul): fix gRPC health checks and add API Gateway Consul registration 2025-11-06 22:04:55 +01:00
04022b835e feat(auth): Complete Auth Service implementation and fix Consul health checks
- Add VerifyPassword RPC to Identity Service
  - Added to proto file and generated code
  - Implemented in Identity Service gRPC server
  - Added to Identity Service client interface and gRPC client

- Complete RefreshToken implementation
  - Store refresh tokens in database using RefreshToken entity
  - Validate refresh tokens with expiration checking
  - Revoke refresh tokens on logout and token rotation

- Integrate Authz Service for role retrieval
  - Added AuthzServiceClient to Auth Service
  - Get user roles during login and token refresh
  - Gracefully handle Authz Service failures

- Require JWT secret in configuration
  - Removed default secret fallback
  - Service fails to start if JWT secret is not configured

- Fix Consul health checks for Docker
  - Services now register with Docker service names (e.g., audit-service)
  - Allows Consul (in Docker) to reach services via Docker DNS
  - Health checks use gRPC service names instead of localhost

This completes all TODOs in auth_service_fx.go and fixes the Consul
health check failures in Docker environments.
2025-11-06 21:26:34 +01:00
b02c1d44c8 fix(consul): Fix health checks for gRPC services in Docker
- Add gRPC health check support to Consul registry
  - Services are gRPC-only, not HTTP
  - Consul was trying HTTP health checks which failed
  - Now uses gRPC health checks via grpc.health.v1.Health service

- Update HealthCheckConfig to support both HTTP and gRPC
  - Add GRPC field for gRPC service name
  - Add UseGRPC flag to choose health check type
  - Default to gRPC for services (use_grpc: true in config)

- Fix service address registration in Docker
  - Services now register with Docker service name (e.g., auth-service)
  - Allows Consul to reach services via Docker network DNS
  - Falls back to localhost for local development

- Update default.yaml to enable gRPC health checks
  - Set use_grpc: true
  - Set grpc: grpc.health.v1.Health

This fixes services being deregistered from Consul due to failed
HTTP health checks. Services will now pass gRPC health checks.
2025-11-06 21:17:33 +01:00
54e1866997 fix(config): Fix environment variable mapping for Docker
- Add SetEnvKeyReplacer to convert underscores to dots
- Explicitly bind DATABASE_DSN, REGISTRY_CONSUL_ADDRESS, REGISTRY_TYPE
- Fixes database connection issues in Docker where services couldn't
  read DATABASE_DSN environment variable
- Services in Docker can now connect to postgres:5432 instead of localhost
2025-11-06 21:09:47 +01:00
cf4bf9505a fix(docs): Fix service run commands to include all package files
- Change from 'go run ./cmd/{service}/main.go' to 'go run ./cmd/{service}/*.go'
  - go run with single file doesn't include other files in the package
  - Service implementations are in separate _fx.go files
  - Using wildcard includes all .go files in the package

- Update README.md and SUMMARY.md with correct commands
- Fixes 'undefined: provideXService' errors when running services
2025-11-06 21:04:03 +01:00
a2990f02ba fix(gitignore): Only ignore API Gateway binary, not directory 2025-11-06 21:03:16 +01:00
01603a0722 feat(docker): Add API Gateway Dockerfile 2025-11-06 21:03:09 +01:00
cba2096adf feat(docker): Add API Gateway to Docker Compose
- Create Dockerfile for API Gateway
  - Multi-stage build using golang:1.25-alpine
  - Minimal runtime image using alpine:latest
  - Exposes port 8080

- Add API Gateway service to docker-compose.yml
  - Depends on Consul and all core services
  - Environment variables for gateway configuration
  - Port 8080 exposed

- Update SUMMARY.md
  - Add API Gateway to service list
  - Add API Gateway to Docker build instructions
  - Update file structure to include API Gateway Dockerfile
2025-11-06 21:02:54 +01:00
4cac2b2592 fix(services): Fix duplicate health registry provider
- Change from fx.Provide to fx.Invoke for health registry registration
  - CoreModule() already provides *health.Registry
  - Services should register their database checkers with the existing registry
  - Use fx.Invoke to register database health checkers instead of providing new registry

- Fixes duplicate provider error for *health.Registry
- All services now build and should start successfully
2025-11-06 21:00:52 +01:00
dfe460cb03 fix(services): Fix service startup failures
- Remove duplicate CoreModule() calls from all service main.go files
  - NewContainer() already includes CoreModule() automatically
  - This was causing duplicate ConfigProvider provider errors

- Update all _fx.go files to use *database.Client instead of *ent.Client
  - database.Client embeds *ent.Client, so it can be used directly
  - This fixes type mismatches between providers and consumers
  - Keep ent import for constants like ent.Desc

- All services now build and should start successfully
2025-11-06 20:56:37 +01:00
2f2a14f2c5 docs: Update README.md with current implementation and quick start
- Add Core Services section highlighting Epic 2 completion
- Update directory structure to include all service entry points
- Add comprehensive Quick Start guide with:
  - Prerequisites including NixOS support
  - Installation steps with code generation
  - Two deployment options (development vs full Docker)
  - Service endpoints and ports
  - Testing examples with grpcurl
- Update Architecture section with Core Services details
- Add Implementation Status section showing completed epics
- Update Configuration section with service-specific settings
- Add links to Epic 2 documentation
2025-11-06 20:49:19 +01:00
ff330e510d fix(gitignore): Only ignore service binaries, not directories 2025-11-06 20:47:04 +01:00
3191ae9444 feat(docker): Add Dockerfiles for all services 2025-11-06 20:46:58 +01:00