Add connection links via a dedicated #/connect route#1828
Draft
kmcginnes wants to merge 1 commit into
Draft
Conversation
5 tasks
8f60441 to
fb3eafb
Compare
External applications can deep-link into Graph Explorer with a connection preconfigured: #/connect?graphDbUrl=...&queryEngine=...&awsRegion=...&serviceType=...&name=... The route resolves the params against existing connections into one of four intents and acts on it, then redirects to the graph canvas so the connect URL never lingers in history: - none — the params target the active connection; nothing to do. - activate — the params match an existing connection; switch to it silently, the same no-prompt operation as clicking it in the connections list. - create — no match; open the create form prefilled but fully editable. This is the trust gate for the untrusted endpoint details a link can carry, and the only path that can introduce a new database. - invalid — the link's graphDbUrl failed validation; warn with a toast and ignore it. Matching identity folds in auth posture (IAM on/off, and when on, region and service type) alongside graphDbUrl and queryEngine, so a link requesting IAM never silently reuses a plaintext connection to the same endpoint, or vice versa — a mismatch falls through to the create form. graphDbUrl is validated as an http(s) URL with zod; a malformed or non-http link is ignored. The proxy base URL is derived from document.baseURI rather than window.location.origin so a link produces a working proxy connection on path-hosted deployments (e.g. a Neptune notebook at /proxy/9250/explorer/ resolves the proxy to /proxy/9250). Contract core lives in core/urlConnectionParams.ts (parse/match/build/resolve) and core/useUrlConnectionIntent.ts. Documented in the connections feature page, the security reference, CONTEXT.md, and an ADR.
fb3eafb to
72d2c25
Compare
5 tasks
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.
Description
Lets external applications deep-link into Graph Explorer with a connection preconfigured, via a dedicated
#/connectroute:The route resolves the params against the existing connections into one of four intents, acts on it, then redirects to the graph canvas so the connect URL never lingers in history:
graphDbUrlfailed validation; warn with a toast and ignore it.Key design decisions:
graphDbUrlandqueryEngine, so a link requesting IAM never silently reuses a plaintext connection to the same endpoint, or vice versa — a mismatch falls through to the create form.graphDbUrlis validated as an http(s) URL with zod; a malformed or non-http link is ignored.document.baseURIrather thanwindow.location.origin, so a link produces a working proxy connection on path-hosted deployments (e.g. a Neptune notebook served at/proxy/9250/explorer/resolves the proxy to/proxy/9250).How to read this
core/urlConnectionParams.ts— the contract core (parse / match / build / resolve) and the four-intent model.core/useUrlConnectionIntent.tsresolves the current route's params against live connection state.routes/Connect/Connect.tsxis the route that acts on the intent and redirects.useActivateConnectionextracted fromConnectionRow, andCreateConnectiongains aninitialValuesprop for prefill.Decision record in
docs/adr/20260612-connection-links.md, named with theYYYYMMDD-slugADR convention introduced separately in #1835.Validation
pnpm checkspasses (lint, format, types).pnpm test/pnpm coveragegreen; the connect feature is covered by unit tests for the contract core, the intent hook, and the route (activate / create / none / invalid).Related Issues
urlin favor of always-relative requests, thedocument.baseURIderivation here becomes unnecessary and links inherit that behavior. The ADR notes this.Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.