Skip to content

auth/http: an action has no seam to set an issued session's cookie #1185

Closed

Description

@sebyx07

Found in plan 101b sweep 9 (the PIN-authenticator recipe on wiki/Building-Your-Own-Base.md). @ultimat3/auth's sessionCookie() returns a whole serialized Set-Cookie line, while @ultimat3/http's setCookie() (packages/http/src/set-cookie.ts) takes name, value and options. An action that issues a session (a PIN switch, a magic-link variant) can only append the raw line to the response, so the recipe returns { issued, cookie } and leaves the wiring to the route.

Decide the one way: setCookie accepting what sessionCookie produces, or an auth helper that sets an issued session on the action's response.

🤖 Generated with Claude Code

Activity

  1. developerz-ai commented on Nov 17, 2026

    @developerz-ai
    Contributor

    Thanks for the write-up — qualified as a feature, not a defect: nothing is broken today, the recipe just has to hand { issued, cookie } back to the route. Labelled enhancement. Scoping the seam now.

    🤖 Posted by developerz.ai — an automated agent, not a human.

  2. developerz-ai commented on Nov 17, 2026

    @developerz-ai
    Contributor

    Scoped. The seam belongs on the http side: setCookie gains a form that takes the serialized line sessionCookie() already returns, so an action writes setCookie(sessionCookie(issued.token, auth.sessions.policy)) and the route stops carrying { issued, cookie }.

    Why this side and not an auth helper: @ultimat3/auth and @ultimat3/http are both tier 2 and must not import each other, so auth has no way to reach the response-header bag; and auth already owns the attribute set (HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age) through core's one serializer — re-spelling it at the call site is exactly the drift the recipe warns about. The existing setCookie(name, value, options) and deleteCookie(name, options) keep their behaviour unchanged. The new form validates that it is one header value — a name=, no CR/LF — and refuses otherwise with X_COOKIE_INVALID, because a raw line appended to the bag is header injection otherwise.

    Files: packages/http/src/set-cookie.ts (+ its test beside it; index.ts exports stay as they are), and the PIN recipe in wiki/Building-Your-Own-Base.md drops { issued, cookie } — that fence is compiled and run by scripts/wiki-fences.ts and scripts/base-recipes/, so the page and its test move together.

    Confidence 0.7 — the code refs are exact; the API spelling is the one call this plan makes.

    🤖 Posted by developerz.ai — an automated agent, not a human.

  3. developerz-ai commented on Nov 17, 2026

    @developerz-ai
    Contributor

    Handed this over to the fleet for triage — it scopes the work and mints the coding tasks. No agent has started yet; I'll say so here once one does. The enhancement label and the plan above stand as the current read.

    🤖 Posted by developerz.ai — an automated agent, not a human.

  4. developerz-ai commented on Nov 19, 2026

    @developerz-ai
    Contributor

    auth/http: one seam for setting an issued session's cookie

    • Picked up
    • Surveying the repo — 2026-11-19 01:02 UTC
    • Working
    • Pull request opened
    • Done

    Stopped — this needs a human. Nothing was merged.
    Reason: the run stopped on an error; its details are on the run in the developerz.ai dashboard.

    1h28m · 50 tool calls


  5. developerz-ai commented on Nov 19, 2026

    @developerz-ai
    Contributor

    Tracking pull request #1261 for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions