Skip to content

Add actor= parameter to datasette.client methods#2688

Merged
simonw merged 3 commits into
mainfrom
claude/add-actor-parameter-gZD77
Apr 15, 2026
Merged

Add actor= parameter to datasette.client methods#2688
simonw merged 3 commits into
mainfrom
claude/add-actor-parameter-gZD77

Conversation

@simonw
Copy link
Copy Markdown
Owner

@simonw simonw commented Apr 14, 2026

datasette.client.get(path, actor={"id": "root"} now makes the internal request with that actor as request.actor - same for the other HTTP verb methods on datasette.client.

Upgraded relevant tests to use the new actor= mechanism.

Documentation: https://datasette--2688.org.readthedocs.build/en/2688/internals.html#authenticating-as-an-actor


📚 Documentation preview 📚: https://datasette--2688.org.readthedocs.build/en/2688/

Plugins and tests can now pass actor={"id": "..."} to any datasette.client
method as a shorthand for signing a ds_actor cookie via
datasette.client.actor_cookie(). Passing both actor= and a ds_actor cookie
raises TypeError.

Also converts existing tests that went through DatasetteClient to use the
new shorthand. Tests that use the synchronous TestClient (app_client-style)
and tests that intentionally exercise the ds_actor cookie mechanism are
left unchanged.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.83%. Comparing base (0b639a8) to head (5ed15af).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2688      +/-   ##
==========================================
+ Coverage   90.81%   90.83%   +0.02%     
==========================================
  Files          56       56              
  Lines        8553     8564      +11     
==========================================
+ Hits         7767     7779      +12     
+ Misses        786      785       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

simonw and others added 2 commits April 14, 2026 17:27
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@simonw simonw merged commit 9c16457 into main Apr 15, 2026
39 checks passed
@simonw simonw deleted the claude/add-actor-parameter-gZD77 branch April 15, 2026 01:32
simonw added a commit that referenced this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants