Skip to main content

Module provision

Module provision 

Source
Expand description

Catalog-anchored provisioning helpers shared by provider plugins.

The catalog-add boundary itself lives in crate::catalog::verify. This module adds the instance-context (project + environment) and the env-blob credential resolution that credential-bearing services (e.g. Clerk) need.

Structs§

ProvisionContext
The definition context a plugin provisions within.
ProvisionedCredentials
A credential-bearing catalog provision result: the Stripe resource name and the raw env blob the provider returned (parsed by the caller, which knows the provider-specific shape — the catalog does not describe output keys).
ProvisionedEnv
A multi-variable catalog provision result: the resource name and the requested env vars that were returned (only those found).

Functions§

provision_outputs
Provision a catalog resource and resolve its declared output fields into an output -> value map. Stripe names a resource’s env vars {RESOURCE}_{SUFFIX} (when several share an environment) or {PROVIDER}_{SUFFIX} (when a resource is unambiguous) — both forms are resolved. fields is (env suffix, output name, required); a missing required field is an error. This is the default path for multi-output providers (Clerk’s single-JSON-blob is the exception).
provision_with_credentials
Ensure the project/environment context, add the catalog resource (validated against the catalog), then resolve the env blob carrying its credentials.
provision_with_env
Like provision_with_credentials, but resolves a SET of env vars. Some providers (e.g. Cloudflare R2) return credentials as several distinct env vars rather than one blob; each requested key is taken from the add response if present, else from a single refreshing env pull.