Repository navigation
feat(templates): template marketplace — catalog mirror, install, checklist, export - #312
Merged
Merged
Conversation
This was referenced Sep 25, 2026
The triggers API and the personal MCP each carried their own copy of the creation logic, and only the MCP copy wrapped a webhook's endpoint and binding in one transaction. The template installer needs the same logic, so it moves into WorkflowTriggers::Creator and both callers use it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…d resources One allow-list of the attributes a copied agent, skill, tool or MCP server carries, for the template installer. Binary tool files are stored as a new object of the tool's own, as WorkflowDuplicator does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…manifest Board.create_from_columns takes an arbitrary column list (presets become one caller), and MCP::ConnectorInstaller.create_from_manifest builds a server from a manifest the caller already has. Template installs need both: their columns come from a package, and their connector manifest is a reviewed snapshot that must not be re-fetched from the registry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
template.v1.json is the contract the templates repository's CI and every installation validate against. Templates::Validator adds the checks a schema cannot express: cross-section references, an acyclic step graph, snapshot hashes, declared config items, and MCP header/env values that are references only, never literals. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
catalog_templates holds each reviewed package (definition, files, commit, digest) so an install never fetches anything live. The sync pins the branch head to a commit, downloads that commit's tarball, validates every template with this installation's own schema, skips what fails, and marks removed or revoked.yaml-listed templates revoked rather than deleting them. template_installs and template_setup_items back provenance and the post-install checklist. min_app_version is dropped from the format: the app has no version to compare it with, so compatibility is carried by format_version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…oject Templates::Planner works out the install without writing anything: permissions, a stale-page check, inputs, platform tools this installation must have, name conflicts in an existing project, the board merge, and the checklist. Templates::Installer applies it in one transaction from the mirrored package alone, refuses when the plan moved since it was confirmed, and is idempotent per key. Every trigger is created inactive. The OAuth probe of created MCP servers runs after commit in Templates::ProbeServersJob. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Adding a secret or choosing a repository attaches it to the workflows and steps the template referenced; activating a trigger restores the template's own mode and surfaces the auto-run rule's refusal as-is. Integrations, OAuth sign-ins and secrets added elsewhere resolve their items on refresh. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…al MCP search_template_catalog / get_template read the mirror; install_template plans first (dry_run, conflict resolutions) and installs with an idempotency key, never echoing secret values back; export_template turns a working project into a package and refuses whatever it cannot carry faithfully (a literal MCP header, an unpinned image, a binary tool file). The publish_template prompt walks the user's agent from export to the catalog pull request; Flow holds no token for the templates repository. Templates::Exporter flattens inherit_all_project_resources, exports registry skills and connector manifests as hashed snapshots, and a round trip (install, export, install again) reproduces the project. Built-in MCP servers travel by name (`internal:`), like platform tools. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
/templates and /templates/:slug are readable without signing in, in a separate public shell (AuthLayout only renders for a signed-in user). A guest who presses Install signs in and is brought back to the version they saw; only (slug, version) is kept in the session and the route back is built by the server. The install page plans on the server and posts the confirmed digest with an idempotency key; the checklist page acts on each item and resolves what was completed elsewhere. Secrets, inputs and resolutions are keyed by template data, so they are excluded from the global param underscoring. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
bin/rails templates:validate ROOT=… [BASE=…] runs the validator every installation runs, plus the repository's own rules: the directory is the slug, SETUP.md explains any requirement, and a changed template raises its version over the base branch. Templates are also reachable from the sidebar; unused model helpers are removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…orkflow Found by running an install in a browser against a real stack: a disabled schedule trigger still asked Temporal to delete a schedule it never had, and with Temporal unreachable the install returned a 500 after its transaction had committed. A binding created disabled now skips the reconcile entirely. The fixture's platform tool is renamed to one that exists (board_add_comment), and checklist labels name the workflow. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…stall The checklist said "nothing left to set up" until the background probe ran. A server the template declares as OAuth needs a sign-in regardless, so its item is created at install under the ref the probe later upserts. The install page also names the copy a conflict resolves to. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Browsing, installing (target, settings, conflicts), the setup checklist, publishing through the personal MCP, and what operators control. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…t pages Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
A package with agents (and no board or workflow) is an agent template, one with only skills a skill template; both install into an existing project like a connector. export_template takes agent_ids / skill_ids so an agent or skill can be published on its own. A package that installs nothing is refused. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
An authored skill becomes a manual Skill at install, whose name format and frontmatter rules the validator did not check, so a broken SKILL.md passed review and CI and only failed when someone installed it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
A template's identity is now namespace/slug, so two publishers can each have a "code-reviewer-agent". Templates live at templates/<namespace>/<slug>/ and publishers are registered in the repository's namespaces.yaml (display name, verified flag, owner logins), mirrored as catalog_namespaces. The repository CI checks that a pull request's author owns every namespace whose templates it changes, taking the owners of an existing namespace from the base branch so a pull request cannot add its own author; the maintainers' review of namespaces.yaml approves a new one. The catalog shows each template's publisher with a verified badge and filters by publisher; URLs, install params, the login continuation and the MCP tools address templates as namespace/slug. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
- Renumber the migration to 20260925130000: develop added one with the same version (add_public_sharing_to_run_and_task_assets). - Skills now carry their installed directory (Skill#files). A template skill is installed with its files, so a session runs the reviewed SKILL.md instead of `npx skills add` fetching upstream; extra skill files travel through export and install. - A connector snapshot carries the target as installed, with the pinned package release; the validator refuses a missing or unpinned target, and ConnectorInstaller.create_from_manifest never looks a release up. - ProjectResources::Builder stores a binary tool file as a new object of the tool's own, as WorkflowDuplicator now does. - Page props are typed through usePage<Props>() (no `as unknown as`), and the new rubocop cops are satisfied. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
force-pushed
the
feature/template-marketplace
branch
from
September 25, 2026 08:55
b4c03ff to
a68198c
Compare
…est server Covers the retry policy and the registration the scheduler and the admin sync button rely on, against develop's TemporalInput wrapping. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Sep 25, 2026
The template marketplace (#312) landed a migration at the same timestamp this branch had used, which aborts `db:migrate` outright. The table it creates depends only on user_sessions and identity_providers, both far earlier, so the later slot costs nothing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Sep 25, 2026
The template marketplace (#312) landed a migration at the same timestamp this branch had used, which aborts `db:migrate` outright. The table it creates depends only on user_sessions and identity_providers, both far earlier, so the later slot costs nothing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Sep 28, 2026
* docs(auth): add federated identity research, architecture and spec Market research for broad login coverage, the architecture spine it produced, the companion RFC, and the BMAD spec kernel. The research answers why this is built rather than bought: three constraints — enterprise SSO must work for self-hosted installs, there is no deadline, and no paid dependency may sit in the login path — eliminate the commercial CIAM market and the AGPL or self-hosted-paywalled identity providers before any feature comparison. Keycloak is evaluated on its merits and declined on fit with an app that already owns its user and organization model. The spine carries 26 invariants (AD-1..AD-26) with Binds/Prevents/Rule, four reviewer-gate reports, and an append-only memlog of every decision. Two questions are left open rather than answered: the sidecar's OSS tenancy, and IdP-initiated SSO. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(auth): add federated identity, company auth policy and SSO Six capabilities on one seam: a port with an adapter per authentication method, so adding a method is an adapter plus a provider row and never a change to the entry gate. Foundation. Identity is (provider, subject), never email — the previous resolution joined on address alone and never read email_verified, which is an account-takeover path the moment a second provider exists. Sessions become server-side rows whose proofs append, so revocation works, "sign out everywhere" is possible, and a user in two companies with disjoint policies is not bounced between step-ups forever. Company auth policy. Providers and policy are two tables, because a deployment-wide Google client and a per-customer SAML connection are not the same shape. Enforcement is at company entry, re-evaluated every request beside the membership check, and a mismatch redirects to step-up rather than signing anyone out. A policy edit that would strand any active member is refused and names them; deletion is evaluated exactly as disabling. Methods. Microsoft (Entra), per-company OIDC with PKCE and a server-side nonce, passkeys, single-use emailed links, and TOTP as a step-up that can never start a session. Every assertion is bound to the row it claims to satisfy — iss, aud, nonce, tid, bridge tenant — with no email fallback when binding fails. SAML never enters this process. A connection row holds the bridge's keys, not IdP metadata, and an invariant test fails if ruby-saml or omniauth-saml ever appear in Gemfile.lock: five Critical authentication-bypass advisories in fifteen months is not a dependency to carry in the web process. SCIM is a first-party endpoint scoped by its bearer token alone, writing memberships through the same state machine the UI uses and never writing identities. Two adversarial reviews caught four defects a green suite did not: an impersonation marker that outlived its session and granted admin to whoever signed in next, password credentials that never reached the identity resolver and so broke the stranding guard for everyone, a SCIM rename that could repoint a membership at an unrelated account, and a Microsoft assertion that could adopt an existing account because Entra proves no domain ownership. All four are fixed and covered. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(auth)!: drop SAML; enterprise SSO is per-company OIDC Removes the SAML adapter, the bridge client, the compose profile and their tests. A spike had verified the bridge first — the OSS build took three per-company connections with no licence gate, the adapter's client_id shape worked against the live authorize endpoint, and along the way it showed that the published compose image name did not resolve at all, that one entityID may serve only one tenant, and that the bridge phones analytics home unless told not to. None of that was the deciding factor. Carrying a second service is not worth what SAML buys, because enterprise SSO does not require it: per-company OIDC is already implemented and tested, and Entra ID, Okta, Ping, OneLogin, JumpCloud and Google Workspace all speak it. What is given up is customers whose IT mandates SAML specifically, or who run ADFS or Shibboleth. The in-process alternative stays rejected for the reason it always was: ruby-saml is the only Ruby service provider, and it has had five Critical authentication-bypass advisories in fifteen months — December 2025's published as an incomplete fix of March's. A test now bars it and its wrappers from Gemfile.lock, so adding SAML later is a deliberate decision taken with that history in view rather than a quiet bundle add. BREAKING CHANGE: the `sso` compose profile and the SSO_BRIDGE_* settings are removed. No deployment used them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): six defects a green suite could not see Found by running the feature in a browser against a real database. Each belongs to a class the suite is structurally blind to. Inertia camelizes prop keys, so every snake_case prop the new pages read came back undefined: the login screen offered Google on an installation with no Google credentials and hid passkeys and magic links entirely. Component tests passed because the test supplied the props, which made them a record of the author's guess rather than of the contract. SCIM writes were rejected with "Can't verify CSRF token authenticity". The test environment disables forgery protection, so request tests were green while a real directory — which sends a bearer token and no CSRF token — could not provision anyone. The regression test turns protection back on for that case. The emailed sign-in link pointed at the wrong port: url_for splits a `host` that carries one and falls back to the environment default. Invisible in production, where the domain has no port. Built as a string now, like the OIDC callback. The SCIM token was passed through a redirect's query string, putting a credential in browser history, access logs and any Referer. It travels in the flash. The step-up code form always failed: setData followed by post sends the previous state, so a TOTP attempt submitted as a password attempt with an empty password. The payload is built explicitly and the test now asserts what was posted. Magic link and passkey sign-ins replaced the live session instead of appending their proof, unlike the OIDC path — which would have defeated step-up through either. One shared `sign_in_or_prove` now governs all of them. Also: deployment providers no longer freeze a humanised label into every installation's data ("Totp"), the SCIM endpoint is shown before a token exists, and schema.rb keeps its committed check-constraint rendering. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): offer every accepted method on the step-up screen The step-up screen named the methods a workspace accepts but only rendered a control for some of them: `magic_link` had no start path, and `passkey` has no redirect at all, so both were listed and then unreachable. Someone whose workspace accepted only those two was told what to do and given no way to do it. `magic_link` now starts at `request_magic_link_path`, which fills the address in from the signed-in user rather than asking for it again, and the passkey ceremony runs inline on the page. Also: the sign-in methods page is admin-only in the sidebar, the three standalone auth screens center their content, and the two settings pages render inside AuthLayout so they keep the sidebar and page padding. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(mailer): address emailed links the way the browser reaches the app config/application.rb derives ActionMailer's default_url_options from Settings.domain and Settings.protocol, so they follow DOMAIN. development.rb then set them again to a hardcoded host plus the port the process listens on. Those two ports are the same only when nothing is published in front of the app: behind a port mapping, a proxy or a container they differ, and every emailed link points at a port the recipient cannot open. A sign-in link from a second dev stack led back to the first one. MagicLinkMailer built its URL as a string to dodge this, and blamed url_for in a comment. url_for was never at fault — passing a host that carries a port works fine until a `port:` option overrides it, which is exactly what the override added. Both mailers now use the ordinary url helpers. The guard has to read the config files: nothing in a test run exercises the development environment. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(auth): show a scannable QR when enrolling authentication codes Enrolment handed over a 32-character base32 secret and left the person to retype it. The server already built the otpauth:// URI that an authenticator reads from a QR; nothing rendered it. Auth::QrCode renders that URI as an SVG data: URI, so the page shows it with a plain img tag — no QR library in the bundle and no server-built markup injected into the document. The image carries its own white ground and the four-module quiet zone the format requires: left transparent it inherits the page, which on the dark theme is dark-on-dark and unscannable. The typed secret stays as the fallback for an authenticator with no camera. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): say why company SSO and the emailed link are inactive Both sit above the email field and both are disabled until it has something, because both start from the address: SSO resolves the workspace from its domain, and a link has to be sent somewhere. Google and a passkey need no address — Google runs its own account picker, a passkey is discoverable — so they stay active. Nothing on screen said any of that, and a greyed control with no reason reads as broken. A line under the group now names the reason while the address is missing, and narrows itself when the installation offers no emailed link. The block was also duplicated between the ordinary card and the error card; it is one SignInMethods component now. Reconciles docs/design/federated-identity.md with the dropped SAML sidecar: the scope, goals, identity-binding and Keycloak paragraphs still described a bridge that no longer exists, and the open-questions table still listed five questions that are all now answered or withdrawn. Corrects the callback_url comment, which repeated a wrong diagnosis of url_for. The reason to build that string by hand is real but different: the value must match what the customer registered byte for byte and must not vary with the request, and url_for in a controller takes the host from the incoming request. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * docs(auth): add a screenshot walkthrough and finish the SAML reconciliation The RFC now shows the shipped surfaces: signing in, SSO discovery (one connection, several, none), the emailed link end to end, company auth policy with an unverified connection, the entry gate before and after, code enrolment, and the admin-only policy surface refused to a member both ways. Captured from a running build with the TOTP secret redacted and the secret it encoded destroyed afterwards. docs/index.md still described a SAML sidecar in three entries and counted 17 ADs where the spine has 28; the spec still carried an open question about IdP-initiated SSO that only existed because of SAML. The spine itself was already coherent — AD-8 and AD-9 are marked retired by AD-28. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * docs(config): document the variables this branch adds The Settings refactor that landed on develop (#270) brought a guard: every environment variable a settings file reads must have a row in docs/reference/configuration.md, and the docs portal must serve that file rather than a hand-copy. Rebasing onto it surfaced four undocumented variables from this branch. AUTH_ENABLED_KINDS is worth reading twice: availability is derived from which credentials are actually present, so the allowlist can only ever offer less than that — an installation with no Microsoft credentials never offers Microsoft however it is set. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): never auto-join a company that refuses the method used The email domain picks WHICH company someone joins. It never asked WHETHER that company accepts the method they just signed in with, so a Google sign-in could plant a membership in a workspace that has Google switched off. That membership can never be entered — the entry gate re-checks the policy on every request — and once active it strands its holder, which makes PolicyUpdater refuse EVERY later policy edit by that company's admins. A membership nobody can use is worse than no membership: it reads as access, counts as a member, and quietly freezes the policy screen. Auth::PolicyResolver.accepts? answers the question with one EXISTS rather than plucking the whole set to test a single id, and lives beside the rest of the effective-set arithmetic because that module is declared its only computation. The test for the freeze goes through IdentityResolver rather than the factory on purpose: a factory-built user carries a password identity and could never be stranded, so the first version of it proved nothing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * chore(routes): regenerate the TypeScript route helpers Hand-merging this generated file during the rebase dropped a closing brace. Regenerated from the routes themselves rather than patched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): finish the move onto develop's server-side sessions Rebasing surfaced four things the merge itself could not. `sign_in_or_prove` ended up defined twice — the second copy, from the defects commit, still named the model this branch no longer has, and being last it won. The Google callback's `rescue StandardError` turned the resulting NameError into a plain "oauth_failed" redirect, so the only visible symptom was a proof that never appended. The test helper still called a SessionService method that is gone. A cookie carrying only a user id is adopted into a session row on first use, but an adopted row holds no proof and the entry gate reads proofs, so the helper mints the row itself. Encryptable changed shape on develop: `encryption_key :name` replaces the old override. Both of this branch's secrets were also encrypting through the raw encryptor rather than the concern, which kept them out of `encrypted_columns` — so `encryption:reencrypt` would have skipped them and a key rotation would have left them unreadable once the retired key was dropped. They go through `encrypt_secret`/`decrypt_secret` now, which also gives them the purpose binding #309 introduced. Impersonation hygiene is develop's now: impersonating is a sign-in of its own recording `impersonator_id`, which covers the escalation this branch had patched by hand. The test moves to that design and gains the case their model's own comment promises — suspending the operator mid-impersonation ends their admin access. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * chore(db): renumber the proofs migration past a colliding timestamp The template marketplace (#312) landed a migration at the same timestamp this branch had used, which aborts `db:migrate` outright. The table it creates depends only on user_sessions and identity_providers, both far earlier, so the later slot costs nothing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): let an admin verify a connection that is not enabled yet AD-7 wants a company-scoped connection proved before it can be enabled, and the proof is a completed sign-in through it. Refusing to START a disabled connection made that impossible: no sign-in until enabled, no enabling until signed in. Only a platform operator could break the cycle, so a company admin could never set up their own SSO — while the screen told them to "sign in through it once, then enable it here". An admin of the owning company may now start one that is still switched off. It stays a verification rather than a way in: the company does not accept the method, so the entry gate turns the resulting session away exactly as before, and the connection still cannot be enabled until the sign-in actually completed. The screen gains the Verify button that starts it, and the toggle is held shut until it has. Found by deploying to staging. Both guards were individually tested and green — "a disabled connection cannot be started" asserts the refusal as correct, and the enable guard seeds the identity directly. Only the pair deadlocks, which no unit of either could see. Also corrects three documents that still promised one forced global re-authentication at the cutover. That followed from this feature owning the session record; it no longer does, so live sessions survive and the cutover costs one step-up instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): verify a connection through a real form, not an Inertia visit Verifying redirects to the customer's identity provider, and an Inertia `router.post` is an XHR: the browser refuses to follow a cross-origin redirect from one, reports it as CORS, and the page simply sits there. The server was right all along — the authorize URL was built with PKCE and returned as a 302 — so no request test could see it. GoogleLoginButton is a form for exactly this reason; the Verify button now is too. Still POST with a CSRF token rather than a link: a GET start can be triggered on a victim's session from an external page (CVE-2015-9284). The page gains the tests that express the difference a request test cannot — that Verify submits a form at the start path carrying an authenticity token, that an unverified connection holds its switch shut, that Verify disappears once proved, and that a member sees neither Verify nor Remove. Found on staging within minutes of deploying the fix it belongs to. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(scim): route the paths a real directory actually calls SCIM fixes its collection at "/Users", capital U, and Scimitar advertises it that way in ResourceTypes. Rails routing is case-sensitive, so the `resources :users` draw answered "/scim/users" and returned 404 for the only spelling Entra or Okta ever sends — the feature could not have worked against a live provider. The same draw pointed PUT at Scimitar's #update, which expects a PATCH "Operations" body, so a provider's replace would have been parsed as a patch. PUT now reaches #replace. Neither fault was visible to the request tests: they chose their own URLs, and lowercase happened to be the one they chose. The added routing assertions pin the canonical spellings, and the round-trip test follows the Location header of a created member back to a fetch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(scim): throttle the directory endpoint before publishing it On a deployment that exposes /scim to the internet, one bearer token is everything standing between a stranger and a company's membership list, and nothing else about the request identifies the caller. Two throttles: per credential, generous enough for a real directory's reconciliation sweep, and per IP, which caps guessing at a rate no attacker can use. The cache key is a digest, so a throttle bucket never holds a live credential. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * docs(auth): publish the sign-in and SSO guides under /docs Two pages: one for a workspace admin — what the methods are, how a workspace decides which it accepts, connecting an OIDC provider, the verify-before-enable step, step-up, directory sync — and one for whoever runs the installation, covering the credentials each provider needs and why availability is derived from them rather than declared. Registered in all five places a /docs page has to appear, including the Ruby slug list in Web::DocsController that is the easy one to miss. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * style(docs): order the new doc imports alphabetically Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * feat(auth): keep live sessions signed in through the cutover The policy gate answers "which method backs this session" from user_session_proofs. Sessions that predate that table have no proof, so every one of them would be sent to step-up on the first request after deploy — not because a company's policy changed, but because user_sessions records no method and the question is new. Where the answer is unambiguous it is recovered instead of asked for: a user holding exactly one identity provider authenticated through that one, because there was nothing else to authenticate through. A user holding several is skipped, since choosing between them would be inventing the proof rather than recovering it, and step-up is the right outcome there. The proof is dated from the session's own creation, not from the deploy — that is when the person actually authenticated. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * test(auth): build the cutover fixtures from how identities actually appear Setting a password creates its identity (User#link_password_identity), so a plain factory user already holds one provider. The tests were written as if it held none, which inverted every expectation: the "no identity" case was proved and the single-provider cases were skipped as ambiguous. The shapes now mirror the ones a deployment actually has after the backfill — a password user, a Google-only user, and the two edges the migration refuses to guess at. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(scim): name the SCIM routes instead of letting Rails derive them Left unnamed, Rails takes the name from the literal path segment: the collection became `scim_Users` — capital and all, which then reaches the frontend as `scimUsersPath` — and the next route on the same path fell back to a bare `scim` that requires an `:id`, reading as the engine root rather than a member. The paths themselves are unchanged; only their names are. Nothing in the frontend referenced the derived helpers, since SCIM is machine-facing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): let SSO discovery actually reach the provider Resolving an address to its company's single connection answered with a 303 to /auth/oidc/:id/start. That route is POST only — deliberately, so a GET cannot be triggered on a victim's session (CVE-2015-9284) — and a redirect is followed with GET, so the browser landed on a routing error instead of signing in. Every workspace with exactly one connection had no working "Sign in with your company SSO". Discovery now begins the authorization itself, sharing the redirect with #start so the two ways of reaching a connection cannot drift. It is already the person's own POST with their CSRF token, so the second hop added nothing. The test asserted the redirect TARGET was oidc_start_path, which is precisely what was broken — it never asked whether a browser could follow it. It now checks that discovery leaves for the provider, and a second test pins that it never again answers with one of our own paths. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * refactor(settings): move sign-in methods into company settings as Access (#337) * refactor(settings): move sign-in methods into company settings as Access They read as settings and were reached from a separate sidebar entry, so the screen is now the Access tab of company settings: which methods the workspace accepts, its own OIDC connection, its directory sync, and who may join without an invitation. Each tab is its own URL rather than a client-side panel swap, because the two halves save differently — General is one form behind one Save, Access applies every control on the spot. A tab that is also a route keeps that honest and stays linkable. Domain auto-join moves with it: it answers the same question as everything around it. It is saved on the spot too, since a lone Save button for one switch would be the only control on the tab that behaved differently, and settings#update now returns to the tab the edit came from. General no longer carries autoAcceptUsers at all — resending a stale copy from there would have quietly undone a change made here. The list is now reachable by members, read-only: knowing which methods a workspace accepts is how someone makes sense of a step-up prompt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(settings): follow the moved Access page from every caller Removing the auth_policies index route removed company_auth_policies_path with it, and three controllers still redirected there: adding, updating and removing an OIDC connection, both SCIM token actions, and the return from verifying a connection. Rails only raises on the call, so the page itself looked fine. The two settings tests that covered the Joining card move to where the card now lives. What replaces them on the general tab asserts the absence: a second control for the same field would fight the one on Access, and this page's deferred Save would send a stale copy over it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> --------- Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> * refactor(auth): draw every sign-in method with one component (#339) The five methods were built by three components with five different recipes: two at size lg and three at the default, two with variant subtle so they carried no border at all, and MicrosoftLoginButton applying `classes.googleButton` from a stylesheet that never defined it — so it silently got none of Google's styling and fell back to the browser font. Only two methods had an icon, so their labels started at four different x positions. AuthMethodButton fixes the shape once: one height, one border, and a fixed icon column held even where a method has no icon, which is what puts every label on the same x. Google and Microsoft were byte-identical apart from an icon, a path and a label, and are now exactly that. Credentials move above the methods. Two of them wait on the address, and the field they wait on used to sit below them — the hint said "enter it below", pointing past the controls it excused. Also collapses the login card: `error ? <Paper>…</Paper> : <Paper>…</Paper>` held two byte-identical branches of ~85 lines each. Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> * feat(auth): ask for the address first, then offer what the workspace takes (#341) * feat(auth): ask for the address first, then offer what the workspace takes The login screen offered every method at once and greyed out the two that need an address — with the field they need sitting below them. Now it asks for the address, and what comes back is decided by its domain: a workspace that signs in through a provider goes straight there, one that does not gets a second step drawn from exactly the methods it accepts. Nothing that cannot complete is ever offered. Decided by the DOMAIN, never by whether an account exists. An unknown address at a known domain answers identically to a known one, or the screen becomes an oracle for which addresses are registered — there is a test that compares the two responses field by field. Authentication codes are excluded at the service: six digits confirm a session that already exists, and there is nobody to look up from them. /login/sso becomes /login/identify. Its "this domain has no SSO" branch stops being the error `no_sso_connection` and becomes the ordinary second step, which is what it is for most domains. Validation splits with the screen: the address is settled on step one and is not editable on step two, so a complaint about it there would have had nowhere to appear. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(auth): keep a refused password on the step it was typed on Signing in is two screens now, and two things still assumed one. The system-test page object filled an address and a password together; the password box only exists on the second screen, so every system test that signs in died on it. It walks both steps now, and waits for the second to arrive rather than reaching for a field the server has not sent yet. And a refused password redirected to /login — which is the ADDRESS step, so a typo cost you the address you had already given. It re-renders the credentials step instead, with the workspace's methods and the refusal on it. An address no workspace claims still goes back to the start; there is no step two to return to. The render moves to a concern, since #identify and #create both reach it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * test(auth): assert the refusal, not the redirect it used to be A soft-deleted account is still refused at login; it now stays on the credentials step with the message instead of redirecting, like any other refusal. The test pinned the redirect, which was the transport rather than the behaviour. What it was there for is untouched and still asserted: no session comes out of it, so the account is refused AT LOGIN rather than signed in and then dropped by current_user's not_deleted scope. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]> --------- Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> --------- Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Summary
A template catalog: reviewed connectors, boards, workflows and whole projects that any Flow installation can install with one click. Templates live in one public repository (
AixleHQ/flow-templates, not created yet); every installation mirrors it hourly and installs only from that mirror. Secrets never travel in a template.Design: the Opus proposal on
feature/catalog_tech_design(docs/design/catalog/opus_proposal/template-marketplace.md); §12 lists where this implementation differs from it.What it adds
namespace/slug, so two publishers can each have acode-reviewer-agent. Publishers come from the repository'snamespaces.yaml(display name,verified, owner logins). The repository CI refuses a change to a namespace its author does not own, and the catalog filters by publisher and shows a verified badge.config/templates/template.v1.jsonplusTemplates::Validator: local keys instead of ids,{{inputs.*}}substitution in an explicit list of fields, registry skills and connector manifests carried as sha256-checked snapshots, MCP header/env values limited toconfig_item:references.Templates::CatalogSync(hourlytemplates_catalog_sync_workflow, and a Sync template catalog button in Admin → Catalog syncs) pins the branch head to a commit, downloads that commit's tarball, validates every template, skips invalid ones, and marks removed orrevoked.yaml-listed templates revoked.Templates::Planner(no writes) andTemplates::Installer(one transaction, idempotent per key, refuses if the plan moved since it was confirmed). A project template always creates a new project; any other kind can go into an existing project, where a same-named resource with different content is a conflict to resolve (copy or use existing). Every trigger is installed inactive.Templates::SetupChecklist: secrets and repositories are attached where the template needs them, triggers are activated from here, and integrations and OAuth sign-ins resolve themselves.Templates::Exporterturns a working project into a package and refuses anything it cannot carry faithfully (a literal MCP header, an unpinned image, a binary tool file).search_template_catalog,get_template,install_template(withdry_runandresolutions),export_template, and thepublish_templateprompt. Flow holds no token for the templates repository; the user's own agent opens the pull request./templatesand/templates/:slugin a separate guest layout (AuthLayoutonly renders for a signed-in user). A guest who presses Install signs in and comes back to the version they saw; only(slug, version)is kept in the session. Also the install page, the checklist page, a sidebar entry, and a docs page.bin/rails templates:validate ROOT=… [BASE=…]runs the same validator the installations run, plus the repository's own rules (the directory is the slug,SETUP.mdis required when the template has requirements, and a changed template must raise its version).Refactors that land first, with no behaviour change:
WorkflowTriggers::Creatorreplaces the two copies of trigger-creation logic (API controller and personal MCP tool),ProjectResources::Builderis shared byWorkflowDuplicator, andBoard.create_from_columns/MCP::ConnectorInstaller.create_from_manifestare new.Also: a
TriggerBindingcreated disabled no longer reconciles onto Temporal. It has no schedule to delete, and asking for the delete turned a Temporal outage into a 500 after the install had committed.What it looks like
Public catalog
Readable without signing in: kinds, what each template includes, and what it needs.
Template page
What gets created, what never travels, and every requirement with the moment it is asked for.
Install
Setup checklist
The secret is saved and the column trigger activated. The schedule trigger is refused with the auto-run rule's own message, and the OAuth sign-ins were added by the post-install probe.
Verification
tsc, eslint, steiger, and vitest (1481 tests).Not in this PR
AixleHQ/flow-templatesrepository itself. A scaffold with four starter templates, CI andbin/validateis ready. Its CI runs the validator insideghcr.io/aixlehq/flow-web:latest, so it needs this code released tomain-imagesfirst.🤖 Generated with Claude Code