Production-oriented Go backend for managing and generating license keys for access-control systems.
- 🗄️ Persistent domain: Stores licenses, vendors, permission presets, and operators in PostgreSQL.
- 🔐 Authentication: Issues access and refresh JWTs and protects passwords with bcrypt.
- 🏢 Tenant isolation: Restricts operators to their vendor while allowing administrator-wide access.
- 📝 Draft workflow: Saves incomplete licenses without generating a production key.
- 🔑 License generation: Produces encrypted 48-character keys containing limits, expiry, modules, and hardware identity.
- 🛡️ GOST 28147: Implements the original encryption algorithm and verifies compatibility through test vectors.
- 🔎 Search API: Supports pagination and filters by key, operator, vendor, dates, serial, modules, and customer fields.
- 🧩 Hardware decoding: Converts composite serial numbers into database, disk, and processor identifiers.
- 📴 Operations: Includes schema initialization, administrator bootstrap, graceful shutdown, Docker, and CI.
Version │ Device limit │ User limit │ Checksum │ Hardware serial
Expiry date │ Enabled module flags
The generator validates field sizes and checksum integrity before encrypting the 24-byte payload into a 48-character hexadecimal license key.
docker compose up --buildFor local development, the initial credentials are admin / admin. Override ADMIN_PASSWORD, JWT_SECRET, and LICENSE_KEY in any real environment.
curl -X POST localhost:18080/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"admin"}'Use the returned token as Authorization: Bearer <token>.
- 🔑
POST /api/auth/login,POST /api/auth/refresh - 📄 CRUD:
/api/licenses - 🏢 CRUD:
/api/vendors - 👤 CRUD:
/api/operators - 🧩 CRUD:
/api/presets - 📚
GET /api/licenses/modules - 🖥️
GET /api/licenses/serials/{serial} - ❤️
GET /health
cmd/elaclicense application composition and lifecycle
internal/auth JWT and password security
internal/domain business entities
internal/httpapi authenticated HTTP transport
internal/licensekey GOST and license payload codec
internal/store PostgreSQL persistence and filtering
compose.yml local application environment
| Variable | Purpose |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
JWT_SECRET |
Token-signing secret |
LICENSE_KEY |
GOST key words used for license encryption |
ADMIN_USERNAME |
Initial administrator name |
ADMIN_PASSWORD |
Initial administrator password |
HTTP_ADDR |
HTTP listen address |
go test ./...
go vet ./...
go run ./cmd/elaclicense