This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Athenz is an open source platform for X.509 certificate based service authentication and fine-grained role-based access control (RBAC) in dynamic infrastructures. It consists of three main components:
- ZMS (Athenz Management System): Centralized authorization system for domains, roles, and policies
- ZTS (Athenz Token System): Decentralized token service for issuing authentication tokens and X.509 certificates
- UI: React-based web interface for managing Athenz resources
- Build all components:
mvn clean install - Run tests:
mvn test - Skip tests:
mvn install -DskipTests - Build with Docker profile:
mvn install -DdockerBuild=true - Generate code coverage: Tests automatically run with JaCoCo coverage (minimum 100% line coverage required)
- Checkstyle validation: Runs automatically during build using
athenz-checkstyle.xml
Navigate to ui/ directory:
- Development server:
npm run dev - Build for production:
npm run build - Run tests:
npm test - Fix linting:
npm run fix-lint - Check linting:
npm run ci-lint - Functional tests:
npm run functional
Many Go components have individual Makefiles:
- Build Go clients/libraries:
makein respective directories - Run Go tests:
make test(where available)
Navigate to docker/ directory:
- Build all Docker images:
make build - Deploy development environment:
make deploy-dev - Deploy local environment:
make deploy-local - Prepare UI development environment:
make prepare-ui-dev-env - Verify deployment:
make verify - Clean up:
make clean
- ZMS Server (
servers/zms/): Centralized management service, source of truth for authorization data - ZTS Server (
servers/zts/): Token and certificate issuing service for decentralized authorization - UI (
ui/): React-based management interface
- Java clients (
clients/java/): zms, zts, zpe, msd clients - Go clients (
clients/go/): zms, zts, msd clients - Node.js clients (
clients/nodejs/): zts, zpe clients
- Java libs (
libs/java/): auth_core, server_common, cert_refresher, instance_provider - Go libs (
libs/go/): sia (Service Identity Agent), zmscli, zmssvctoken, athenzutils - Node.js libs (
libs/nodejs/): auth_core
Located in provider/ - platform-specific identity providers:
- AWS: sia-ec2, sia-eks, sia-fargate
- GCP: sia-gce, sia-gke, sia-run
- Azure: sia-vm
- CI/CD: sia-actions (GitHub), sia-buildkite, sia-harness
Located in utils/ - command-line tools:
- zms-cli: ZMS management CLI
- zts-roletoken: Role token management
- zts-accesstoken: Access token management
- zts-rolecert: Role certificate management
- zts-svccert: Service certificate management
The project uses RDL (REST Description Language) for API definition and code generation:
- API definitions:
servers/zms/src/main/rdl/ZMS.rdl,servers/zts/src/main/rdl/ZTS.rdl - Code generators: Located in
rdl/directory - Regenerate stubs: Run
scripts/make_stubs.shin relevant server directories
- ZMS Database: Schema in
servers/zms/schema/zms_server.sql - ZTS Database: Schema in
servers/zts/schema/zts_server.sql - Schema updates: Incremental updates in
servers/*/schema/updates/
- Uses TestNG framework
- Mockito for mocking
- Minimum 100% line coverage enforced via JaCoCo
- Test resources in
src/test/resources/
- Jest for unit tests
- WebdriverIO for functional tests
- React Testing Library for component tests
- Tests in
src/__tests__/
- Standard Go testing framework
- Test files follow
*_test.gopattern
- ZMS config:
servers/zms/conf/zms.properties - ZTS config:
servers/zts/conf/zts.properties - UI config:
ui/src/config/config.js
- X.509 certificates for service authentication
- Private keys stored securely (never in code)
- Certificate signing and validation throughout
- OAuth2 and JWT token support
- Local Development: Use Docker setup in
docker/for full local environment - UI Development: Use
docker/prepare-ui-dev-env.shfor UI-focused development - Testing: Always run tests before committing (
mvn testfor Java,npm testfor UI) - Code Style: Checkstyle enforced for Java, Prettier for JavaScript/React
- Documentation: Update relevant README files when adding new components
- Default: Builds all components
- docker-build: Optimized for Docker container builds
- maven-central: For publishing releases
When working with this codebase, always consider the distributed nature of the system and the security implications of authentication and authorization changes.