Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.6 KB

File metadata and controls

64 lines (45 loc) · 2.6 KB

extend-service-extension-python

An Extend Service Extension app written in Python. Exposes custom REST endpoints through AGS's API gateway via gRPC-Gateway.

This is a template project — clone it, replace the sample logic in the service implementation, and deploy.

Build & Test

make build                           # Build the project
docker compose up --build            # Run locally with Docker
make proto                           # Regenerate proto code

Linting: pylint (config in .pylintrc).

Architecture

Game clients reach this app through AGS via auto-generated REST endpoints:

Game Client → AGS Gateway → [REST] → gRPC-Gateway → [gRPC] → This App

The proto file defines both the gRPC service and the REST mapping (via google.api.http annotations). The gRPC-Gateway automatically generates an OpenAPI spec and REST proxy from the proto.

The sample implementation demonstrates a custom guild progress service with CRUD operations, storing data in CloudSave via the AccelByte SDK, exposed as REST endpoints through gRPC-Gateway HTTP annotations.

Key Files

Path Purpose
src/accelbyte_grpc_plugin/app.py Entry point — starts gRPC server, wires interceptors and observability
src/app/services/my_service.py Service implementation — your custom logic goes here
proto/permission.proto gRPC service definition (user-defined, add your endpoints here)
proto/service.proto gRPC service definition (user-defined, add your endpoints here)
src/accelbyte_grpc_plugin/interceptors/ Auth interceptor, tracing, logging utilities
docker-compose.yaml Local development setup
.env.template Environment variable template

Rules

See .agents/rules/ for coding conventions, commit standards, and proto file policies.

Environment

Copy .env.template to .env and fill in your credentials.

Variable Description
AB_BASE_URL AccelByte base URL (e.g. https://test.accelbyte.io)
AB_NAMESPACE Target namespace
AB_CLIENT_ID OAuth client ID
AB_CLIENT_SECRET OAuth client secret
PLUGIN_GRPC_SERVER_AUTH_ENABLED Enable gRPC auth (true by default)
BASE_PATH Custom base path for REST endpoints
ENABLE_HEALTH_CHECK Enable gRPC health check endpoint
ENABLE_PROMETHEUS Enable Prometheus metrics endpoint
ENABLE_REFLECTION Enable gRPC reflection
ENABLE_ZIPKIN Enable Zipkin tracing

Dependencies