Repository navigation
Description
Today a graph source's metadata and data files are read with one of two identities, decided implicitly by io.vended_credentials: the S3 keys a REST catalog vends, or the process's ambient AWS credential chain. That's fine on one cloud. But with tables on Google Cloud Storage, it seems none of the paths really works:
- BigLake federation never vends. Google's docs say plainly that storage access delegation isn't supported for federated BigQuery catalogs. Their model is that the catalog caller's own identity reads the bucket: the caller needs
roles/biglake.viewerplusroles/storage.objectViewer. - A BigLake runtime catalog vends
gcs.oauth2.token, but our vended-credential parser (fluree-db-iceberg/src/credential/vended.rs) is S3-only, so a GCS token looks like "nothing vended". - HMAC keys over the S3-interop endpoint work today in Direct mode, but I don't think we can lean on them:
- Since 2024-05-03, every newly created Google Cloud organization enforces
iam.managed.disableServiceAccountKeyCreationby default. That constraint blocks service-account keys and GCS HMAC keys, so most new orgs can't issue one. - An HMAC key placed in
AWS_*replaces the process's AWS identity for everything it reads, not just the one source.
- Since 2024-05-03, every newly created Google Cloud organization enforces
- One identity per process: a process can't read one source's bucket with a Google identity while keeping its own AWS identity for its own storage and its other sources.
What I think we want is an explicit storage identity per source, io.storage_auth:
storage_auth |
Reads with | Typical use |
|---|---|---|
{"type": "vended"} |
the catalog's per-table vended credentials, S3 keys or a GCS token, required: a table it vends nothing for is refused | a REST catalog that vends, e.g. a bl:// runtime catalog |
{"type": "ambient"} |
the host's AWS credential chain | S3 with the server's own role |
{"type": "catalog"} |
the REST catalog's own Google identity, reading gs:// |
BigLake federation (bq://): Google's own model |
{"type": "google", "credentials": …, "quota_project": "…"} |
a Google identity of the source's own | Direct mode over gs:// |
Absent, it means what vended_credentials has always meant, so stored records and existing readers are untouched. The CLI and Python can default it from the warehouse (catalog for bq://, vended for bl://). The engine should never infer it: if a vending catalog fails to vend, reading with some other identity instead isn't what the source asked for.
A few design points I'd want to hold to:
- Each identity serves only the schemes it can.
gsfor a Google identity or a vended GCS token;s3/s3afor AWS (plusgsonly through a configured GCS interop endpoint);fileonly for a Direct source under the operator's local roots. A path outside them is a typed refusal (err:storage/SchemeNotServed), never a fallback. - A GCS-native reader. It would be built on
object_store'sGoogleCloudStorage, whichdelta_kernelalready links into every shipped binary, behind one shim module. It would be built only with an explicit credential provider (neverfrom_env, which falls back to whatever the host has), use read-only storage scopes, sendx-goog-user-projectonly for a requester-pays bucket, and refuse a ranged read that isn't answered with that range. - Vended credentials renew inside the store. A GCS token, and S3 keys too, would be re-fetched from the catalog's per-table credentials endpoint before expiry, single-flight, so a long materialize outlives one token. A vended GCS token with no expiry should be refused.
- One storage constructor. Today storage is built in three places from one decision table, and an embedder can build its own ambient client beside them. One
Flureemethod would take the stored config and return the storage plus the decision it made. - Caches scoped by identity. Every location-keyed cache layer (table metadata, scan files, the disk catalog cache, the data-file cache and its single-flight fill) would key on a non-secret fingerprint of the identity and endpoint, so two identities naming the same table never share cached reads. The default ambient, no-endpoint configuration should keep its current cache keys, so self-hosted caches stay warm on upgrade.
- Host identities under one policy. The host's ambient AWS (optionally limited to a bucket allowlist), ambient Azure for Delta, and the Google host identities from Iceberg REST catalogs: authenticate as a Google identity (BigLake federation and runtime catalogs), on GCP or off it #2194 would all fall under the same operator policy.
Related: #1914 (Delta on Google Cloud would reuse the same Google identity, through object_store's GCS builder). Pairs with #2194 (Google identities for Iceberg REST catalogs).
Activity