Skip to content

Auto-approve connect requests with valid connection tokens#44

Open
btcjt wants to merge 2 commits into
Letdown2491:mainfrom
btcjt:main
Open

Auto-approve connect requests with valid connection tokens#44
btcjt wants to merge 2 commits into
Letdown2491:mainfrom
btcjt:main

Conversation

@btcjt

@btcjt btcjt commented Mar 10, 2026

Copy link
Copy Markdown

Summary

When a connect request includes a valid one-time connection token (or admin secret), auto-approve with "reasonable" trust level and return ack immediately instead of requiring manual dashboard approval.

The connection token is already a one-time secret with a TTL, so validating it is sufficient authorization. This enables automated signup flows where a server creates a key + connection token and the client connects programmatically without human intervention.

Requests without a secret still go through manual approval via the UI (existing behavior).

Changes

  • apps/signet/src/daemon/nip46-backend.ts: Modified handleConnect() to call grantPermissionsByTrustLevel() and return 'ack' when a valid token/admin secret is provided, instead of always falling through to permitCallback()

Test plan

  • Connect with valid one-time connection token → auto-approved, no dashboard pending request
  • Connect with valid admin secret → auto-approved
  • Connect with invalid secret → silently rejected (unchanged)
  • Connect with no secret → manual approval via dashboard UI (unchanged)
  • Reconnect from already-approved app → auto-approved via existing ACL (unchanged)

btcjt and others added 2 commits March 10, 2026 12:11
When a connect request includes a valid one-time connection token
(or admin secret), auto-approve with "reasonable" trust level and
return 'ack' immediately instead of requiring manual dashboard approval.

The connection token is already a one-time secret with a TTL, so
validating it is sufficient authorization. This enables automated
signup flows where the server creates a key + connection token and
the client connects without human intervention.

Requests without a secret still go through manual approval (existing behavior).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Connection tokens are only issued by the admin API, so the connecting
app is trusted. Full trust avoids blocking on sensitive event kinds
(profile metadata, relay lists, etc.) that are needed during signup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Letdown2491

Copy link
Copy Markdown
Owner

I love this. Will test tonight and merge if all goes well.

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