Auto-approve connect requests with valid connection tokens#44
Open
btcjt wants to merge 2 commits into
Open
Conversation
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>
Owner
|
I love this. Will test tonight and merge if all goes well. |
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
When a
connectrequest includes a valid one-time connection token (or admin secret), auto-approve with "reasonable" trust level and returnackimmediately 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: ModifiedhandleConnect()to callgrantPermissionsByTrustLevel()and return'ack'when a valid token/admin secret is provided, instead of always falling through topermitCallback()Test plan