Skip to content

Commit 7bfa423

Browse files
committed
fix(credentials): type the GitLab check's secure-fetch response
1 parent 59eda8f commit 7bfa423

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/sim/lib/credentials/token-service-accounts/validators/gitlab.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { toArray, toRecord } from '@sim/utils/object'
2-
import { secureFetchWithValidation } from '@/lib/core/security/input-validation.server'
2+
import {
3+
type SecureFetchResponse,
4+
secureFetchWithValidation,
5+
} from '@/lib/core/security/input-validation.server'
36
import {
47
providerFailureCode,
58
TokenServiceAccountValidationError,
@@ -32,7 +35,7 @@ export async function validateGitLabServiceAccount(
3235
reason: 'invalid host',
3336
})
3437
}
35-
let response: Response
38+
let response: SecureFetchResponse
3639
try {
3740
response = await secureFetchWithValidation(
3841
`https://${host}/api/v4/personal_access_tokens/self`,

‎apps/sim/tools/whatsapp/whatsapp.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
buildMediaMessageBody,
1111
buildMediaUploadUrl,
1212
buildMediaUrl,
13+
buildMessagesUrl,
1314
transformWhatsAppSendResponse,
1415
whatsappMediaLimitFor,
1516
} from '@/tools/whatsapp/utils'
@@ -26,7 +27,7 @@ describe('WhatsApp request URL and headers', () => {
2627
it.each(['../../999/register#', '..', '123/subscribed_apps?'])(
2728
'refuses a phone number ID that would leave its path segment (%s)',
2829
(phoneNumberId) => {
29-
expect(() => sendMessageTool.request.url({ ...auth, phoneNumberId })).toThrow(/phoneNumberId/)
30+
expect(() => buildMessagesUrl(phoneNumberId)).toThrow(/phoneNumberId/)
3031
}
3132
)
3233
})

0 commit comments

Comments
 (0)