feat: URL-mode secret collection for create_edge_function_secret - #412
Draft
barryroodt wants to merge 1 commit into
Draft
feat: URL-mode secret collection for create_edge_function_secret#412barryroodt wants to merge 1 commit into
barryroodt wants to merge 1 commit into
Conversation
Coverage Report for CI Build 33808013145Coverage decreased (-0.2%) to 96.283%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
commit: |
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.
Adds
create_edge_function_secret({ project_id, name })so an agent can trigger storing an Edge Function secret without seeing the value. There's novalueparameter. Clients that support URL-mode elicitation (protocol 2026-07-28) get anelicitUrlto the dashboard, the user types the secret there, and it never enters the AI client or the model context. Follows the elicitation pattern from #391 and #394.How it works
elicitUrlat${connectBaseUrl}?ref=<project>&name=<secret>. The elicitation message is three short lines with no URL in it. Clients without URL capability get anisErrortext pointing them to Edge Functions > Secrets in the dashboard.updated_at: stateless v1. On accept, the server reads the named secret'supdated_atthrough the newSecretOperations.getUpdatedAt(projectId, name)(timestamp only, never values).updated_at >= issued_atmeans stored.issued_at. A fresh call within 600 s of a write returns{ name, stored: true, updated_seconds_ago }. Decline and cancel store nothing.secretCollection?: { connectBaseUrl }option. It requirescostConfirmation(shared signedrequestState) and throws at construction without it. The tool registers under thefunctionsfeature group only whenplatform.secretsexists. Hosted rollout is flag-gated on the platform side in a separate PR.v1 limits
The URL carries the project ref and secret name, so it's forgeable; the dashboard session plus write permission is the mitigation. A collaborator writing the same name inside the window reads as stored. A server-side handoff record with an opaque handle is tracked in AI-1170. Studio page wiring on top of supabase/supabase#49954 is AI-1171.
Tests
isUrlCapabletable plus 12 integration cases inserver.test.ts: URL shape, unsupported clients, novaluein schema, accept, reissue, second boundary, decline/cancel, resume-by-key, cross-tool state, config gates. Full suite 157/157, typecheck and biome clean.