TheDocumentation Index
Fetch the complete documentation index at: https://docs.ditto.live/llms.txt
Use this file to discover all available pages before exploring further.
Identity resource defines an authentication identity that can access Edge Server HTTP APIs. Each identity has a credential (such as an API key) and a set of permissions that control what operations they can perform.
For a complete guide on generating API keys and configuring authentication, see the Authentication guide.
Basic Configuration
Identities are defined under the top-levelauth: configuration:
Required Fields
| Field | Type | Description |
|---|---|---|
credential | object | The credential this identity uses to authenticate with Edge Server |
permissions | array | Array of permission set names that define what this identity can do |
Optional Fields
| Field | Type | Default | Description |
|---|---|---|---|
id | string/null | Uses YAML key | Human-readable identifier for this identity. Used in audit logs. If not provided, the YAML key name is used |
Credentials
Credentials define how an identity authenticates with Edge Server. All credentials must be generated using the Edge Server CLI command.API Key Credential
Currently, API key is the only supported credential type:| Field | Type | Description |
|---|---|---|
api_key | string | Base64-encoded string generated by Edge Server CLI |
Generating API Keys
Use the Edge Server CLI to generate secure API key credentials:- Generated Private Key: The secret clients use to authenticate (give to clients)
- Secure Public Hash: The hash to store in your config (shown above)
Permissions
Thepermissions field is an array of permission set names defined in the same auth: configuration. This separation allows you to reuse permission sets across multiple identities.
Complete Examples
Complete Configuration with Authentication
Multiple Identities with Shared Permissions
Identity Without Custom ID
Whenid is not specified, the YAML key is used:
Using Identities with HTTP Servers
When identities are defined in theauth: configuration, the HTTP server automatically uses them for authentication:
Security Best Practices
- Generate credentials securely: Always use the Edge Server CLI to generate credentials. Never create API keys manually
- Unique credentials: Each identity must have a unique credential. Never reuse credentials across identities
- Meaningful IDs: Use descriptive
idvalues to make audit logs easier to understand - Principle of least privilege: Grant identities only the permissions they need
- Rotate credentials: Regularly rotate API keys by generating new credentials and updating your configuration
- Secure storage: Store credentials securely (e.g., in environment variables or secrets management systems) rather than committing them to version control
Important Notes
- Credential Uniqueness: The same credential cannot be used by multiple identities. Each identity must have its own unique credential
- Audit Logging: The
idfield (or YAML key ifidis not set) appears in audit logs to identify who performed actions - Permission Set References: The
permissionsfield must reference permission sets defined in thepermission_setssection - Authentication Flow: When an HTTP request arrives with an API key, Edge Server validates it against all configured identities and checks the associated permissions
Related Resources
- Authentication Guide - Complete guide to generating and managing API keys
- PermissionSet Configuration
- HttpServer Configuration