Skip to main content

Module binding

Module binding 

Source
Expand description

Binding values an enforcer computes from its own install.

A binding tells a workload which resource to use, such as the bucket behind ALIEN_UPLOADS_BINDING. On a protected install the control plane must not choose it, or it could point the vendor’s code at another customer’s bucket. Each value comes from the first of:

  1. binding_env: setup names each owned resource <prefix>-<id>, so for most types the value follows from the install’s prefix, account and region. The engine and every enforcer use this one function, and a test in the engine checks that its controllers produce the same values.
  2. The enforcer’s own cloud reads, for types whose value isn’t a name (a database endpoint, a service URL): it describes the resource it finds by the derived name or setup’s tag in its own install.
  3. A signed config/v1, for resources outside the customer’s cloud.

resolve_bindings applies that order. The control plane supplies none of them.

Structs§

BindingContext
Where an enforcer runs, as it learned from its own identity.
Bindings
Binding values derived from the install, and the bindings that need another source.
OwnBindingFacts
What an enforcer knows about the resource a workload runs as, to check the workload’s own binding against. The binding tells the workload’s code where to reach itself, so every field that picks a destination has to come from the install, not from the control plane.

Constants§

DEPLOYER_SECRETS_VAULT
Id of the vault a deployer writes its own secrets into.

Functions§

binding_env
The value of every binding in bindings (resource id to resource type) that follows from the install, by environment name.
binding_env_name
The environment variable that carries binding id.
binding_env_with
binding_env, where live holds the ids of the signed stack’s Live resources. A Live resource is created by its controller, which names a GCP queue’s subscription <topic>-sub and keeps a KV store in the (default) Firestore database, in the collection kv-<prefix>-<id>; a Frozen one is created by setup, which names them differently.
check_own_binding
Check value, a workload’s own binding, against facts: the binding of the platform the workload runs on, naming the workload’s own resource and nothing else, with no field the install doesn’t decide and every URL one of facts.urls.
resolve_bindings
Every binding’s value, by environment name: derived values first, then what the enforcer read from its own cloud (by resource id), then values a verified config/v1 carries (by resource id). A source never overrides an earlier one, and a binding none of them covers is refused by name.