-
Notifications
You must be signed in to change notification settings - Fork 6.3k
add http header auth config #4982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Preview mcp_server Image: |
Preview sandbox Image: |
Preview fastgpt Image: |
Preview mcp_server Image: |
Preview sandbox Image: |
Preview fastgpt Image: |
Preview mcp_server Image: |
Preview sandbox Image: |
Preview mcp_server Image: |
Preview sandbox Image: |
Preview fastgpt Image: |
|
||
export type HeaderAuthConfigType = { | ||
enableAuth: boolean; | ||
authType: HeaderAuthTypeEnum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是不需要 authType 了,如果下面有 3 个值的话
@@ -201,3 +206,63 @@ export async function rewriteAppWorkflowToSimple(formatNodes: StoreNodeItemType[ | |||
}); | |||
}); | |||
} | |||
|
|||
export async function secureHttpAuth(nodes: StoreNodeItemType[], appId: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
语义化一点,加个动词
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
顺便备注下,是干了哪些事
|
||
export async function secureHttpAuth(nodes: StoreNodeItemType[], appId: string) { | ||
const getNodeHttpAuth = (node: StoreNodeItemType) => | ||
node.flowNodeType === FlowNodeTypeEnum.httpRequest468 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node.flowNodeType === FlowNodeTypeEnum.httpRequest468 这个不用了,可能还有其他的。只看 input key 好了。
}); | ||
} | ||
|
||
export const formatHeaderAuth = async (headerAuth: StoreHeaderAuthValueType) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该放到 secret/controller 里?看着和 app 没关系
@@ -41,7 +50,7 @@ const Header = ({ url, toolList }: { url: string; toolList: McpToolConfigType[] | |||
|
|||
const { runAsync: saveMCPTools, loading: isSavingMCPTools } = useRequest2( | |||
async () => { | |||
return await postUpdateMCPTools({ appId, url, toolList }); | |||
return await postUpdateMCPTools({ appId, url, toolList, headerAuth }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改鉴权的话,确认就直接触发了。 不用等手动保存。
|
||
const mcpClient = new MCPClient({ url }); | ||
const mcpClient = new MCPClient({ url, headerAuth: formattedHeaderAuth }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
合并一行
|
||
const mcpClient = new MCPClient({ url }); | ||
const mcpClient = new MCPClient({ url, headerAuth: formattedHeaderAuth }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
合并
await MongoApp.updateOne( | ||
{ _id: appId }, | ||
{ | ||
modules: [getMCPToolSetRuntimeNode({ url, toolList, name: app.name, avatar: app.avatar })], | ||
modules: [ | ||
getMCPToolSetRuntimeNode({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和下面合并下
@@ -89,7 +116,11 @@ const updateMCPChildrenTool = async ({ | |||
session | |||
}: { | |||
parentApp: AppDetailType; | |||
toolSetData: MCPToolSetData; | |||
toolSetData: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MCPToolSetData 能不能改造
No description provided.