Skip to content

Authentication

ZERG supports multiple authentication modes.

Bearer Token

The primary authentication method is Bearer tokens passed in the Authorization header:

bash
curl -H "Authorization: Bearer <token>" https://api.nonsense.ws/api/v1/status

Token Management

Login

bash
POST /api/v1/auth/login
json
{ "username": "admin", "password": "<password>" }

Validate

bash
GET /api/v1/auth/validate

Refresh

bash
POST /api/v1/auth/refresh

Logout

bash
POST /api/v1/auth/logout

CLI Authentication

bash
# Login via CLI
zerg login --url https://api.nonsense.ws --token <token>

# Logout
zerg logout

# Check current auth
zerg config get default.token

RBAC

Mango provides role-based access control with the following permissions:

  • * — Full admin access
  • admin — Admin operations
  • read — Read-only access
  • write — Write access

Development Mode

When auth_enabled is false (default in development), all endpoints are accessible without authentication.

Released under the MIT License.