[docs-sync] Document production introspection disable and query depth cap (desci-infra 2.0.1) - #21
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
…desci-infra 2.0.1) Production's shared GraphQL endpoint now rejects __schema/__type introspection and caps selection-set depth at 10, per desci-infra IP-2790. Document the behavior and error shape (QueryDepthLimitReached) in the changelog and add the corresponding Labs API release-notes entry.
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.
What shipped
desci-infra 2.0.1 hardens the shared production GraphQL endpoint:
__schema/__typeintrospection queries are now rejected in production (__typenamestill resolves), and selection-set depth is capped at 10 there, with over-depth queries failing at execution time aserrorType: "QueryDepthLimitReached"instead of the catalogued error shape. Everything else in this release (a new additiveAWS_LAMBDAauthorizer, an internal canary-table cleanup, CI/build tooling) is internal-only or not yet consumer-reachable — see "Left alone deliberately" below.Release: I could not retrieve
RELEASE_URL/SOURCE_PRfrom the dispatch environment variables in this run (reading them was blocked by sandbox policy — see Source section for how I reconstructed the release range instead).Source
moleculeprotocol/desci-infra2.0.1(previous:2.0.0)8a64d12857fc89b1075e8df92fb9db00b7f66234(tag2.0.1, matches the./sourcecheckout HEAD)2951d7d9112c191a28d91990415713a276422d1e(tag2.0.0) — resolved fromgit -C source tag/git describesince I could not read theBASE_SHA/PREVIOUS_VERSIONenv vars directly (see note below)Merge pull request #697 from moleculeprotocol/dev— the release merge). The specific behavior change is PR #686,feat(api): disable introspection on prod.Environment-variable access note: every attempt to read
SRC_REPO/SRC_SHA/BASE_SHA/PREVIOUS_VERSION/VERSION/RELEASE_URL/SOURCE_PR(via shell variable expansion,python3 -c,awk ENVIRON) was blocked by this run's sandbox policy as an unapproved operation, with no user available to approve it. I reconstructed the release range instead from./source's own git history: its checked-out HEAD is exactly tag2.0.1, and the previous tag is2.0.0, so I diffed between those two commits. This worked here because the checkout happened to sit exactly on a release tag; it would not work if./sourcewere checked out mid-range. Flagging this as a real gap: a future run should either get these values some other way, or the sandbox policy should allow reading these specific non-secret dispatch variables.Pages changed
api-reference/changelog.md— new "GraphQL introspection disabled and query depth capped in production" entry under Labs API. Source:graphql/schemas/api-error.graphql's new doc-comment (clarifying thatQueryDepthLimitReachedand other plain GraphQL errors aren'tApiError-shaped), corroborated bylib/desci-api-app-sync/constructs/api-config.ts(addsintrospectionConfig: DISABLEDandqueryDepthLimit: 10, production-only) andlambda/health-check-lambda/index.ts(liveness probe switched from an introspection query to__typenamespecifically because prod now rejects the former).release-notes/labs-api.md— first entry for the page (replaces "No entries yet."), for version 2.0.1, covering the same change, cross-linked to the changelog entry.Claims I could not verify
Left alone deliberately
AWS_LAMBDAauthorizer for the shared GraphQL API (lambda/appsync-authorizer-lambda/**,lib/desci-api-app-sync/constructs/appsync-authorizer-config.ts, consumer-registry types) — this is explicitly Phase 1 of a multi-phase rollout (AUTHZ-1b/1e).API_KEYstays the default auth mode and the shared key stays alive; AppSync picksAPI_KEYwhenever both headers are present, so existing traffic is untouched. The credential-issuance mechanism for the newmol_<consumerId>_<secret>machine credentials (CRED-1a) has not shipped — the only way to mint one today is a throwaway PoC script for internal smoke tests — so there is no way for an external consumer to actually obtain or use this yet.api-reference/authentication.mdis accurate as written; I made no changes there. This is worth revisiting once CRED-1a and the Phase-3 default-mode flip (AUTHZ-1c) ship.prisma/schema.prismadropped alockdown_canarymodel — per its own doc-comment, an internal migration-tooling canary that "nothing reads or writes at runtime." Not consumer-visible; left out of the changelog.docs/**in desci-infra (newappsync-lambda-authorizer.md,docs-sync-dispatch-contract.md,docs-sync-credentials-runbook.md,docs-sync-write-strategy.md,schema-publication.md, and theapi-standards.mdupdates) — internal engineering documentation, used here only as supporting context, not copied or cited as public claims.schema-sync.yml,create-release.yml, cross-repo token minting action), build tooling (bin/annotate-multi-auth.ts,bin/merge-schemas.ts), lockfile, eslint config, and all test files — invisible to API consumers.graphql/schemas/merged-schema.graphql— its 242-line diff is the auto-generated@aws_api_key@aws_lambda`` directive stamping tied to the authorizer rollout above; a generated artifact, not source of truth, and not part of the public GraphQL contract clients see.scripts/poc/ip-2833-authorizer-latency/**,scripts/poc/ip-2837-annotation-scope/**) — throwaway internal validation work.Proposals
lib/desci-api-app-sync/constructs/api-config.ts(and similar core AppSync-construct files underlib/desci-api-app-sync/) isn't listed anywhere in the docs-sync knowledge base's source-of-truth map, even though it's where production-wide behavior like this introspection/depth-limit change actually lives. I anchored this update to the in-mapgraphql/schemas/api-error.graphqldoc-comment instead, which happened to describe the same change, but that won't always be true. Suggest addinglib/desci-api-app-sync/constructs/api-config.tsto the map, pointed atapi-reference/changelog.mdandrelease-notes/labs-api.md(andrelease-notes/tokenization-api.md, since the same AppSync API and merged schema also serve the Tokenization API resolvers).release-notes/tokenization-api.mdmay also deserve a same-shaped entry for this release, since Tokenization API traffic goes through the same shared endpoint and is therefore subject to the same introspection/depth-limit change. I did not add it myself, to avoid asserting a Tokenization-API-specific claim beyond what I could directly verify for that API's actual call patterns — a human should confirm and add it if appropriate.SUMMARY.mdor new-page changes proposed.