user create --password-stdin keeps a byte order mark as part of the password

未关闭 适合新手
#3,621 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
cli

调研方向

从 ConsoleCommandInput.ReadLineAsync 开始,它读取 Console.In,并在报告中被指出是标记存活的位置;还要检查它在 src/FluentCMS.Host 下 user create 和 user reset-password --password-stdin 路径中的调用方。通过将带 BOM 前缀的行管道到命令中来复现,然后从重定向输入读取的第一行中去除开头的 U+FEFF,并将其余部分按 UTF-8 解码。完成意味着带 BOM 前缀的管道可以登录,并且现有的 host 命令测试仍然通过;添加一个覆盖 BOM 情况的测试。

由索引模型根据 Issue 内容生成。

描述

area:identity type:bug

What happens

On Windows, a password piped from PowerShell to fluentcms user create --password-stdin (or user reset-password --password-stdin) is stored with a byte order mark in front of it, so the user cannot sign in with the password that was piped:

"YourPassword123!" | dotnet run --no-build --project src/FluentCMS.Host -- fluentcms user create --email [email protected] --role "Super Admin" --password-stdin

The command reports success, and the sign-in page then answers "Sign-in failed" for that address and password. The same command fed from a pipe without a byte order mark (cmd, bash) signs in.

Why

PowerShell can write a UTF-8 byte order mark before what it pipes to a native command. ConsoleCommandInput.ReadLineAsync reads Console.In, which does not drop it, so the first line of standard input is the mark followed by the password.

Expected

A byte order mark at the start of redirected standard input is not part of the first line, and what follows it is read as UTF-8.

主要语言
C#
星标
567
派生
107
平均合并
2 小时 35 分钟
30 天内合并 PR
425

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fluentcms/FluentCMS 的其他 Issue

查看 fluentcms/FluentCMS 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。