Repository navigation
feat(credentials): second auth modes for ServiceNow, Snowflake, Infisical, and Google Ads - #9928
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryAdds more saved-credential sign-in options:
The three supplied, unnumbered previous threads are addressed: Snowflake reconnects no longer guess an unknown mode, grant tests use the shared response helper, and internal uploads expire rejected coordinated tokens. Review used source checks. Tests and visual capture were not run; dependencies are not installed.
|
c0c4650 to
e3e7242
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 57 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
e3e7242 to
d0abd40
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 57 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
d0abd40 to
17775e5
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
17775e5 to
5f723df
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 57 files
Confidence score: 3/5
- In
apps/sim/tools/index.ts, invalidation uses the default digest tag, so credentials configured with a custom tag may remain valid on other workers after a 401. Pass the credential’s digest tag through the invalidation call. - In
apps/sim/tools/index.ts, internal 403s can invalidate the coordinated provider token even when they’re just local permission denials. Restrict invalidation to actual provider-auth failures.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/tools/index.ts">
<violation number="1" location="apps/sim/tools/index.ts:2984">
P2: This invalidates the coordinated provider token for every internal 403, including Sim's own file-access or per-record permission refusals. After the token is older than one minute, an unrelated local denial forces all workers to mint a replacement and can repeatedly hammer the token endpoint; only invalidate the coordinated cache after confirming that the response came from the provider.</violation>
<violation number="2" location="apps/sim/tools/index.ts:3102">
P2: This invalidation uses the default token digest tag, so coordinated credentials that resolve with a custom tag, such as Vanta, are not expired across workers after a 401. Pass the credential’s digest tag through the refusal path or use a provider-specific invalidation callback so other workers cannot keep serving the rejected token.</violation>
</file>
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Google Ads now offers the google-service-account credential: a service account added as a user of the Ads account signs in as itself with the adwords scope (developer tokens were retired). Keyless Google credentials stay refused because Google documents no Workload Identity path for Ads.
Infisical credentials gain a Universal Auth mode: the machine identity's client ID and secret are stored instead of a pasted access token, and Sim logs in at the credential's instance through the configured-endpoint egress guard whenever its token expires. One coordinated token serves every credential for an identity, so logins don't multiply per worker. Pasted access-token credentials are unchanged. Adds postToConfiguredTokenEndpoint, the guarded token request for hosts taken from a validated credential field.
ServiceNow credentials gain an OAuth client credentials mode beside the username and password login. The client ID and secret are stored, and Sim mints a token at the instance's /oauth_token.do through the configured-endpoint egress guard, shared across workers. The minted token resolves with authStyle 'bearer', which the ServiceNow tools and the attachment upload operation send as a bearer token. Saved logins store and resolve exactly as before. Shared changes, each additive: exchangeClientCredentialsGrant takes an egress option for configured hosts; a tool policy can name mapped params a credential mode lacks (optionalCredentialParams), which are cleared rather than failing; a token descriptor field can belong to the pasted-token mode only; a token check's account id may be absent for a sign-in mode.
Snowflake connections gain a key-pair mode beside keyless workload identity and programmatic access tokens. Sim stores the user's unencrypted RSA private key and signs a JWT for every run (iss ACCOUNT.USER.SHA256:<fp>, sub ACCOUNT.USER, uppercased, 59-minute lifetime) that tools and selectors send with the KEYPAIR_JWT token type. The account comes from the host the way Snowflake's drivers derive it. Key pairs need no workload identity, so organization connections and deployments without a signing key can use them; the connect dialog now always offers them. Token and keyless credentials store and resolve exactly as before. Host hints now name .snowflakecomputing.cn, which the validator, tools, and selectors already accept.
serviceNowAuthorization is now the only caller, so the export was unused.
…s hostnames Snowflake also serves an account whose name has underscores at a hostname with hyphens in their place. Organization names hold only letters and numbers and account names never hold a hyphen, so every hyphen after the first in an org-account host label is a replaced underscore and is restored before the key-pair JWT names the account. The derivation moves next to normalizeSnowflakeHost and its suffix list. The connection secret type is renamed for the three modes, and the modal shares one saved- connection submit hook.
…ical login readAccessTokenResponse holds the refusal classification, capped JSON read, token and lifetime checks, and lifetime cap that exchangeClientCredentialsGrant and the Infisical Universal Auth login both need. An Infisical expiresIn of 0 (an access token TTL of 0) is served for the daily cap instead of failing as an outage. egress and fetchOptions become a discriminated union, and the configured-endpoint guard's own cases are tested where it lives.
The hidden credential params become a constant like Zendesk's, the upload schema accepts only the bearer authStyle, and serviceNowAuthorization takes an optional username so the upload client no longer fakes one. A pasted-token-only descriptor field stays hidden until that mode is chosen and is never required in client-credentials mode.
…o the catalog scopes it to the password sign-in
…n organization reconnect's mode unchosen Key-pair validation now sends its signed JWT through the same guarded egress path as keyless, so an account host that resolves to a private address is refused as host_not_allowed. An organization credential's stored mode is not reported, so its reconnect starts with no mode chosen instead of defaulting to a programmatic access token. The Infisical and ServiceNow grant tests use the shared jsonResponse helper.
… the key-pair header test The key-pair private key textarea hides its value off focus, matching the Google JSON key field, and the new getSnowflakeHeaders case passes the oauthCredential its params type requires.
…nd state the key-size ceiling
5f723df to
80980da
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 57 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Summary
Adds a second (or third) sign-in mode to integrations that already support saved credentials. Each one is a new
authMethodor stored blob type, and every existing stored shape resolves exactly as before.{instance}/oauth_token.dothrough the configured-endpoint egress guard and shares one coordinated token per client. Tools and attachment upload send it as a Bearer token. Saved username/password logins are unchanged (Basic).issisACCOUNT.USER.SHA256:<fp>,subisACCOUNT.USER, both uppercased, valid 59 minutes, sent withX-Snowflake-Authorization-Token-Type: KEYPAIR_JWT. The account comes from the host's first label. An account whose name has underscores signs as that name from either of its hostnames (myorg-my_accountormyorg-my-account): organization names hold only letters and numbers and account names never hold a hyphen, so every hyphen after the first is a replaced underscore. It needs no workload identity, so organization credentials and deployments without a signing key can use it. The credential provider catalog (v2, Copilot, CLI) lists a Snowflake "Connection configuration" field that documents the key pair in every scope; the keyless hint is appended only where keyless is available. Host hints now name.snowflakecomputing.cn, which was already accepted.{instance}/api/v1/auth/universal-auth/loginthrough the newpostToConfiguredTokenEndpointguard. This replaces pasted access tokens that expire. One coordinated token per identity, served for at most a day. AnexpiresInof 0 (an access token TTL of 0) is also served for a day. Revoked tokens and tokens past their use limit are answered with 401 by Infisical, so the existing 401 invalidation logs in again on the next call.google-service-accountJSON key (adwords scope; the service account is added as a user in Ads). Keyless Google credentials are still refused for Ads.exchangeClientCredentialsGranttakes anegress: 'configuredEndpoint'option. The request type is a discriminated union, sofetchOptionscan't be combined with it.readAccessTokenResponseholds the refusal classification, capped JSON read, token and lifetime checks, and lifetime cap. The grant and the Infisical login both use it.OAuthConfig.optionalCredentialParamslets a tool policy name a mapped param that a credential mode lacks; it is cleared instead of failing.requiredForAuthMethods(tokenorclient_credentials), the same vocabulary client-credential descriptors and the v2 catalog already use. ServiceNow's username is['token']: it shows only in the pasted-token mode, is never required or stored in client-credentials mode, and the catalog says so.authStylegainsbearerandsnowflake-key-pair; both are authoritative, so caller or model values are stripped.Vendor references: ServiceNow client credentials and grant workflow; Snowflake SQL API authentication and account identifiers; Infisical Universal Auth login, attach (TTL ranges) and Universal Auth; Google Ads service accounts and developer token sunset.
Not included: Infisical OIDC keyless. Infisical matches subjects as glob patterns, so Sim cannot pin a credential's subject, and this needs a security decision and a live proof first.
Product update (if relevant)
Type of Change
Testing
expiresIn0), refused and invalid responses, unsafe instance URLs, missing secrets (no request sent), and abort. The configured-endpoint guard's own cases (egress refused, unresolvable or transiently failing host, abort) are tested inclient-credentials-grant.test.ts.requiredForAuthMethods: ['token'].authStylevalues.authStylecannot be set by an inline caller.Checklist
Screenshots/Videos
Connect dialogs: ServiceNow and Infisical gain an auth method picker; Snowflake gains a "Key pair (RSA private key)" option.