Skip to content

fix: AWS endpoint scheme/region + default-region selector - #59

Open
fuleinist wants to merge 2 commits into
TabularisDB:mainfrom
fuleinist:fix/aws-endpoint-scheme-region
Open

fix: AWS endpoint scheme/region + default-region selector#59
fuleinist wants to merge 2 commits into
TabularisDB:mainfrom
fuleinist:fix/aws-endpoint-scheme-region

Conversation

@fuleinist

@fuleinist fuleinist commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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 and adds a region selector.

1. Wrong scheme — http://host:443

host + port always became http://host:port. With host=dynamodb.us-west-2.amazonaws.com, port=443 the plugin dialed plain HTTP to a TLS-only port → transport-level dispatch failure.

Fix: HTTPS when port == 443 or host ends with .amazonaws.com.

2. Wrong signing region — hardcoded us-east-1

The generic form has no region field, so the signing region defaulted to us-east-1 regardless of the endpoint. SigV4 signed for the wrong region → AWS rejects every request with InvalidSignatureException.

Fix: parse the region from the endpoint hostname (dynamodb.us-west-2.amazonaws.comus-west-2).

3. Region selector (new)

A per-connection region dropdown in the connection edit page 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. (App-side follow-up: extend the slot context with form state, or add a driver-declared connection-fields mechanism.)

Instead this PR declares a plugin-level "Default AWS region" select in .tabularium (all 34 current regions per the AWS Regions doc). The host renders it under Settings → Plugins → DynamoDB and delivers the saved value via the initialize RPC, which the plugin now stores (previously ignored).

Region resolution order:

  1. explicit region param
  2. region parsed from an AWS endpoint hostname
  3. plugin-level default-region setting
  4. us-east-1

Changes

  • normalized_params: scheme selection + region_from_endpoint helper + settings fallback
  • new settings module: stores initialize settings (process-global)
  • .tabularium: settings array with the region select
  • 8 new regression tests (https rules, region parsing, settings fallback, precedence). Settings tests share a lock — the cell is process-global.

Test plan

  • cargo test — 185 passed (8 new)
  • cargo clippy / cargo fmt — clean
  • Live verification against a real AWS account using exactly what the GUI form sends (host/port/username/password only):
    • test_connection{"success": true} (previously failed)
    • get_tables → 400 tables in ~6.5s with full metadata
    • execute_query → rows + complete pagination object

No credentials, endpoints, or account-specific data included in this change.

Made with Cursor

Chris Chen and others added 2 commits August 3, 2026 16:50
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>
@fuleinist fuleinist changed the title fix: use https and endpoint-derived region for AWS endpoints fix: AWS endpoint scheme/region + default-region selector Aug 3, 2026
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.

1 participant