Extension manifest
The manifest of an extension provides structured metadata about the extension that’s useful for documenting its purpose and data dictionary. Information provided by the active extensions is available for inspection via the /_cerbos/meta endpoint of the Synapse server.
Providing a manifest
Starlark extensions
Implement a function named manifest that returns either a struct or dict structured in the format described in Manifest format.
def manifest():
return struct(api_version = 1, name = "test", version = "1.0.0", owner = "cerbos.dev/synapse", description = "Test extension")
WASM extensions
Implement a function named manifest that returns a JSON blob structured in the format described in Manifest format.
//go:wasmexport manifest
func manifest() int32 {
m := Manifest{
APIVersion: 1,
Name: "test",
Version: "1.0.0",
Owner: "cerbos.dev/synapse",
Description: "Test extension",
}
if err := pdk.OutputJSON(m); err != nil {
pdk.SetError(err)
return 1
}
return 0
}
Manifest format
| Field | Type | Description |
|---|---|---|
|
|
Manifest API version. Required. Must be set to 1. |
|
|
Name of the extension. Required. |
|
|
Extension version. Required. |
|
|
Team or person responsible for maintaining the extension. |
|
|
High-level description of the extension’s purpose. |
|
|
Describe how the extension maps data to PDP requests. |
| Field | Type | Description |
|---|---|---|
|
|
Describe the paths of PDP request/responses being modified. The key is the JSON path of the field such as
|
|
|
Description of this enrichment. |
|
|
The type of enrichment such as adding a value, overwriting an existing value and so on. Valid values are:
|
|
|
Describe how the value is computed. Values can be static or dynamic. See below for the schema of this field. |
|
|
A JSON schema snippet describing this field. |
|
|
Key-value pairs of additional metadata you want to attach to this enrichment description. |
| Field | Type | Description |
|---|---|---|
|
|
The static value being assigned to this field. Mutually exclusive with |
|
|
Describes a value computed dyanmically from the request. Mutually exclusive with |
| Field | Type | Description |
|---|---|---|
|
|
Describe the computation. |
|
|
Sources of data used for the computation. |
Example
{
"apiVersion": "1",
"name": "aperture",
"version": "dev",
"owner": "cerbos.dev/synapse",
"description": "Integration point for Aperture by Tailscale",
"fieldMappings": [
{
"targets": {
"requestId": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Request ID from Aperture metadata",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata.request_id"
]
}
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"principal.id": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Principal ID from Aperture metadata",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata.login_name"
]
}
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"principal.roles": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Principal roles (hardcoded)",
"operation": "OPERATION_ADD",
"value": {
"staticValue": [
"user"
]
},
"jsonSchema": {
"items": {
"type": "string"
},
"type": "array"
}
},
{
"targets": {
"principal.attr.stable_node_id": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Stable node ID from Aperture metadata",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata.stable_node_id"
]
}
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"principal.attr.tailnet_name": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Tailenet name from Aperture metadata",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata.tailnet_name"
]
}
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"principal.attr.user_agent": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "User agent from Aperture metadata",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata.user_agent"
]
}
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"resource.id": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource ID",
"operation": "OPERATION_ADD",
"value": {
"staticValue": "aperture_hook"
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"resource.kind": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource Kind",
"operation": "OPERATION_ADD",
"value": {
"staticValue": "aperture_hook"
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"resource.policyVersion": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource policy version",
"operation": "OPERATION_ADD",
"value": {
"staticValue": "production"
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"resource.scope": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource scope",
"operation": "OPERATION_ADD",
"value": {
"staticValue": ""
},
"jsonSchema": {
"type": "string"
}
},
{
"targets": {
"resource.attr": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource attributes",
"operation": "OPERATION_ADD",
"value": {
"computedValue": {
"sources": [
"metadata"
]
}
},
"jsonSchema": {
"type": "object"
}
},
{
"targets": {
"actions": "TARGET_CHECK_RESOURCES_REQUEST"
},
"description": "Resource actions",
"operation": "OPERATION_ADD",
"value": {
"staticValue": [
"hook_event"
]
},
"jsonSchema": {
"items": {
"type": "string"
},
"type": "array"
}
}
]
}