镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(federated-identity): name only communities that require NIP-FI as affected by a switch - #3072

Merged
baxen merged 3 commits into
mainfrom
mbot/fi-affected-requires
Nov 9, 2026
Merged

baxen merged 3 commits into
mainfrom
mbot/fi-affected-requires

Conversation

@baxen

@baxen baxen commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When a community refuses your organization account, the recovery prompts list the other joined communities the switch "also signs you out of". That list came only from the sign-in server's community host pattern. On Builderlab the pattern covers every community under its domain, so it named communities that don't require NIP-FI. Those are reached with the key alone, and the server session makes no difference to them. Settings → Identity → Organization sign-in had the same problem in its "Used by" list.

Change

  • Native (federated_identity_requires): says whether a community requires NIP-FI. It routes the community to its server with server_for and reads that server's requires_federated_identity, so it uses the same cached /info discovery as admission (requires_nip_fi, otherwise the capability). It never sends a credential. The command is registered in build.rs, the default capability and the browser permission test.
  • UI: FederatedIdentity.communityRequiresSignIn is optional and calls that command. coveredCommunities is replaced by useSignInCommunities, which keeps only the host-matched communities that require NIP-FI.
    • Default: a community counts as requiring NIP-FI until discovery says it doesn't. That covers both a failed discovery and one still pending: the warning exists to protect a quick switch, so a click before /info answers (up to the 30 s protocol deadline) must not skip it. Communities you're connected to already have cached discovery, so the list rarely shrinks after it appears.
    • Outside native, discovery rejects, so every covered community counts, as before.
  • Sign in again (refusal sign-in while still signed in) no longer names other communities. The refused session is already dead, so they are broken too.
  • Switch account: the toast and the in-community SwitchAccount prompt now share one line: "A, B and C also use this account. Switching may change your access there." (singular "uses").
  • Settings "Used by": same filter.
  • docs/buzz-help.md: Settings and Switch account wording updated to describe this. The Refused by a community section was still accurate.

Tests

  • CommunityRefusalNotice.test.tsx: on access, a community whose discovery is held is listed until it answers "doesn't require" and is then dropped; one whose discovery failed stays listed. The refusing community and another server's community are never asked about. On sign-in, no line appears and discovery is never called.
  • IdentitySettings.test.tsx: "Used by" excludes a covered community that doesn't require NIP-FI.
  • CommunitySignIn.test.tsx: existing switch test updated to the new copy.
  • At f5b275d: full vitest run (1035 files passed) and cargo test --lib browser_permissions federated_identity pass. At cd0b4ce (pending-counts change): the federated-identity and IdentitySettings Vitest files pass, plus typecheck and pre-push hooks.

Known limit

Settings → Organization sign-in now runs discovery for every joined community under a server's hosts, not just the ones you've connected to. Successes are cached, but the per-server discovery cache refuses new entries past 128 (assertion.rs, "Too many discovered communities"). Someone with more than 128 joined communities on one server could fill it from Settings, and admission to a community not yet discovered would then fail. That cap was there before this PR; no code change here.

Deferred

  • No native unit test for the command itself: it only composes canonical_relay, server_for and requires_federated_identity, which are already covered.
  • Not yet exercised in the desktop app against a real Builderlab community that doesn't enforce NIP-FI. A human still needs to test it.

baxen and others added 3 commits November 8, 2026 23:32
… affected by a switch

The Switch account prompts and Settings' "Used by" listed every joined
community under a server's host pattern, including ones that don't require
NIP-FI and are reached with the key alone. Native now answers whether a
community requires it from the /info discovery it shares with admission, and
the UI lists only those (a failed discovery counts). Sign in again no longer
names other communities: the refused session is already dead for them too.

Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…ties outside native

Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz>
Signed-off-by: Bradley Axen <baxen@squareup.com>
…y says it isn't

A Switch account clicked before a community's /info answered skipped its
warning. Pending discovery now counts as requiring NIP-FI, like a failed one.

Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz>
Signed-off-by: Bradley Axen <baxen@squareup.com>
@baxen
baxen marked this pull request as ready for review November 9, 2026 17:16
@baxen
baxen requested a review from a team as a code owner November 9, 2026 17:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:19:20.124646Z cd0b4ce Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd0b4ce60d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<p className="text-body-sm">
{`This also signs you out of: ${others.join(", ")}.`}
</p>
{refusal === "access" && (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the warning for signed-in sign-in refusals

When refusal === "sign-in" while the session is still signed-in—for example, after the relay returns the mapped evidence rejected refusal—the button below still calls runSwitch(..., "sign-out", ...), so it signs out the shared server session and may change access to every other protected community. Restricting SwitchAffects to access removes the only warning before that cross-community action; render the filtered warning for this signed-in sign-in-refusal branch as well.

Useful? React with 👍 / 👎.

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.

🤖 [P2] Keep the warning for shared-account recovery

evidence rejected maps to sign-in, but the relay verifier also returns it when this community does not authorize the assertion’s issuer. That does not end the issuer session or invalidate other communities. This branch still runs runSwitch(..., "sign-out", ...); can we retain SwitchAffects while still signed in so “Sign in again” warns about interrupting working communities?

Posted by Codex (gpt-6.1-sol) on behalf of kylez

Comment on lines +32 to +34
for (const url of key.split("\n"))
void identity
.communityRequiresSignIn(url)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid exhausting the admission discovery cache from Settings

When a server covers more than 128 joined communities, opening Organization sign-in starts discovery for every one here. The first 128 successful lookups permanently occupy that server's shared discovery cache, while discovery_generation rejects later entries with Too many discovered communities; because admission uses the same cache, an undiscovered community then cannot connect until the app restarts. Bound or separate these presentation lookups so merely opening Settings cannot disable community admission.

AGENTS.md reference: AGENTS.md:L147-L149

Useful? React with 👍 / 👎.

@kazemek21 kazemek21 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.

🤖 Kyle reviewed this PR and the Nexus review-tracker notes. Approving with the non-blocking shared-account recovery feedback above.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@baxen
baxen merged commit 3353dea into main Nov 9, 2026
81 of 95 checks passed
@baxen
baxen deleted the mbot/fi-affected-requires branch November 9, 2026 22:48
gilgtm added a commit that referenced this pull request Nov 10, 2026
…nt-progress-rows

* origin/main: (53 commits)
  fix(search): make Command F search the Bestie conversation (#3084)
  fix(plugins): keep failed update checks on the plugin's Settings row instead of a toast (#3088)
  Show single-agent Stop on the activity bubble (#3140)
  fix: support explicit hosted browser origins (#3149)
  fix: keep Codex tool namespace descriptions bounded (#3128)
  fix(messages): show "New messages" in channels longer than one page (#3071)
  Keep shared agent guidance generic (#3134)
  fix(typing): a thread reply also ends the agent's channel-level typing (#3148)
  Stream protected evidence across agent runtimes (#2882)
  feat(identity): consolidate key and account controls (#3069)
  Add portrait-colored foil and animated agent card reveal (#3144)
  NEXUS-4190: Disclose unavailable saved Solo choices (#2544)
  docs: mark the plugin API as preview and say which parts are steady (#3129)
  Open the app with a saved key; check the account's key in the background (#3064)
  fix(federated-identity): name only communities that require NIP-FI as affected by a switch (#3072)
  feat(pairing): signed in with Builderlab, say to get the app instead of pairing (#3039)
  Show Add agent button on shared agent previews (#3131)
  NEXUS-4224: Preserve peer unread intent during automatic reads (#2641)
  fix(plugins): review a pinned link to an installed plugin's source as an update (#3024)
  perf(profiles): resume verified-profile batches after a planned renewal (#2293)
  ...

Signed-off-by: Gil Birman <gil@squareup.com>

# Conflicts:
#	docs/buzz-help.md
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