Skip to content

feat(oci): add native foundation - #7444

Open
BillLeoutsakosvl346 wants to merge 14 commits into
stagingfrom
feat/oci-foundation
Open

feat(oci): add native foundation#7444
BillLeoutsakosvl346 wants to merge 14 commits into
stagingfrom
feat/oci-foundation

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • Add a server-only OCI API-key credential foundation with strict validation, in-memory request signing, safe endpoint resolution, bounded transport, and sanitized errors.
  • Snapshot the OCI region/realm registry while deferring Queue, public credential plumbing, UI, catalog, icons, docs, and generated API changes.
  • Pin oci-common 2.140.0, the newest release allowed by the repository dependency-age gate; its region/realm registry is byte-identical to 2.140.1.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other

Testing

  • Node 22 focused Vitest suite: 65 tests passed
  • Bun 1.3.14 focused Vitest suite: 65 tests passed
  • Workspace type-check and production Sim build
  • Lint, block-registry checks, all 45 repository audits, and docs-manifest check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not applicable; this change is server-only.

@BillLeoutsakosvl346
BillLeoutsakosvl346 requested a review from a team as a code owner September 3, 2026 20:25
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 4, 2026 4:49pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR establishes native server-side OCI API-key credentials, including validation, request signing, endpoint resolution, encrypted persistence, credential rotation, API contracts, catalog metadata, and client setup.

  • Adds OCI region and realm resolution with bounded, cancellation-aware provider verification.
  • Adds OCI credential creation and rotation across internal and v2 APIs.
  • Extends the provider catalog, setup modal, CLI schema, generated API, documentation, and focused tests.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/credentials/oci-api-key-service-account.server.ts Adds strict OCI credential normalization, RSA and fingerprint verification, sanitized provider-error mapping, and encryption after successful verification.
apps/sim/lib/internal/oci/client.server.ts Adds OCI request signing and bounded transport with cancellation, retry, redirect, and response-size controls.
apps/sim/lib/internal/oci/endpoints.ts Adds a snapshot-backed OCI region and realm registry with constrained service endpoint construction.
apps/sim/lib/credentials/service-account-secret.ts Integrates OCI API-key material into the shared server-side service-account verification and secret-building boundary.
apps/sim/lib/credentials/orchestration/index.ts Adds complete-tuple OCI credential rotation while preserving the old secret when verification fails.
apps/sim/lib/api/contracts/v2/credentials.ts Extends v2 credential create and update contracts with bounded OCI fields and write-only secret annotations.
apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/connect-service-account-modal.tsx Adds the OCI API-key setup and reconnect form using the existing credential mutation hooks.
apps/sim/lib/credentials/application/provider-catalog.ts Publishes OCI credential field metadata while retaining independent provider-availability gating.
packages/sim-cli/src/generated/v2-api.ts Extends the generated CLI update operation with the OCI credential fields.

Sequence Diagram

sequenceDiagram
  participant User
  participant API as Credential API
  participant Service as OCI Credential Service
  participant OCI as OCI Object Storage
  participant Store as Encrypted Credential Store
  User->>API: Submit OCI signing tuple
  API->>Service: Validate and normalize fields
  Service->>Service: Parse RSA key and verify fingerprint
  Service->>OCI: Signed GetNamespace request
  OCI-->>Service: Valid namespace response
  Service->>Store: Encrypt and persist credential
  Store-->>API: Credential metadata
  API-->>User: Sanitized credential response
Loading

Reviews (11): Last reviewed commit: "fix(oci): preserve endpoint and failure ..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/internal/oci/endpoints.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/endpoints.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review this PR

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review this PR

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review this PR

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/internal/oci/client.server.ts
Comment thread apps/sim/lib/internal/oci/errors.ts Outdated
Comment thread apps/sim/lib/internal/oci/client.server.ts Outdated
Comment thread apps/sim/lib/internal/oci/client.server.test.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review this PR

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@gitguardian

gitguardian Bot commented Sep 4, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
36895932 Triggered Generic Private Key 1335344 apps/sim/lib/internal/oci/client.server.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

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.

Re-trigger cubic

Comment thread apps/sim/lib/internal/oci/client.server.ts
Comment thread apps/sim/lib/credentials/service-account-secret.ts Outdated
Comment thread apps/sim/lib/credentials/service-account-secret.ts Outdated
Comment thread apps/sim/lib/internal/oci/client.server.ts
Comment thread apps/sim/app/api/v2/credentials/[credentialId]/route.test.ts Outdated
Comment thread apps/sim/lib/internal/oci/client.server.test.ts Outdated
@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 42 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.

Re-trigger cubic

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 38 files

Confidence score: 2/5

  • apps/sim/lib/oauth/token-resolution.ts still refreshes and returns an OAuth token when the tool requires a service-account credential, weakening credential-kind enforcement; reject mismatched credentials before entering the OAuth refresh branch.
  • apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/connect-service-account-modal.tsx leaves OCI private keys fully visible after focus is lost, exposing secret material on screen; use a masked multiline secret control.
  • apps/sim/lib/oauth/token-resolution.ts returns OCI_CREDENTIAL_TOOL_UNSUPPORTED before input.authenticate() and authorizeCredentialUseForAuth() for service-account IDs paired with non-OCI or unknown tools, bypassing the intended authentication and authorization flow; reorder the validation so those checks run first.
  • apps/sim/components/icons.tsx aliases OracleIcon to NetSuiteIcon, causing OCI integrations to display the wrong provider branding; add a dedicated Oracle/OCI SVG.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/components/icons.tsx">

<violation number="1" location="apps/sim/components/icons.tsx:9336">
P2: The OCI provider now displays the NetSuite logo because `OracleIcon` is an alias of `NetSuiteIcon`. Add a dedicated Oracle/OCI SVG instead, so the new OCI integration is not branded as NetSuite.</violation>
</file>

<file name="apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/connect-service-account-modal.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/connect-service-account-modal.tsx:387">
P2: The OCI private key remains fully visible in the modal after the field loses focus, even though the provider catalog marks it as secret. Use a masked multiline secret control so the key is not left exposed on screen while preserving PEM paste/editing.</violation>
</file>

<file name="apps/sim/lib/oauth/token-resolution.ts">

<violation number="1" location="apps/sim/lib/oauth/token-resolution.ts:377">
P2: When an OCI tool declares `credentialKind: 'service-account'` but the caller supplies an OAuth credential, this expectation is passed through and the OAuth branch still refreshes and returns the token. Reject the credential-kind mismatch after authorization instead of allowing an OAuth credential for a service-account-only tool.</violation>

<violation number="2" location="apps/sim/lib/oauth/token-resolution.ts:382">
P2: When a caller supplies an OCI service-account ID with a non-OCI or unknown `toolId`, this branch returns `OCI_CREDENTIAL_TOOL_UNSUPPORTED` before `input.authenticate()` and `authorizeCredentialUseForAuth()` run, exposing provider-mismatch details to unauthenticated callers. Authenticate and authorize first, then apply this mismatch response only for an authorized caller.

(Based on your team's feedback about authorization before mismatch details.)</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.

Fix all with cubic | Re-trigger cubic

)
}

export const OracleIcon = NetSuiteIcon

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The OCI provider now displays the NetSuite logo because OracleIcon is an alias of NetSuiteIcon. Add a dedicated Oracle/OCI SVG instead, so the new OCI integration is not branded as NetSuite.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/components/icons.tsx, line 9336:

<comment>The OCI provider now displays the NetSuite logo because `OracleIcon` is an alias of `NetSuiteIcon`. Add a dedicated Oracle/OCI SVG instead, so the new OCI integration is not branded as NetSuite.</comment>

<file context>
@@ -9333,6 +9333,8 @@ export function NetSuiteIcon(props: SVGProps<SVGSVGElement>) {
   )
 }
 
+export const OracleIcon = NetSuiteIcon
+
 export function WizaIcon(props: SVGProps<SVGSVGElement>) {
</file context>
Fix with cubic

required
/>
<ChipModalField
type='textarea'

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The OCI private key remains fully visible in the modal after the field loses focus, even though the provider catalog marks it as secret. Use a masked multiline secret control so the key is not left exposed on screen while preserving PEM paste/editing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/connect-service-account-modal.tsx, line 387:

<comment>The OCI private key remains fully visible in the modal after the field loses focus, even though the provider catalog marks it as secret. Use a masked multiline secret control so the key is not left exposed on screen while preserving PEM paste/editing.</comment>

<file context>
@@ -241,6 +263,196 @@ interface ProviderModalProps {
+          required
+        />
+        <ChipModalField
+          type='textarea'
+          title='Private key'
+          value={privateKey}
</file context>
Fix with cubic

: undefined

if (
resolved?.credentialType === 'service_account' &&

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When a caller supplies an OCI service-account ID with a non-OCI or unknown toolId, this branch returns OCI_CREDENTIAL_TOOL_UNSUPPORTED before input.authenticate() and authorizeCredentialUseForAuth() run, exposing provider-mismatch details to unauthenticated callers. Authenticate and authorize first, then apply this mismatch response only for an authorized caller.

(Based on your team's feedback about authorization before mismatch details.)

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/oauth/token-resolution.ts, line 382:

<comment>When a caller supplies an OCI service-account ID with a non-OCI or unknown `toolId`, this branch returns `OCI_CREDENTIAL_TOOL_UNSUPPORTED` before `input.authenticate()` and `authorizeCredentialUseForAuth()` run, exposing provider-mismatch details to unauthenticated callers. Authenticate and authorize first, then apply this mismatch response only for an authorized caller.

(Based on your team's feedback about authorization before mismatch details.) </comment>

<file context>
@@ -346,6 +367,34 @@ export async function resolveCredentialAccessToken(
+      : undefined
+
+    if (
+      resolved?.credentialType === 'service_account' &&
+      resolved.providerId === OCI_API_KEY_SERVICE_ACCOUNT_PROVIDER_ID &&
+      !isOciServiceAccountTool
</file context>
Fix with cubic

toolMetadata?.oauth?.required === true &&
toolMetadata.oauth.credentialKind === 'service-account' &&
service?.serviceAccountProviderId === OCI_API_KEY_SERVICE_ACCOUNT_PROVIDER_ID
const expectedServiceAccountProviderId = isOciServiceAccountTool

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When an OCI tool declares credentialKind: 'service-account' but the caller supplies an OAuth credential, this expectation is passed through and the OAuth branch still refreshes and returns the token. Reject the credential-kind mismatch after authorization instead of allowing an OAuth credential for a service-account-only tool.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/oauth/token-resolution.ts, line 377:

<comment>When an OCI tool declares `credentialKind: 'service-account'` but the caller supplies an OAuth credential, this expectation is passed through and the OAuth branch still refreshes and returns the token. Reject the credential-kind mismatch after authorization instead of allowing an OAuth credential for a service-account-only tool.</comment>

<file context>
@@ -346,6 +367,34 @@ export async function resolveCredentialAccessToken(
+      toolMetadata?.oauth?.required === true &&
+      toolMetadata.oauth.credentialKind === 'service-account' &&
+      service?.serviceAccountProviderId === OCI_API_KEY_SERVICE_ACCOUNT_PROVIDER_ID
+    const expectedServiceAccountProviderId = isOciServiceAccountTool
+      ? OCI_API_KEY_SERVICE_ACCOUNT_PROVIDER_ID
+      : undefined
</file context>
Fix with cubic

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 38 files

Confidence score: 3/5

  • In apps/sim/lib/internal/oci/endpoints.ts, Identity requests can resolve to a nonexistent or incorrect host because regionalOciHostname omits OCI’s required .oci component; add a service-specific Identity endpoint template.
  • In apps/sim/lib/credentials/service-account-secret.ts, semantically invalid OCI fields can throw a plain Error before OciCredentialVerificationError is produced, causing create and reconnect flows to bypass expected verification handling; validate or normalize the error path before buildSecret throws.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/internal/oci/endpoints.ts">

<violation number="1" location="apps/sim/lib/internal/oci/endpoints.ts:268">
P2: When `serviceName` is `identity`, `regionalOciHostname` omits OCI's required `.oci` host component, so Identity requests target a nonexistent or incorrect endpoint. Add a service-specific endpoint template for Identity instead of applying the generic hostname format to every service.</violation>
</file>

<file name="apps/sim/lib/credentials/service-account-secret.ts">

<violation number="1" location="apps/sim/lib/credentials/service-account-secret.ts:243">
P2: When a syntactically valid but semantically invalid OCI field is submitted, `buildSecret` throws a plain `Error` before this call can produce `OciCredentialVerificationError`. The create and reconnect paths then bypass `ServiceAccountSecretError` handling and return a generic 500 instead of a validation response; classify verifier input-validation failures as `invalid_credentials` without catching encryption failures.</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.

Fix all with cubic | Re-trigger cubic


export function regionalOciHostname(serviceName: string, region: OciRegion): string {
assertServiceName(serviceName)
return `${serviceName}.${region.id}.${region.realm.domain}`

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When serviceName is identity, regionalOciHostname omits OCI's required .oci host component, so Identity requests target a nonexistent or incorrect endpoint. Add a service-specific endpoint template for Identity instead of applying the generic hostname format to every service.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/internal/oci/endpoints.ts, line 268:

<comment>When `serviceName` is `identity`, `regionalOciHostname` omits OCI's required `.oci` host component, so Identity requests target a nonexistent or incorrect endpoint. Add a service-specific endpoint template for Identity instead of applying the generic hostname format to every service.</comment>

<file context>
@@ -0,0 +1,351 @@
+
+export function regionalOciHostname(serviceName: string, region: OciRegion): string {
+  assertServiceName(serviceName)
+  return `${serviceName}.${region.id}.${region.realm.domain}`
+}
+
</file context>
Fix with cubic

)
}
try {
const result = await verifyAndEncryptOciApiKeyCredential({

@cubic-dev-ai cubic-dev-ai Bot Sep 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When a syntactically valid but semantically invalid OCI field is submitted, buildSecret throws a plain Error before this call can produce OciCredentialVerificationError. The create and reconnect paths then bypass ServiceAccountSecretError handling and return a generic 500 instead of a validation response; classify verifier input-validation failures as invalid_credentials without catching encryption failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/credentials/service-account-secret.ts, line 243:

<comment>When a syntactically valid but semantically invalid OCI field is submitted, `buildSecret` throws a plain `Error` before this call can produce `OciCredentialVerificationError`. The create and reconnect paths then bypass `ServiceAccountSecretError` handling and return a generic 500 instead of a validation response; classify verifier input-validation failures as `invalid_credentials` without catching encryption failures.</comment>

<file context>
@@ -217,6 +230,48 @@ async function buildGoogleServiceAccountSecret(
+    )
+  }
+  try {
+    const result = await verifyAndEncryptOciApiKeyCredential({
+      tenancyOcid,
+      userOcid,
</file context>
Fix with cubic

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