fix: AWS endpoint scheme/region + default-region selector - #59
Merged
fuleinist merged 3 commits intoAug 6, 2026
Merged
Conversation
Connecting to a real AWS DynamoDB endpoint via the generic GUI form (host/port/username/password) failed two ways in normalized_params: 1. Scheme: host+port always became http://host:port, so port 443 produced http://dynamodb.us-west-2.amazonaws.com:443 — plain HTTP to a TLS-only port, failing at the transport level. HTTPS is now used when the port is 443 or the host ends with .amazonaws.com. 2. Region: with no region field in the form, the signing region defaulted to us-east-1 regardless of the endpoint, so AWS rejected every request with InvalidSignatureException. The region is now parsed from the endpoint hostname (dynamodb.<region>.amazonaws.com), falling back to us-east-1 only for non-AWS endpoints (e.g. DynamoDB Local). Verified live against a real AWS account: test_connection succeeds and get_tables returns 400 tables in ~6.5s using only the generic form fields. Co-authored-by: Cursor <cursoragent@cursor.com>
The generic GUI connection form has no region field, and a per-connection
region selector is not possible from a driver plugin today: the
connection-modal.connection_content slot only receives {driver, database,
onDatabaseChange, connectionName} and only renders for
no_connection_required drivers.
Instead declare a plugin-level "Default AWS region" select setting in
.tabularium (all 34 current AWS regions per the AWS Regions docs). The
host renders it under Settings -> Plugins -> DynamoDB and delivers the
saved value via the initialize RPC, which the plugin now stores.
Region resolution order in normalized_params:
1. explicit `region` param
2. region parsed from an AWS endpoint hostname
3. plugin-level default-region setting
4. us-east-1
The settings cell is process-global; tests share a lock to avoid races.
Co-authored-by: Cursor <cursoragent@cursor.com>
6 tasks
The host (TabularisDB/tabularis#593) is moving to an opaque extra: HashMap<String, String> on ConnectionParams instead of driver-specific core fields. Parse it here and use extra["region"] as the per-connection signing region when no explicit region param is present. Region precedence: explicit region param > extra["region"] > region parsed from an AWS endpoint hostname > plugin-level default-region setting > us-east-1. Profile connections remain exempt (they inherit their region from ~/.aws/config).
Collaborator
Author
|
Pushed 8ca5654 addressing the core-app review feedback from tabularis#593: the plugin now consumes the opaque |
debba
pushed a commit
to TabularisDB/tabularis
that referenced
this pull request
Aug 4, 2026
…Params (#596) * feat(connections): opaque plugin-specific extra fields for ConnectionParams Adds a generic mechanism for plugins to carry custom connection settings (e.g. an AWS region for DynamoDB) without core schema changes. - ConnectionParams gains `extra: HashMap<String, String>` (Rust) and `extra?: Record<string, string>` (TS). Opaque to the host: persisted verbatim, forwarded to driver plugins, absent from JSON when empty. - New plugin slot `connection-modal.extra_fields` rendered below the host/port section; context exposes `driver`, `extra`, and `setExtraField(key, value)` so plugin UI can edit the map. - Pure `updateExtraField` helper in src/utils/connections.ts with unit tests (8 cases: set, merge, immutability, clear-on-empty, blank-key handling). - Host API version 0.1.0 -> 0.2.0 (HOST_API_VERSION, plugin-api API_VERSION + package.json) since the slot map is observable to plugin bundles. - PLUGIN_GUIDE slot table documents the new slot. Follow-up to TabularisDB/tabularis-dynamodb-plugin#59. * version Co-authored-by: Chris Chen <1163738+fuleinist@users.noreply.github.com> --------- Co-authored-by: fuleinist <fuleinist@users.noreply.github.com>
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
Connecting to a real AWS DynamoDB endpoint via the generic GUI connection form (host / port / username / password) was broken in
normalized_params— only DynamoDB Local worked. This PR fixes the transport/signing bugs, adds a plugin-level default-region setting, and teaches the plugin to consume the host's opaque connectionextrafields.1. Wrong scheme —
http://host:443host+portalways becamehttp://host:port. Withhost=dynamodb.us-west-2.amazonaws.com,port=443the plugin dialed plain HTTP to a TLS-only port → transport-level dispatch failure.Fix: HTTPS when
port == 443or host ends with.amazonaws.com.2. Wrong signing region — hardcoded
us-east-1The generic form has no region field, so the signing region defaulted to
us-east-1regardless of the endpoint. SigV4 signed for the wrong region → AWS rejects every request withInvalidSignatureException.Fix: parse the region from the endpoint hostname (
dynamodb.us-west-2.amazonaws.com→us-west-2), among the resolution chain below.3. Default-region setting (plugin settings page)
Declares a plugin-level "Default AWS region" select in
.tabularium(all 34 current regions per the AWS Regions doc). Host renders it under Settings → Plugins → DynamoDB and delivers viainitializeRPC.4. Opaque
extraconnection fieldsConnectionParamsnow parses the opaqueextra: HashMap<String, String>map the host persists and forwards to drivers unchanged (non-string values are dropped).extra["region"]acts as the per-connection signing region — this is where the connection-form region selector will land once the core slot work ships, so no core change is needed for the plugin to honour it.Region resolution order:
regionparamextra["region"](opaque per-connection field)us-east-1Profile connections stay exempt — they inherit their region from the AWS profile's own config.
Test plan
cargo test— 192 passedcargo clippy/cargo fmt— cleanMade with Cursor
Made with Cursor