Skip to content

fix: EU region frontend authentication#88

Open
is-isaac wants to merge 3 commits into
smartsheet-platform:mainfrom
is-isaac:fix/eu-region-frontend-auth
Open

fix: EU region frontend authentication#88
is-isaac wants to merge 3 commits into
smartsheet-platform:mainfrom
is-isaac:fix/eu-region-frontend-auth

Conversation

@is-isaac

Copy link
Copy Markdown

Summary

  • Adds EU/US region detection for Smartsheet frontend URLs (app.smartsheet.com vs app.smartsheet.eu)
  • URL-based tools now validate that the frontend URL region matches the configured SMARTSHEET_ENDPOINT region before making API calls
  • Returns an actionable error message on region mismatch instead of an opaque authentication failure

Problem

When EU region users pass app.smartsheet.eu URLs to URL-based tools (get_sheet_by_url, search_in_sheet_by_url, what_am_i_assigned_to_by_sheet_url), the tools extract the directIdToken but send it to whichever SMARTSHEET_ENDPOINT is configured. If the endpoint is US but the sheet is EU (or vice versa), authentication fails silently because Smartsheet API keys are region-specific.

The claude_desktop_config-example.json also omitted SMARTSHEET_ENDPOINT entirely, making misconfiguration very likely.

Changes

File Change
src/utils/url-utils.ts NewparseSmartsheetUrl() extracts directIdToken + detects region from hostname; detectApiRegion() determines region from API base URL; validateRegionMatch() returns actionable error on mismatch
src/apis/smartsheet-api.ts Added public readonly region: SmartsheetRegion derived from SMARTSHEET_ENDPOINT
src/tools/smartsheet-sheet-tools.ts get_sheet_by_url uses parseSmartsheetUrl() + validateRegionMatch()
src/tools/smartsheet-search-tools.ts Same fix for search_in_sheet_by_url and what_am_i_assigned_to_by_sheet_url
claude_desktop_config-example.json Added SMARTSHEET_ENDPOINT to env config
.env.example Replaced test endpoint default with production US, added EU endpoint docs

Test plan

  • EU URL + US endpoint → returns: "Region mismatch: the Smartsheet URL points to the EU region, but your SMARTSHEET_ENDPOINT is configured for the US region. Set SMARTSHEET_ENDPOINT to https://api.smartsheet.eu/2.0 and use a EU API token."
  • US URL + US endpoint → passes through normally
  • EU URL + EU endpoint → passes through normally
  • Invalid URL → returns clear format error
  • Build passes cleanly (npm run build)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
URL-based tools (get_sheet_by_url, search_in_sheet_by_url, what_am_i_assigned_to_by_sheet_url) now detect whether the frontend URL points to the EU or US region and validate it against the configured SMARTSHEET_ENDPOINT. A region mismatch returns a clear, actionable error instead of an opaque auth failure.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.

2 participants