Repository navigation
Add authorized runtime GraphQL reads and confidential cursors (PR C) [skip ci] - #114
Merged
Merged
Conversation
added 7 commits
October 9, 2026 23:16
This was referenced Oct 11, 2026
Retain exact tested reconciliation tree 15f06d5. No source deviation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add opt-in runtime GraphQL reads over the existing validated schema, typed query and relation executors. Per-execution preflight authorizes every selected ORM layer before the first ORM statement; grants restrict reads/counts structurally. Named objects, recursive filters, ordering, connections and bounded relation batches share checked composition with host-owned types/fields.
Custom scalars preserve full i64 and JSON-text values, including JSON null versus SQL NULL. Host-managed AEAD protects complete internal cursor envelopes; trusted audience, authority partition, schema, order and parent scopes are authenticated. Static SDL, framework-neutral cursors and default features remain unchanged. No data migration is required.
Dependent C implementation, ready for review; not yet an accepted D predecessor. Base is accepted B
04a1216aff86141ff6500b1dd0bf9adb4b0c6447(#113). Current implementation head is9d4cca34cb04ab0fd27c8313215001591f495c43. ORM/macros are aligned at unpublished 0.42.0. Enablesqlite,runtime-graphqlorpostgres,runtime-graphqlwith default features disabled.Approved custom-directive limitation
The owner approved a bounded adjustment to #86: locked async-graphql 7.2.1 does not expose dynamic custom-directive factory registration.
RuntimeGraphqlComposer::directive(factory)now returns structuredunsupported_capabilityduring composition, before schema publication, without invoking or silently ignoring the factory. The canonical C contract and capability reference record this limitation. Custom directives remain deferred; no fork, upgrade or emulation.Focused tests execute host subscriptions and built-in directives, check subscription-root collisions and directive limits, and verify immediate factory rejection. Host extensions and mandatory authorization/resource guards remain intact.
C1/C2 re-review corrections
inremains false and emptynotInremains true, but neither bypasses authorization. SQLite/PostgreSQL cases assert denied nested filters execute zero ORM statements, allowed filters retain results/counts, and the authority receives exact field/operator/logical intent.Public APIs and example
RuntimeGraphqlModule::compile,RuntimeGraphqlComposer,RuntimeHostField,RuntimeGraphqlRequest,RuntimeReadAuthority/RuntimeReadGrant, andRuntimeCursorProtectorprovide the host boundary. Seedocs/reference/graphql-orm/runtime-graphql.mdand the executablecrates/graphql-orm/examples/runtime_graphql_reads.rs. An external consumer executes the same example without a direct async-graphql dependency.Verification
Actions remain paused; commits use
[skip ci]. Local builds useCARGO_BUILD_JOBS=2, sequential backend lanes and disk-backed scratch. SQLite resources are test-owned in-memory databases. PostgreSQL execution uses disposable Docker containers whose exact IDs/ownership labels are verified before removal.Final local evidence at
9d4cca34cb04ab0fd27c8313215001591f495c43:cargo fmt --all -- --checkpassed. Strict default/static semver comparison against B passed 223 checks; 30 inapplicable checks skipped, with isolated current/baseline outputs confirming 0.41.0 → 0.42.0. The shared-target attempt was discarded because its summary mislabeled the current version.android_system_properties; the explicit Linux target metadata check passed. No Android/Windows build is claimed.Primary execution commands:
Clippy/Rustdoc were repeated sequentially with
postgres,runtime-graphqlandmssql,runtime-graphql; the MSSQL Clippy target was--lib --test runtime_graphql_unsupported. All commands used the bounded two-job environment. Public API examples and exact wire forms are in the reference linked above.Compatibility and release boundaries
runtime-graphql; compile its validated Arc schema; install a host AEAD provider/audience; attach fresh request authority, expected schema fingerprint, trusted authorization partition and optional PostgreSQL DbAuthContext. Grant client projection/filter/logical-operator/order/relation/count capabilities explicitly, returning current SQL-renderable row restrictions. Keep the host's complete public/policy revision checks and key management outside ORM. Run downstream confidential-cursor, authorization, scalar and SQLite/PostgreSQL read/count contracts before adoption.Documentation impact
Explanation: added the runtime GraphQL reference and compiled host example, indexed the reference, updated the approved plan's current checkpoint, changelog, migration guide and generated package inventory. The approved directive limitation and supported-composition tests are explicit.