Chore/add http denylist checks (#4985)

add http denylist checks
This commit is contained in:
Henry Heng
2025-07-30 17:16:40 +01:00
committed by GitHub
parent e8dac2048f
commit 0998bf4327
6 changed files with 70 additions and 41 deletions
@@ -1,6 +1,7 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
import { checkDenyList } from '../../../src/httpSecurity'
export const desc = `Use this when you want to execute a POST request to create or update a resource.`
@@ -126,6 +127,9 @@ export class RequestsPostTool extends DynamicStructuredTool {
...this.headers
}
// Check if URL is allowed by security policy
await checkDenyList(inputUrl)
const res = await fetch(inputUrl, {
method: 'POST',
headers: requestHeaders,