-
Notifications
You must be signed in to change notification settings - Fork 85
Add Zhizhangyi MBS service adapter #435
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { runServiceMain } from "@chaitin-ai/octobus-sdk"; | ||
|
|
||
| import { service } from "../src/service.js"; | ||
|
|
||
| runServiceMain(service); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "endpoint": { | ||
| "type": "string", | ||
| "description": "MBS REST API base URL. Example: https://mbs.example.com:9074" | ||
| }, | ||
| "baseUrl": { | ||
| "type": "string", | ||
| "description": "Legacy alias for endpoint." | ||
| }, | ||
| "skipTlsVerify": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Skip TLS certificate verification. Enable only when the target MBS endpoint uses a trusted self-signed certificate." | ||
| }, | ||
| "timeoutMs": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "default": 30000, | ||
| "description": "HTTP timeout in milliseconds." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "name": "zhizhangyi-mbs", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "files": [ | ||
| "bin/zhizhangyi-mbs.js", | ||
| "config.schema.json", | ||
| "secret.schema.json", | ||
| "service.json", | ||
| "proto", | ||
| "src" | ||
| ], | ||
| "bin": { | ||
| "zhizhangyi-mbs": "bin/zhizhangyi-mbs.js" | ||
| }, | ||
| "dependencies": { | ||
| "@chaitin-ai/octobus-sdk": "^0.5.0" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Windows arm64 上 runtime secret 临时文件权限不足,可能导致敏感信息泄露
runtimeSecretArg在 Windows arm64 平台上将 secret 写入secret.runtime.json,并使用0o600权限创建文件。但 Windows 不支持 Unix 文件权限位,os.WriteFile的权限参数在 Windows 上被忽略,导致该文件可能被系统上其他用户或进程读取。supervisor 与 gateway 两处均使用此函数,secret 中包含的 appkey/secretkey/orgCode 等敏感凭证存在泄露风险。Problem code:
Recommendation:
在 Windows 平台上,应通过
golang.org/x/sys/windows设置显式 ACL(仅当前用户可访问),或将 secret 文件写入已按用户隔离的临时目录(如%LOCALAPPDATA%下的应用专属目录),避免依赖 Unix 权限位。同时建议在 supervisor/gateway 的 cleanup 逻辑中增加进程崩溃后的残留文件清理(如启动时清理旧 instance workdir 中的 secret.runtime.json)。Suggested diff: