This repository contains all components of the AGNTCY Identity Service Backend - a Golang-based backend service for managing agent identities.
- Backend: Golang
- Web Framework: gRPC Gateway
- Model: Protocol Buffers (Protobuf)
- Database: PostgreSQL
- ORM: GORM
- API: gRPC and RESTful APIs
- Authentication: OIDC
Mockery, Testify
- Golang 1.24+
Create a .env file in the root directory:
cp .env.sample .envConfigure the following environment variables in your .env file:
SECRETS_CRYPTO_KEY- Key used for encrypting secretsDB_HOST- Database hostDB_PORT- Database port (default: 5432)DB_NAME- Database name (default: identity)DB_USERNAME- Database usernameDB_PASSWORD- Database passwordDB_USE_SSL- Use SSL for database connection (true/false)
KEY_STORE_TYPE- Type of key store (vault or awssm)VAULT_HOST- Vault server hostVAULT_PORT- Vault server port (default: 8200)VAULT_USE_SSL- Use SSL for Vault connection (true/false)
📝 NOTE For AWS Secrets Manager, make sure you setup the variables below:
AWS_REGION- AWS region for Secrets Manager
IDENTITY_HOST- Identity service hostIDENTITY_PORT- Identity service port
IAM_ORGANIZATION- Organization nameIAM_ISSUER- OIDC issuer URLIAM_USER_CID- Client ID for OIDC authentication
WEB_APPROVAL_EMAIL- Email for web approval notificationsWEB_APPROVAL_PUB_KEY- Public key for web approval notificationsWEB_APPROVAL_PRIV_KEY- Private key for web approval notifications
# Start the development server
cd backend/cmd/bff
go run .- The REST APIs will be available at
http://localhost:4000. - The gRPC APIs will be available at
http://localhost:4001.
backend/
├── api/ # Protobuf definitions and generated code
├── cmd/ # Main applications for the project
│ └── bff/ # Backend for Frontend application
├── internal/ # Private application and library code
│ ├── bff/ # Application services and gRPC services
│ ├── core/ # Core business logic, types, and repositories
│ └── pkg/ # Shared packages
└── pkg/ # Public libraries and utilities
This project uses standard Go testing tools along with Testify and Mockery for unit and integration tests.
# Run all tests once
go test ./...# Run pre-commit checks
pre-commit run --all-files