Repository navigation
Description
A graph-source view knows only the default namespaces, so a class IRI like ex:Agent lowers to Term::Iri, and the RDFS rewrite only expands Term::Sid (fluree-db-query/src/rewrite.rs ~L299 notes this); the OWL-QL rewrite has the same restriction (rewrite_owl_ql.rs ~L582), and an inline ontology's namespace codes exist only for that request. The same query over a class in a default namespace (geo:) returns all rows. Proposed fix: keep the ontology's request-local namespace map in the schema bundle and have the RDFS and OWL-QL rewrites resolve Term::Iri through it, emitting Term::Iri branches so the R2RML rewrite still matches classes (touches rewrite.rs, rewrite_owl_ql.rs, schema_bundle.rs and the hierarchy builder, inline_ontology.rs). Rejected: registering a mapping's namespaces into the view, which would affect every graph-source query. Not yet checked: whether a model ledger's class hierarchy has the same problem.
db#2196 — top-level comment (replying to his comments 6513905195 and 6513905513)
Thanks @bplatz, this was a really careful pass. Everything in both comments is folded in here except one smaller item that turned out not to have the shape described (below), 20 commits on top of 65f8c305c.
1. The cached Google storage identity (your pre-merge ask) — ccf1348f8. You were right: the key was the stored secret reference, and a hit never asked the resolver. Now, for both storage_auth: google and catalog, the config is hydrated through the caller's resolver on every plan before the cache lookup, and the key is a digest of the resolved config, which is exactly what the identity is built from (building refuses an unresolved reference, so no entry exists for an unresolved secret). A refusing resolver fails before the cache, and a rotated secret gets a new key at once. a_caller_whose_resolver_refuses_the_secret_is_not_served_the_cached_identity covers both kinds with a scope-less resolver; with the fix reverted it fails with caller B signing as A. The old warm-plan test is now a_warm_plan_reuses_its_google_identity_but_resolves_and_proves_it_every_time. A warm plan still reuses the built identity and its token, so what's added per plan is one resolver call, the same contract the Delta handle cache already has. I checked the sibling caches too: token slots are keyed on resolved authority, and catalog clients, SQL clients, Delta handles and cached loadTables are all keyed on the graph source. One question I left open on purpose: a hit on the same graph source doesn't re-ask the resolver (Delta's does); access to the source itself is the embedder's call, so I'd keep that as is unless you see it differently.
2. Backoff — 7f2857a13, 33c5c211c, 51e6ff5f0. Google tokens and vended credentials now share one renewal helper (fluree-db-iceberg/src/renew.rs): one renewal in flight, a caller holding a still-valid credential is served it without waiting, a failed renewal is remembered for 5 s, and a refusal forces at most one renewal per 30 s, now on the vended path too (a credential the store refused is still never served again). The REST client takes its headers before the catalog permit, so a Google outage holds no catalog slot (a_slow_token_exchange_holds_no_catalog_slot). One small correction to the description, fwiw: after a failed refresh the old code did read on with the still-valid token; the real cost was every queued caller waiting for its own failing exchange in turn, which is what this removes.
3. A new CLI against an older server — 41f3f259f, a025a4f87. Remote sql map sends a bearer or OAuth2 auth as the flat fields again, literal or _env, and only a Google identity goes structured. A pre-PR server only ever read the literal flat fields, so _env secrets and Google identities still can't reach it; compatibility.md and cli/sql.md say so. iceberg map --remote doesn't have this shape: an older server refuses the structured catalog/io with a 400 rather than storing a source without auth, and that's in compatibility.md too.
4. The redactor — 6f8e7c01d. The name-based pass always runs after the typed one now, so a SQL session value under x_token, password or db_secret is masked again, and a config neither pass changes still comes back byte-identical.
5. USER_PROJECT_DENIED — 0847dc198. When the request sent x-goog-user-project, it's reported as a denial on that project naming serviceusage.services.use (the wording is shared with the GCS hint); with none sent it's still CatalogQuotaProjectRequired.
6. Docs — db711f6a0, b23ab2bdc. errors.md has the five codes; configuration.md lists azure, says aws gates the Glue and S3 Tables catalog calls, and that with FLUREE_GRAPH_SOURCE_AMBIENT_BUCKETS set an ambient source can't name an s3_endpoint; the delta/map table renders whole again; the GCS section describes the native reader as the path for every Google identity, with vended tokens renewed by asking the catalog again, and the test history is gone; sql.md and cli/sql.md say where a host identity's token may go; and compatibility.md lists everything this PR makes stricter.
The smaller items:
- Google principal in query-facing denials — confirmed; redacted like ARNs, the server log keeps the full text (
5774b6199). - WIF config flag — confirmed;
type == "external_account"and the static validation run before any request is built, and a key file is named as such (a369ce6f7). - Stated catalog
type— confirmed; a statedtypealone picks the variant, refusals name the path (catalog.type: unknown variant…,catalog: missing field table_location), and untyped legacy records read as before (5ad1f6d2f). - GCS redirects — confirmed (object_store sets no policy and follows 302s); each bucket's client is built with redirects off, keeping the same timeouts and headers (
5e44840e4). - Vended GCS fields — both confirmed; credentials are parsed only when the source reads with vended credentials, and when a catalog vends both, S3 keys win as before this PR (
e7f1455e2). The same commit makeseffective_storage_auththe only rule, used byplan_storage. - Read-only routes and map-only keys — rather than a release note, every route of a kind now ignores the fields its sibling routes take (map's, browse's
depth, preview'snamespace, generate's, validate's), so one payload works for browse, preview and map; an unknown key is still refused everywhere, and an Azure principal is still refused on Delta preview and verify, where it would otherwise be a storage identity quietly not used (5737923f4,885e9c2cd). - Python
Google("wif.json")— a string path reads like aPath, and a missing file is anInvalidRequestError(0278dc11b). - Unity defaults — a structured OAuth2 auth with no
scopegetsall-apislike the flat form;token_urlcan't be omitted there, so that's the only default (ac74cd6b6).
Every new test fails with its fix reverted. And per your note on #2198, the body now has a checklist line for re-keying its count cache by storage scope when it meets this.
Follow-up from the review of #2199.
Activity