Repository navigation
feat(credentials): regional and instance hosts for saved LaunchDarkly, LangSmith, New Relic, Square, SendGrid, Hex, and Sentry credentials - #9926
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge, with no new actionable issues found. SummaryAdds saved region, instance, and workspace-host choices across seven credential families.
No new actionable issues were found. The earlier unnumbered test-reset finding is fixed:
|
…nd LaunchDarkly EU and federal instances A token credential's connection field can now declare a fixed option set (rendered as a dropdown) and a default value. The default is what a create that omits the field gets, and what a credential saved before the field existed resolves to, so existing credentials and API callers keep the host they always used. A reconnect that leaves the field blank keeps the stored value instead of falling back to the default. LaunchDarkly is the first provider to use it: the access token is checked at, and every LaunchDarkly tool sends it to, the commercial, EU (app.eu.launchdarkly.com), or federal (app.launchdarkly.us) instance it was created in. Runs without a saved credential keep the commercial host.
A LangSmith API key only authenticates in the region its organization lives in. The saved credential now carries that region (GCP US by default, or GCP EU, GCP APAC, AWS US, or Azure US), and the key check and every LangSmith tool use its documented API host. Credentials saved before, and runs without a saved credential, stay on api.smith.langchain.com.
… legacy block New Relic now documents a Japan region whose NerdGraph endpoint is api.jp.newrelic.com. Saved User API keys can be verified and run there, the tools route jp to it, and the legacy block's region dropdown offers it. The saved key's region field is now a dropdown. Unknown region values still fall back to the US endpoint, as workflows saved before regions expect.
Square credentials and resources of one environment cannot be used in the other. The saved credential now carries its environment (production by default, or sandbox), and the token check, every Square tool, and the catalog image upload operation call connect.squareup.com or connect.squareupsandbox.com accordingly. Credentials saved before, and runs without a saved credential, stay on production.
…the EU host SendGrid serves regional subusers in the EU from api.eu.sendgrid.com. The saved credential now carries its region (global by default, or eu), and the key check, every SendGrid tool, and the mail send operation use that host. Credentials saved before, and runs without a saved credential, stay on api.sendgrid.com. The connect modal notes that Marketing Campaigns actions are not available to EU subusers.
…h host Hex serves EU multi-tenant, HIPAA multi-tenant, and single-tenant workspaces from their own hex.tech host instead of app.hex.tech. The saved credential now carries that host (app.hex.tech by default), accepting only a single label under hex.tech so a token is only ever sent to Hex, and the token check and every Hex tool use it. Credentials saved before, and runs without a saved credential, stay on app.hex.tech.
…n types module-private
…e region Sentry serves organizations whose data is stored in the EU from de.sentry.io, and its organization list is per region. The saved credential now carries its region (us by default, or de), and the token check and every Sentry tool call sentry.io or de.sentry.io accordingly. Credentials saved before, and runs without a saved credential, stay on sentry.io.
…rovider catalog The v2 provider catalog marked a defaulted region, instance, or host field optional without saying what it defaults to. Each field now carries an additive optional defaultValue, and the OpenAPI document and CLI client are regenerated.
…and share region definitions - A credential on its provider's default region or host keeps the bare service display name, and a vendor region host that fails to resolve is reported as the vendor being unavailable, not a typed host that was not found. - defaultValue is honored on the domain field only; providerWorkspaceId keeps its required, non-defaulted handling everywhere, so a blank reconnect can never reset it. - One defineCredentialRegions factory now holds each vendor's region ids, hosts, labels, default, API base, and hidden tool param (LaunchDarkly, LangSmith, New Relic, SendGrid, Sentry, Square); the internal SendGrid and Square schemas validate against it, and the New Relic descriptor and block take their options from it. - One isTokenServiceAccountFieldRequired predicate replaces the inline defaulted-is-optional checks. - Hex refuses its known non-workspace hex.tech labels (status, learn, docs, www, help, community, blog), and the pattern's comment no longer claims more than it guarantees. - Drops a mock-only and two pass-through tests; adds Sentry to the default-region tables.
Fold the named-region reconnect case into the blank-reconnect table as a contrast row on a credential stored in eu, so it fails if a reconnect always keeps the stored region.
waleedlatif1
force-pushed
the
feat/credential-region-hosts
branch
from
November 12, 2026 11:59
84d23f5 to
9efa32f
Compare
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was successfully deployed
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
Several saved-credential validators and their tools were hard-coded to one US or production host. This PR adds an additive region/instance/host field to those credentials. The field defaults to today's host, and the validator and every tool of each provider use it.
domainfield can declareoptions(shown as a dropdown) and adefaultValue. Omitted on create → default. Stored blob without it → default at resolve time. Reconnect with it left blank → the stored value is kept; a reconnect that names a region moves the credential to it.defaultValueis honored ondomainonly.Sentry, notSentry (us)). A vendor region host that fails to resolve is reported as the provider being unavailable, not as a typed host that was not found.defineCredentialRegionsdefinition per vendor (tools/shared/credential-regions.ts) holds the region ids, hosts, dropdown labels, default, API base and hidden tool param. The validator, every tool, the descriptor, and the internal SendGrid/Square operation schemas all read from it.defaultValue(additive optional field; OpenAPI document and CLI client regenerated).app.eu.launchdarkly.com) / Federal (app.launchdarkly.us)api.jp.newrelic.com). The region field is now a select. FedRAMP needs no change: NerdGraph has no FedRAMP-specific host, and an unlisted service's standard endpoint is already the compliant one (https://docs.newrelic.com/docs/security/security-privacy/compliance/fedramp-compliant-endpoints/), so FedRAMP accounts use US.connect.squareupsandbox.com)api.eu.sendgrid.com). Notes that Marketing Campaigns is unavailable to EU subusers.app.hex.tech. Only a single label underhex.techis accepted (EU, HIPAA, single-tenant). Hex's known non-workspace sites (www, docs, learn, status, help, community, blog) are refused, because some of them are served by third parties.sentry.io) / EU (de.sentry.io), per https://docs.sentry.io/api/*.hex.techpattern). An unknown value is refused before the token is sent. The tool params that carry the region are hidden and filled only by the credential.Backward compatibility: no new provider ids and no change to stored secret shapes. Existing credentials and legacy inline-key blocks keep today's hosts, and default-region creates keep today's display names and error codes. During a rolling deploy, an old worker sends a regional credential's token to the vendor's default host. That host belongs to the same vendor, so the call fails or gets proxied but nothing leaks.
Deploy note: during the rollout, an old pod that handles a reconnect or create of a non-default-region credential stores no region. Once the deploy finishes, that credential resolves to the default host. Avoid region changes and reconnects of regional credentials until every pod runs this release.
Not included: self-hosted Sentry (design memo)
Self-hosted Sentry is left out deliberately. It cannot ship cleanly in this PR:
sentry-self-hosted-service-account), not a third option on the us/de select. An old worker ignores a stored host and callssentry.io, so a self-hosted token kept undersentry-service-accountwould be sent to sentry.io during a rolling deploy. A new id makes old workers fail closed.OAuthServiceConfig.serviceAccountProviderIdis documented as the one non-OAuth credential family a service accepts.additionalProviderIdscovers OAuth servers only (Salesforce sandbox). Showing both Sentry ids in the Sentry block's picker means extending that shared contract across the picker, credential listing and executor resolution. The alternative is a separate service or block, which is a product decision. Either way it is its own PR.domain(host plus optional subpath, since self-hosted Sentry can sit under a path prefix) on the new id only, normalized like the Sentry KB connector'snormalizeHostand GitLab'snormalizeGitLabHost. The cloud id keeps its us/de select unchanged.https://<host>/api/0/throughtokenCheckValidator({ egress: 'configuredEndpoint' }), as GitLab's does. The tools would take the host as a hidden, credential-filled param and go out through the executor's existingrequestTargetpath, which GitLab's self-managed tools already use.requestTargethas the same reachability asconfiguredEndpointtoday: public hosts only on hosted, and the operator allowlist off hosted. So no executor change is needed.allowSameOrigin), and send no token on any redirect. Sentry's API docs (https://docs.sentry.io/api/) document onlysentry.io,us.sentry.ioandde.sentry.io, so self-hosted behavior needs a live proof against a real install before it ships.Type of Change
Testing
saved-credential-regions.test.ts: for every tool of each family, a saved regional credential goes to its host, a run without a credential stays on the default host, and an unknown region is refused.service-account-secret.test.ts: each credential check hits the right URL and stores the region. Unlisted hosts (including Hex's third-party-served labels) are refused without a fetch. Default-region credentials keep the bare display name. Vendor region DNS failures are provider_unavailable, while a typed Hex host gives site_not_found.provider-catalog-contract.test.ts: a defaulted field reportsdefaultValueand the response still matches the strict v2 schema.service-account-secret.ts,credential-service.ts,orchestration/index.ts, andvalidators/http.ts.Checklist