Skip to content

feat(scaffold): a --claimable project's prod lets visitors sign up, so the unclaimed app is usable - #2791

Open
reliant-01 wants to merge 1 commit into
mainfrom
feat/claimable-open-signup
Open

reliant-01 wants to merge 1 commit into
mainfrom
feat/claimable-open-signup

Conversation

@reliant-01

Copy link
Copy Markdown
Contributor

Part of making the DEFAULT forge project new x --service a --frontend web --claimable app work on its unclaimed URL with its native sign-in (owner decision 2026-11-25; new.txt §1 #3).

Problem

The scaffolded identity (deploy/kcl/identity.k) declares only roles, so its signup is "invite". On Reliant hosting, that means only owners, declared members and invitees can have an account. An anonymous deploy has none of these, so nobody can ever sign in to it. The broker also mounts /auth/register only when the declaration delivers a login policy that allows sign-up (kcl/render.k _idn_declares_login_policy).

Change

  • A --claimable project's deploy/kcl/prod/main.k declares identity = idn.IDENTITY | {signup = "open"}, with a comment saying why and what to do once the deploy is claimed.
  • The env's docstring now lists the override among the things to delete after claiming, beside claimable = True.
  • Only the prod env of a --claimable project changes. Every other env, and every project made without --claimable, renders exactly as before: invite-only.
  • Checked on a real project new --claimable project:
    • forge env kcl eval deploy/kcl/prod/main.k renders identity.signup = {mode: "open"}, and the delivered managed secrets include …_LOGIN_POLICY, so the broker gets the login policy and serves /auth/register;
    • forge lint passes on that project (35 gating linters; forgeconv-unproven-signup does not fire on signup = "open").

Depends on (control-plane)

An unclaimed org's identity sends no mail. control-plane#3658 makes the platform admit signup = "open" for an UNCLAIMED org with no mail relay, and publish mail: "none", so sign-up creates the account with its password and signs in without a verification email.

Without #3658, the platform refuses this declaration ("open or domain signup are emails…"). That would block the anonymous deploy at the identity step, so this PR must not ship in a forge release before control-plane#3658 is live in prod. The other prerequisites for sign-in on the preview are control-plane#3643 (identity DNS), #3650 (a real origin for preview pages) and #3642 (the content scan admits sign-in pages).

Security trade-off (owner-accepted 2026-11-25)

While a deploy is unclaimed, anyone can create an account on it, with an email address nobody verified. The app's author can't bind anything to that address safely. The deploy expires in 72h unless claimed, and the comment tells the claimer to drop the override (or keep it once their organization delivers mail, which then verifies new addresses).

Tests

  • env_cloud_prod_claimable.k.golden is updated.
  • task test:short -- ./internal/templates/... ./internal/generator/... passes.
  • I ran an end-to-end project new --claimable → scaffold → env kcl eval → forge lint by hand (above).

Post-merge check

After the next forge release, and after control-plane#3658 is live:

  1. Run forge project new x --service a --frontend web --claimable, then forge env deploy prod --claimable.
  2. Open the unclaimed URL; GET /_api/auth/options returns selfSignup: true.
  3. "Create an account" with an email and password signs in.

Rollback

Revert this PR. New --claimable projects are invite-only again. Projects already scaffolded keep the line, which their authors own.

@reliant-labs reliant-labs Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review:changes

Lane: MEDIUM (one pass on gpt-6-luna@codex).

MEDIUM: deploy (internal/templates/deploy/kcl/cloud/main.k.tmpl)

The diff is readable, but it makes all claimable templates depend on a control-plane behavior that is present only in an unmerged sibling change. The corresponding test demonstrates the proposed exception, not production availability, so the generated config can be refused against the current server.

  • blocker [B1] internal/templates/deploy/kcl/cloud/main.k.tmpl:228 — Claimable renders now unconditionally declare open signup, but the currently deployed control plane may refuse that declaration when identity mail is unavailable. The exception that admits this case exists only in the cited unmerged change, reliant-labs/control-plane:internal/identityreconcile/signin_v2.go:99@bbf3319b8fce; its test at reliant-labs/control-plane:internal/identityreconcile/signin_v2_test.go:448@bbf3319b8fce confirms behavior in that change, not availability in production. Until control-plane#3658 is merged and deployed, the generated identity declaration can be refused and claimable deployment won't converge, an RC-11 server-before-client incompatibility. Fix: Gate generation of this override on the control plane advertising the required unclaimed-signup behavior, with the previous invite-only output as fallback; otherwise wait until the server support has landed and is available before emitting it.

Fix the blockers and push: the push is reviewed again. (pr-fix takes over if nobody does.)

Reviewed 1633665f40d8d57ea401b8d007d1606da52a7c93.

Posted by Reliant for PR pipeline · pr-review · opened, an automation of @reliant-01.

@reliant-labs reliant-labs Bot added review:changes Blocking review findings; workflow repairs or fix, push, re-label merge:queue and removed review:pending labels Nov 25, 2026
@reliant-labs

reliant-labs Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

[B1] I agree with the ordering finding. This PR must not ship in a forge release before control-plane#3658 (which admits signup = "open" for an unclaimed org with no mail relay) is live in prod. Gating the scaffold on a control-plane capability at project new time would freeze whatever the server answered that day into a file the author owns, so I'm sequencing it instead: I've labelled this PR hold until #3658 is released to prod, and will then remove the label and push. The body already says this under "Depends on".

@reliant-labs reliant-labs Bot added the hold Keep out of review and merge queues; owner decides label Nov 25, 2026
@reliant-labs

reliant-labs Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

pr-sweep: this hold needs a reason

hold was added by the pipeline 0h ago, and the PR does not say why. Reply with a line that starts with hold: and says why it is held and until when, for example hold: waiting for forge #1234 to release, until Friday.

After 72h a hold is listed on the pipeline health issue and its owner (and @reliant-01) are pinged once. A held PR is never merged or closed automatically.

Posted by Reliant for PR pipeline · pr-sweep · hourly, an automation of @reliant-01.

This branch has not been deployed

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

Labels

hold Keep out of review and merge queues; owner decides review:changes Blocking review findings; workflow repairs or fix, push, re-label merge:queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant