Skip to content

Commit 04be977

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
refactor(integrations): align Oracle HCM auth metadata
1 parent 1c2968f commit 04be977

14 files changed

Lines changed: 20 additions & 60 deletions

File tree

apps/docs/openapi-v2-resources.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8254,7 +8254,7 @@
82548254
"description": "Where the block comes from: `builtin` is the shipped registry, `custom` is a workflow this workspace deployed as a block."
82558255
},
82568256
"authMode": {
8257-
"description": "How the block authenticates: `oauth`, `api_key`, `bot_token`, or `basic`.",
8257+
"description": "How the block authenticates: `oauth`, `api_key`, or `bot_token`.",
82588258
"type": "string"
82598259
},
82608260
"triggerAllowed": {
@@ -8942,7 +8942,7 @@
89428942
"description": "Where the block comes from: `builtin` is the shipped registry, `custom` is a workflow this workspace deployed as a block."
89438943
},
89448944
"authMode": {
8945-
"description": "How the block authenticates: `oauth`, `api_key`, `bot_token`, or `basic`.",
8945+
"description": "How the block authenticates: `oauth`, `api_key`, or `bot_token`.",
89468946
"type": "string"
89478947
},
89488948
"triggerAllowed": {

apps/sim/app/(landing)/integrations/(shell)/[slug]/page.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ const AUTH_STEP: Record<AuthType, (name: string) => string> = {
110110
`Connect your ${name} account with one-click OAuth, with no credentials to copy.`,
111111
'api-key': (name) =>
112112
`Paste your ${name} API key to authenticate. You can find it in your ${name} account settings.`,
113-
basic: (name) =>
114-
`Enter the username and password for your ${name} account to authenticate with HTTP Basic authentication.`,
115113
none: () => 'No authentication is needed, so the block works as soon as you drop it in.',
116114
}
117115

@@ -505,9 +503,7 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
505503
? `${name} connects with one-click OAuth.`
506504
: authType === 'api-key'
507505
? `${name} connects with an API key.`
508-
: authType === 'basic'
509-
? `${name} connects with HTTP Basic authentication.`
510-
: `${name} requires no authentication.`}{' '}
506+
: `${name} requires no authentication.`}{' '}
511507
Free to start at sim.ai.
512508
</p>
513509

@@ -662,9 +658,7 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
662658
? `Open your workspace, drag ${articleFor(name)} ${name} block onto the workflow builder, and connect your account with one-click OAuth.`
663659
: authType === 'api-key'
664660
? `Open your workspace, drag ${articleFor(name)} ${name} block onto the workflow builder, and paste in your ${name} API key.`
665-
: authType === 'basic'
666-
? `Open your workspace, drag ${articleFor(name)} ${name} block onto the workflow builder, and enter the connection details, username, and password requested by the block.`
667-
: `Open your workspace, drag ${articleFor(name)} ${name} block onto the workflow builder. No authentication is needed.`,
661+
: `Open your workspace, drag ${articleFor(name)} ${name} block onto the workflow builder. No authentication is needed.`,
668662
},
669663
{
670664
step: '03',

apps/sim/blocks/blocks.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,7 @@ describe.concurrent('Blocks Module', () => {
653653

654654
describe('AuthMode Validation', () => {
655655
it('should have valid authMode when defined', () => {
656-
const validAuthModes = [
657-
AuthMode.OAuth,
658-
AuthMode.ApiKey,
659-
AuthMode.BotToken,
660-
AuthMode.Basic,
661-
undefined,
662-
]
656+
const validAuthModes = [AuthMode.OAuth, AuthMode.ApiKey, AuthMode.BotToken, undefined]
663657
const blocks = getAllBlocks()
664658
for (const block of blocks) {
665659
expect(validAuthModes).toContain(block.authMode)

apps/sim/blocks/blocks/oracle_fusion_hcm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const OracleFusionHcmBlock: BlockConfig = {
6666
docsLink: 'https://docs.sim.ai/integrations/oracle_fusion_hcm',
6767
category: 'tools',
6868
integrationType: IntegrationType.HR,
69-
authMode: AuthMode.Basic,
69+
authMode: AuthMode.ApiKey,
7070
bgColor: '#F80000',
7171
icon: NetSuiteIcon,
7272
canvasPresentation: {

apps/sim/blocks/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export enum AuthMode {
174174
OAuth = 'oauth',
175175
ApiKey = 'api_key',
176176
BotToken = 'bot_token',
177-
Basic = 'basic',
178177
}
179178

180179
export type GenerationType =

apps/sim/lib/api/contracts/v2/catalog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export const v2BlockSummarySchema = z
226226
authMode: z
227227
.string()
228228
.optional()
229-
.describe('How the block authenticates: `oauth`, `api_key`, `bot_token`, or `basic`.'),
229+
.describe('How the block authenticates: `oauth`, `api_key`, or `bot_token`.'),
230230
triggerAllowed: z.boolean().describe('Whether the block declares itself usable as a trigger.'),
231231
triggerCapable: z
232232
.boolean()

apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-tool.test.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { computeBlockLevelInputs } from '@/lib/catalog/projection/block-detail'
2121
import { getBlocksMetadataServerTool } from '@/lib/copilot/tools/server/blocks/get-blocks-metadata-tool'
2222
import { MothershipBlock } from '@/blocks/blocks/mothership'
2323
import { getBlock } from '@/blocks/registry'
24-
import { AuthMode, type BlockConfig } from '@/blocks/types'
24+
import type { BlockConfig } from '@/blocks/types'
2525

2626
describe('get blocks metadata', () => {
2727
beforeEach(() => {
@@ -37,30 +37,6 @@ describe('get blocks metadata', () => {
3737
expect(definitions).not.toHaveProperty('mountedSecrets')
3838
})
3939

40-
it('reports Basic authentication for Oracle Fusion HCM metadata', async () => {
41-
mockGetUserPermissionConfig.mockResolvedValue({ allowedIntegrations: null })
42-
vi.mocked(getBlock).mockReturnValue({
43-
type: 'oracle_fusion_hcm',
44-
name: 'Oracle Fusion Cloud HCM',
45-
description: 'Read Oracle HCM data.',
46-
category: 'tools',
47-
bgColor: '#F80000',
48-
icon: () => null,
49-
authMode: AuthMode.Basic,
50-
subBlocks: [],
51-
tools: { access: [] },
52-
inputs: {},
53-
outputs: {},
54-
} as unknown as BlockConfig)
55-
56-
const result = await getBlocksMetadataServerTool.execute(
57-
{ blockIds: ['oracle_fusion_hcm'] },
58-
{ userId: 'user-1', workspaceId: 'workspace-1' }
59-
)
60-
61-
expect(result.metadata.oracle_fusion_hcm).toMatchObject({ authType: 'Basic' })
62-
})
63-
6440
/**
6541
* A sub-block `condition` declared as a function is invoked during projection.
6642
* A throwing one is an authoring defect worth surfacing, but it must cost the

apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-tool.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ interface CopilotBlockMetadata {
6666
inputSchema: CopilotSubblockMetadata[]
6767
inputDefinitions?: Record<string, any>
6868
triggerAllowed?: boolean
69-
authType?: 'OAuth' | 'API Key' | 'Bot Token' | 'Basic'
69+
authType?: 'OAuth' | 'API Key' | 'Bot Token'
7070
tools: CopilotToolMetadata[]
7171
triggers: CopilotTriggerMetadata[]
7272
operationInputSchema: Record<string, CopilotSubblockMetadata[]>
@@ -626,12 +626,11 @@ function generateInputExample(schema: CopilotSubblockMetadata, inputDef?: any):
626626
}
627627
function resolveAuthType(
628628
authMode: AuthMode | undefined
629-
): 'OAuth' | 'API Key' | 'Bot Token' | 'Basic' | undefined {
629+
): 'OAuth' | 'API Key' | 'Bot Token' | undefined {
630630
if (!authMode) return undefined
631631
if (authMode === AuthMode.OAuth) return 'OAuth'
632632
if (authMode === AuthMode.ApiKey) return 'API Key'
633633
if (authMode === AuthMode.BotToken) return 'Bot Token'
634-
if (authMode === AuthMode.Basic) return 'Basic'
635634
return undefined
636635
}
637636
function removeNullish(obj: any): any {

apps/sim/lib/integrations/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { IntegrationLandingContent } from '@/app/(landing)/integrations/dat
88
import type { BlockConfig, IntegrationTag } from '@/blocks/types'
99

1010
/** Normalized authentication mode surfaced in the catalog. */
11-
export type AuthType = 'oauth' | 'api-key' | 'basic' | 'none'
11+
export type AuthType = 'oauth' | 'api-key' | 'none'
1212

1313
/** Trigger entry enriched from the trigger registry at generation time. */
1414
interface TriggerInfo {
@@ -56,7 +56,7 @@ export interface Integration {
5656
/** Triggers enriched with details from the trigger registry. */
5757
triggers: TriggerInfo[]
5858
triggerCount: number
59-
/** Authentication mode resolved from the block's explicit mode or credential subBlocks. */
59+
/** Authentication mode inferred from `BlockConfig.subBlocks`. */
6060
authType: AuthType
6161
/**
6262
* OAuth service id from the block's `oauth-input` subBlock (a service key in

packages/deployment-config/src/integration-availability.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface DeploymentIntegration {
2020
type: string
2121
slug: string
2222
name: string
23-
authType: 'oauth' | 'api-key' | 'basic' | 'none'
23+
authType: 'oauth' | 'api-key' | 'none'
2424
oauthServiceId?: string
2525
}
2626

0 commit comments

Comments
 (0)