feat(package-vulnerability-scanner): scan as the signed-in viewer - #454
Draft
amylin1249 wants to merge 8 commits into
Draft
feat(package-vulnerability-scanner): scan as the signed-in viewer#454amylin1249 wants to merge 8 commits into
amylin1249 wants to merge 8 commits into
Conversation
This was referenced Jul 29, 2026
Contributor
Extension release summary😴 Changed but won't releaseThe following extensions have code changes but the manifest version hasn't been incremented:
If you intended to release these changes, update the See the contributing guide for details. |
amylin1249
marked this pull request as draft
July 31, 2026 15:43
Connect API calls now run as the signed-in viewer via their per-request session token, instead of the deploying publisher, so each person sees the content they published and their own name. Requires a Connect Visitor API Key integration (added to requiredFeatures). Every Connect call also moves off the event loop (asyncio.to_thread) and gets a bounded timeout with retry-on-transient-failure: the SDK sets no request timeout of its own, so an unresponsive server would otherwise hang the calling task indefinitely. A timeout is retried the same as a 5xx before giving up. Endpoint shapes are unchanged in this PR (packages is still one request per content item); that rework is a separate PR.
astral-sh/setup-uv doesn't publish a bare "v9" major-version alias (only "v9.0.0" exists), so @v9 failed to resolve and every job needing it never started.
…he retry wrapper too
…f the event loop, preserve 4xx status codes
amylin1249
force-pushed
the
pvs-02-viewer-identity
branch
from
August 1, 2026 01:46
62f3e1a to
79f9a69
Compare
…Error, not just ClientError
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… cache Running the new backend suite leaves a .pytest_cache that git ignores via its own generated file but prettier still walks, so check-format failed after pytest. Listed alongside .venv, which is ignored for the same reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…line The SDK sets no timeout on its session, so a Connect server that accepts a connection and then goes quiet hangs the calling thread forever. asyncio can stop waiting on those calls but cannot interrupt them, so the threads pile up and eventually starve the pool. A session adapter supplies a default read timeout through requests' own extension point, and a request that hits it is retried like any other transient failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
amylin1249
force-pushed
the
pvs-02-viewer-identity
branch
from
August 1, 2026 15:45
82f26ba to
0751bb0
Compare
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.
Split out of #428 into small, reviewable PRs (tracking issue #415). Stacked 2/10 — stacked on #453, merge bottom-up.
Every endpoint now calls Connect as the signed-in viewer (via their session token) instead of the deploying publisher, moves the blocking SDK calls off the event loop, and bounds them with a timeout+retry so an unresponsive Connect server can't hang a request indefinitely. Endpoint shapes are unchanged here; the packages endpoint's batch rework is a later PR.
Two deadlines, bounding different things:
CONNECT_API_TIMEOUT_SECONDS(30s) caps how long a caller waits before retrying.CONNECT_REQUEST_TIMEOUT_SECONDS(60s) is a read timeout on the SDK's own session, supplied through arequestsadapter.asyncio.to_threadcan stop waiting on a stuck call but can't interrupt it, so without this the abandoned threads accumulate and eventually starve the pool. A request that hits it is retried like any other transient failure. Verified against a socket server that accepts and then goes silent: raisesReadTimeoutat the deadline, where the unpatched session was still hanging.requestsis now a declared dependency, sincemain.pyimports it directly.