Repository navigation
Conversation
…duneorg/dune#97) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…in as reference Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eDelete (#97) Optional createPage/deletePage driver hooks. The stub admin gains create and delete routes; its events now carry content-relative paths like core's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zumbrunn
marked this pull request as ready for review
November 10, 2026 16:34
0.36.0 is on JSR; the harness, the stub admin and the conformance suite are written against its contract. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
Author
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.
Part of duneorg/dune#97 (step 5) and #64. Draft until
@dune/core0.36 is published; needs the core capability stack (duneorg/dune#110, #111).The phase-4 proof that Dune does not depend on
@dune/plugin-admin: a replacement admin built only on what core hands every plugin.createStubAdmin()(@dune/testing/stub-admin): keeps users, sessions and password hashing throughservices.users/services.sessions/services.passwords, providesauth.sessionandscheduler.executor, seeds authz tuples throughservices.authz, and offers its ownPOST /stub-admin/login,GET /stub-admin/pagesandPOST /stub-admin/pages/edit(the writer, so it firesonPageUpdateitself). It imports nothing from@dune/plugin-admin. Options: users, cookie name, prefix,declareCookie: falseto play a provider that does not declare its cookie.createAppHarness()(@dune/testing/app-harness): the in-memory harness plus the fullcreateDuneApp()app, withrequest(path)going through plugin routes, the response-transform pipeline and the content catch-all.deno.jsonexports and import-map entries for the new core subpaths.Tests (
tests/stub_admin_test.ts, 8): the site serves with it installed and core sees its capabilities; login accepts the right password and sets its own cookie; core's transform pipeline recognises its session and only its session (anonymous and unrelated cookies get none, markers scrubbed vs kept); a forged cookie is not a session; a provider that does not declare its cookie is still found; it edits a page and firesonPageUpdateexactly once; a role without edit rights is authenticated but cannot edit; and with no admin the site still serves and nothing admin-related exists.deno task check(fmt, lint, type-check) anddeno task test(23) pass against the local capability stack.What it found in core (fixed in duneorg/dune#111): run against core without those fixes, 4 of the 8 fail. Core hard-wired the admin session cookie to
dune_session(a replacement admin got no admin bar, and an editor-rendered response could enter the shared page cache), and only created the authz system whenadmin.enabledwas true (a replacement admin could never authorise a session).RequestAuthenticatornow declaressessionCookies, and the authz system is also created when a plugin providesauth.session.Conformance suite (
@dune/testing/conformance):runAdminConformance(driver)checks the contract any admin must meet: one activeauth.session; core recognises the editor session and only that (no/unrelated/forged cookie get nothing, markers scrubbed); declaredsessionCookiesincludes the cookie sign-in sets; a plugin mounted before the admin can readauth.session; an edit firesonPageUpdateonce;admin.pages/admin.routesmounted behind login, CSRF and permission; with no admin the site serves. The stub passes 8; plugin-admin passes all 9 (plugin-admin#17).tests/conformance_negative_test.ts(5) shows broken admins are rejected for the right reason. 36 tests,deno task checkclean.Page-event checks. The driver gained optional
createPage/deletePage; the suite then checks that creating firesonPageCreateand deleting firesonPageDelete, each exactly once with a path relative to the content directory. The stub admin has create and delete routes (its events now carry content-relative paths like core's), a new negative test shows an admin that writes pages silently is rejected, and plugin-admin passes both checks. 39 tests.Runtime. The stub admin's
mount()readsMountApi.runtimeinstead of the bootstrap result (core#114); all 39 tests pass against it.ConformanceApp.bootstrapstays the fullBootstrapResult: that is the test harness, not the plugin contract.Not in this PR: running the suite in CI against core
mainand the previous minor; the version bump and the@dune/core^0.36pin (release work).🤖 Generated with Claude Code