Skip to content

Node Policies

df-proxy runs on each node and decides which data may be loaded onto it. The policy is a CEL expression in node-policy.json:

{ "policy": "asset_id.startsWith('assets/') && (index.known || index.total_bytes < 1099511627776)" }
Variable Meaning
node The node: node.name and node.region
asset_id Repository, for example assets/<publisher>/<name>
chunk_hash Digest of the layer
index.known The node loaded this layer of this asset before
index.total_chunks Layers on the node
index.asset_chunks Layers of this asset
index.total_bytes Bytes on the node

The expression must return a boolean. If it is false or fails, the request is answered with 403.

Examples

asset_id.startsWith('assets/<publisher>/')
node.region == 'eu' && index.asset_chunks < 100

Index

Loaded layers are recorded. The administration port 8081 lists them with GET /v1/chunks, and changes them with PUT and DELETE /v1/chunks and INDEX_TOKEN.