Skip to content

Commit a835858

Browse files
waleedlatif1claude
andcommitted
fix(agiloft): address PR review feedback
- Add HTTPS enforcement guard to agiloftLogin to prevent plaintext credential transit - Add null guard on data.output in attach_file transformResponse - Change empty AgiloftSavedSearchParams interface to type alias Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 37cc501 commit a835858

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

apps/sim/tools/agiloft/attach_file.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ export const agiloftAttachFileTool: ToolConfig<AgiloftAttachFileParams, AgiloftA
103103
return {
104104
success: true,
105105
output: {
106-
recordId: data.output.recordId ?? '',
107-
fieldName: data.output.fieldName ?? '',
108-
fileName: data.output.fileName ?? '',
109-
totalAttachments: data.output.totalAttachments ?? 0,
106+
recordId: data.output?.recordId ?? '',
107+
fieldName: data.output?.fieldName ?? '',
108+
fileName: data.output?.fileName ?? '',
109+
totalAttachments: data.output?.totalAttachments ?? 0,
110110
},
111111
}
112112
},

apps/sim/tools/agiloft/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface AgiloftSelectRecordsParams extends AgiloftBaseParams {
4141
where: string
4242
}
4343

44-
export interface AgiloftSavedSearchParams extends AgiloftBaseParams {}
44+
export type AgiloftSavedSearchParams = AgiloftBaseParams
4545

4646
export interface AgiloftAttachmentInfoParams extends AgiloftBaseParams {
4747
recordId: string

apps/sim/tools/agiloft/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ interface AgiloftRequestConfig {
2727
*/
2828
async function agiloftLogin(params: AgiloftBaseParams): Promise<string> {
2929
const base = params.instanceUrl.replace(/\/$/, '')
30+
31+
if (!base.startsWith('https://')) {
32+
throw new Error('Agiloft instanceUrl must use HTTPS to protect credentials')
33+
}
34+
3035
const kb = encodeURIComponent(params.knowledgeBase)
3136
const login = encodeURIComponent(params.login)
3237
const password = encodeURIComponent(params.password)

0 commit comments

Comments
 (0)