Skip to content

feat(desktop): add exact owner confirmation action - #7498

Open
BluRoot01 wants to merge 1 commit into
block:mainfrom
BluRoot01:fix/workdrive-owner-confirmation
Open

feat(desktop): add exact owner confirmation action#7498
BluRoot01 wants to merge 1 commit into
block:mainfrom
BluRoot01:fix/workdrive-owner-confirmation

Conversation

@BluRoot01

Copy link
Copy Markdown

Summary

Adds a fail-closed, client-rendered confirmation action for exact WorkDrive connection upgrades. The native command refetches the request event, requires a bot-role requester and live channel owner signer, rejects unknown or altered fields/scopes/actions, and signs only the canonical create-only approval event.

Related issue

N/A — operational incident tracked in Buzz as f59a78a561a9cbde28aec3e8819ec40c578680022533e1ba338755e512b38bbf.

Testing

  • Full affected desktop Rust workspace: 3,193 tests passed (one pre-existing macOS process fixture excluded after failing unchanged because its PID file is empty)
  • TypeScript typecheck passed
  • Parser security tests: 3 passed
  • Rendered Playwright flow passed, including review content and cancellation without approval
  • Repository-wide CI reached the same unrelated process-fixture failure; all preceding checks and package suites passed

Signed-off-by: Forge <forge@bluroot.co>
@BluRoot01
BluRoot01 requested a review from a team as a code owner September 8, 2026 20:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T20:24:22.304914Z f15ba8e PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 218633b8fd6ee41aee8eb18ba9806e8d90694751...f15ba8ecf3e6e098a6d8c91fe1ca7f18d62e723d.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review f15ba8ecf3e6e098a6d8c91fe1ca7f18d62e723d to authorize a new review.
Any previous review applies only to its recorded range.

@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: f15ba8ecf3

ℹ️ 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".

Comment on lines +306 to +310
const workDriveConfirmation = React.useMemo(() => {
if (!channelId) return null;
const payload = extractWorkDriveOwnerConfirmation(message.body);
if (!payload || payload.channel_id !== channelId) {
return null;

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 Authenticate the approval card before rendering it

Any channel message containing a syntactically valid payload for this channel is replaced with the trusted-looking approval card, without checking that payload.owner_pubkey targets the current user or that the raw event signer is a known channel agent. Consequently every non-owner sees an action that can only fail, and an ordinary member can spoof the security prompt even though the native command later rejects approval. Gate rendering on the current pubkey and the authenticated message.signerPubkey/message kind, as the nearby config-nudge path does.

Useful? React with 👍 / 👎.

Comment on lines +98 to +102
let events = query_relay(
&state,
&[serde_json::json!({
"ids": [request_event_id],
"kinds": [9],

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 Pin the confirmation to its originating community

If the user switches communities while this command is awaiting network responses, the first request can be fetched from relay A while the signer, roster query, and final submit_event are independently re-resolved from relay B. This can fail a legitimate approval or, where identities/channel IDs overlap, publish a privileged confirmation into the wrong tenant. Capture the relay and signing keys once, use the explicit-relay query/submission helpers, and reject an active-scope change before publishing.

AGENTS.md reference: AGENTS.md:L176-L179

Useful? React with 👍 / 👎.

Comment on lines +66 to +70
await page.getByRole("button", { name: "Cancel" }).click();
await expect(
page.getByRole("heading", { name: "Allow create-only WorkDrive uploads?" }),
).not.toBeVisible();
await expect(card.getByRole("button", { name: "Review and approve" })).toBeVisible();

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 Exercise the approval path through the production command

This required smoke test only cancels the dialog, while the Rust tests cover only parsing and validation helpers; no test invokes confirm_workdrive_owner_request or observes its relay queries and signed submission. Removing the command registration, authorization checks, or event publication would therefore leave all added tests green. Add a test that approves through the production command seam against a controlled relay and verifies the owner/bot checks and canonical reply event.

AGENTS.md reference: AGENTS.md:L188-L192

Useful? React with 👍 / 👎.

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.

1 participant