class TrinoSecretMaterializer
Materializes catalog credentials as a Kubernetes Secret that the Trino plugin mounts at /etc/baleia/secrets. Each sensitive property written by TrinoCatalogProjection becomes a key in this Secret.
The decrypted values exist in memory only during this call — they are not logged, not persisted, and not included in ErrorEvent.
Constants
- SECRET_NAME_SUFFIX
Public Class Methods
# File app/services/trino_secret_materializer.rb, line 19 def initialize(secret_name: nil, namespace: nil, k8s_client: nil) @secret_name = secret_name || default_secret_name @namespace = namespace || default_namespace @k8s_client = k8s_client || default_k8s_client end
The Secret name is provided by the Helm chart through TRINO_CATALOG_SECRET_NAME so it always matches the name the RBAC Role authorizes via resourceNames. Computing it here from the release name duplicated the chart’s fullname logic and drifted from it: the Role authorized “<release>-<chart>-trino-catalog-secrets” while this class wrote “<release>-trino-catalog-secrets”, so every get was a 403.
The Secret must live where the Trino pods run (TRINO_NAMESPACE), not where this pod runs - the chart grants the same RBAC in both.
Public Instance Methods
Source
# File app/services/trino_secret_materializer.rb, line 31 def materialize!(catalogs) data = catalogs.each_with_object({}) do |catalog, acc| TrinoCatalogProjection.sensitive_property_values(catalog).each do |key, value| acc[TrinoCatalogProjection.secret_file_name(catalog, key)] = value end end upsert_secret!(data) end
Builds the secret data from all catalogs and upserts the Secret. Uses TrinoCatalogProjection.sensitive_property_values and .secret_file_name as the single source of truth — refs in the projection and keys written here derive from the same methods, so they can never diverge.
@param catalogs [Array<Catalog>] catalogs to include