为远程发布补充文件密钥支持#38
Open
walker1211 wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
背景
PR #36 为
wenyan serve增加了--api-key-file,解决了服务端启动参数暴露 API Key 的问题,但当时没有覆盖wenyan publish --server的远程客户端场景。客户端仍只能使用--api-key,真实密钥会出现在进程命令行中。本 PR 补齐这个遗漏,使远程发布客户端也能从权限受限的文件读取密钥。
修改
wenyan publish增加--api-key-file <path>。serve与publish的文件读取、首尾空白清理及错误处理逻辑。--api-key和--api-key-file。兼容性
--api-key,已有调用不受影响。--api-key-file仅在指定--server的远程发布模式下生效。2.0.11。验证
pnpm run test(42 项通过)pnpm run typecheckpnpm run buildpnpm run lint(无新增错误)wenyan publish --help显示--api-key-file