Skip to content

Commit eb3e7bb

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oci-compute): register a distinct service with shared OCI credentials
1 parent 3d904cd commit eb3e7bb

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

apps/sim/lib/internal/oci-compute/projection-contract.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { describe, expect, it } from 'vitest'
22
import { projectOciComputeResource } from '@/lib/internal/oci-compute/operations'
3+
import {
4+
credentialProviderMatchesService,
5+
getServiceConfigByProviderId,
6+
getServiceConfigByServiceId,
7+
} from '@/lib/oauth/utils'
38
import {
49
buildSelectorContextFromValues,
510
getSelectorContextSubBlocks,
@@ -8,6 +13,17 @@ import { OciComputeBlock } from '@/blocks/blocks/oci_compute'
813
import { INSTANCE_OUTPUT_PROPERTIES, ociComputeOperationInput } from '@/tools/oci_compute/types'
914

1015
describe('OCI Compute input and resource projections', () => {
16+
it('uses a distinct service identity with the shared OCI signing-key credential provider', () => {
17+
const service = getServiceConfigByServiceId('oci_compute')!
18+
expect(service).toMatchObject({
19+
providerId: 'oci_compute',
20+
serviceAccountProviderId: 'oci-api-key-service-account',
21+
authType: 'service_account',
22+
})
23+
expect(credentialProviderMatchesService('oci-api-key-service-account', service)).toBe(true)
24+
expect(getServiceConfigByProviderId('oci-api-key-service-account')?.providerId).toBe('oci')
25+
})
26+
1127
it('keeps resource discovery in the source compartment without falling back to the destination', () => {
1228
const selector = OciComputeBlock.subBlocks.find((field) => field.id === 'instanceIdSelector')!
1329
const contextFor = (resourceCompartmentId: string | undefined) => {

apps/sim/lib/oauth/oauth.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,16 +1036,6 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
10361036
name: 'Oracle Cloud Infrastructure',
10371037
icon: OracleIcon,
10381038
services: {
1039-
oci_compute: {
1040-
name: 'OCI Compute',
1041-
description: 'Manage OCI Compute instances, images, configurations, and pools.',
1042-
providerId: 'oci',
1043-
serviceAccountProviderId: 'oci-api-key-service-account',
1044-
icon: NetSuiteIcon,
1045-
baseProviderIcon: NetSuiteIcon,
1046-
scopes: [],
1047-
authType: 'service_account',
1048-
},
10491039
oci: {
10501040
name: 'Oracle Cloud Infrastructure',
10511041
description: 'Connect OCI services with an API signing key.',
@@ -1056,6 +1046,16 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
10561046
scopes: [],
10571047
authType: 'service_account',
10581048
},
1049+
oci_compute: {
1050+
name: 'OCI Compute',
1051+
description: 'Manage OCI Compute instances, images, configurations, and pools.',
1052+
providerId: 'oci_compute',
1053+
serviceAccountProviderId: 'oci-api-key-service-account',
1054+
icon: NetSuiteIcon,
1055+
baseProviderIcon: NetSuiteIcon,
1056+
scopes: [],
1057+
authType: 'service_account',
1058+
},
10591059
},
10601060
defaultService: 'oci',
10611061
},

0 commit comments

Comments
 (0)