Repository navigation
Add credentials option for self-hosted sign-in, and site-wide export/import - #11
Merged
Merged
Conversation
Backend and postUrl requests always sent credentials: "omit", so a
same-origin backend behind a cookie sign-in (an identity-aware proxy)
never saw its session cookie. A new credentials option (data-credentials
or config.credentials: "omit" | "same-origin" | "include", default
"omit") is passed to fetch for both. Unknown values fall back to "omit".
With the auth hook, the viewer was never identified, so review owners
had no author controls. An optional auth.getReviewer() returning
{ id, name, role } now sets the reviewer and fires annotate:auth; a
failing or malformed answer is ignored.
Closes #10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdoyChV7asEejrrmiJbN12
Download only ever covered the current page, so a reviewer working
through a multi-page site had to export each page separately, and
import pinned every comment onto whichever page opened the file.
Annotate.export({ scope: "site" }) and a new "All pages" footer link
(shown in local mode when other pages hold comments) download every
comment in the project, marked scope: "site". Importing such a file
puts each comment back on its own page, re-keyed to the importing
project. Page exports and their import behaviour are unchanged. A
synced review refuses a site export, since this browser only caches
the pages it visited.
Adapted from the overbit/annotate fork (domain-wide export and
import that rebases comments to their source pages).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdoyChV7asEejrrmiJbN12
Playwright's WebKit does not expose the Cookie header to route handlers, even for a plain fetch with credentials: 'include', so the cookie-header assertions failed on WebKit only. The test now records the credentials mode passed to fetch in every browser, and checks the Cookie header only where Playwright exposes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two features: one from the issue tracker, one adapted from a fork.
Add a
credentialsoption andauth.getReviewer(closes #10)postUrlalways sentcredentials: "omit". So a backend on the same site, behind the site's own cookie sign-in (an identity-aware proxy, for example), never received the session cookie and refused every request.credentialsoption, set withdata-credentialsorconfig.credentials. It acceptsomit(still the default),same-originorinclude, and any other value falls back toomit. It is passed tofetchfor both kinds of request.auth.getReviewer()returning{ id, name, role }. When you use your own sign-in, it tells Annotate who the viewer is, so review owners get their owner controls, and it firesannotate:auth. If it fails or returns something malformed, it is ignored.Export and import every page of a site in one file
Annotate.export({ scope: "site" })and a new All pages (N comments, M pages) link in the footer download every comment in the project, markedscope: "site". The link only appears in local mode, when other pages have comments.Tests
npx playwright test --project=chromium: 158 passed, including 5 new tests (2 inintegration.spec.js, 3 in the newsite-export.spec.js).npm run test:server: 21 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01BdoyChV7asEejrrmiJbN12