mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +08:00
### What problem does this PR solve? Feat: Remove HMAC from the webhook #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -34,6 +34,7 @@ import {
|
||||
NodeHandleId,
|
||||
Operator,
|
||||
TypesWithArray,
|
||||
WebhookSecurityAuthType,
|
||||
} from './constant';
|
||||
import { BeginFormSchemaType } from './form/begin-form/schema';
|
||||
import { DataOperationsFormSchemaType } from './form/data-operations-form';
|
||||
@ -353,13 +354,20 @@ function transformRequestSchemaToJsonschema(
|
||||
|
||||
function transformBeginParams(params: BeginFormSchemaType) {
|
||||
if (params.mode === AgentDialogueMode.Webhook) {
|
||||
const nextSecurity: Record<string, any> = {
|
||||
...params.security,
|
||||
ip_whitelist: params.security?.ip_whitelist.map((x) => x.value),
|
||||
};
|
||||
if (params.security?.auth_type === WebhookSecurityAuthType.Jwt) {
|
||||
nextSecurity.jwt = {
|
||||
...nextSecurity.jwt,
|
||||
required_claims: nextSecurity.jwt?.required_claims.map((x) => x.value),
|
||||
};
|
||||
}
|
||||
return {
|
||||
...params,
|
||||
schema: transformRequestSchemaToJsonschema(params.schema),
|
||||
security: {
|
||||
...params.security,
|
||||
ip_whitelist: params.security?.ip_whitelist.map((x) => x.value),
|
||||
},
|
||||
security: nextSecurity,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user