Game Framework
API

API Authentication

Authenticate API requests with tokens or API keys.

Authentication Methods

Bearer Token

curl https://registry.yourcompany.com/v1/packages \
  -H "Authorization: Bearer gf_live_abc123..."

Basic Auth (Deprecated)

Use Bearer tokens instead.

Getting Tokens

User Token

curl -X POST https://registry.yourcompany.com/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@company.com","password":"password"}'

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_at": "2025-01-11T10:00:00Z"
}

API Key

curl -X POST https://registry.yourcompany.com/v1/workspaces/ws_ID/api-keys \
  -H "Authorization: Bearer $USER_TOKEN" \
  -d '{"name":"CI/CD Key","permissions":["packages.read"]}'

Token Format

gf_live_...  # Production
gf_test_...  # Test environment

Security

  • Always use HTTPS
  • Store tokens securely
  • Rotate regularly
  • Use minimum permissions

See Authentication Guide.