b2 upload-file --sha1 <hash> gives no error when receives wrong hash.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with the b2 upload-file command and its --sha1 option, and compare the behaviour in the issue with the help text quoted there. The open question is whether the tool should compare the supplied hash with the one the server computes, or only document that it skips computing it. Done means a decision on that question, and then either a clear error on mismatch or a clarified help string. Confirm the decision with the maintainers first, since the thread has been silent for about seven years.
由索引模型根据 Issue 内容生成。
描述
I'm trying to automate some single-file backup tasks, and I've found that while the web API apparently works, I don't know how much I can trust the b2 CLI.
When I call the function with the correct SHA1 as argument:
b2 upload-file --sha1 f871a33490af899cf5476c002c513d1bc4e537b9 futuroapiteste test_file.txt test_file_b2_cli.txt
test_file.txt: 100%|██████████████████████████████████████████████████████████| 5.52k/5.52k [00:01<00:00, 5.42kB/s]
URL by file name: https://f002.backblazeb2.com/file/futuroapiteste/test_file_b2_cli.txt
URL by fileId: https://f002.backblazeb2.com/b2api/v1/b2_download_file_by_id?fileId=4_zeee396220d1bff11694a0a1d_f107a92e113ff0c11_d20180731_m193133_c002_v0001095_t0024
{
"action": "upload",
"fileId": "4_zeee396220d1bff11694a0a1d_f107a92e113ff0c11_d20180731_m193133_c002_v0001095_t0024",
"fileName": "arquivo_teste_b2_cli.txt",
"size": 5520,
"uploadTimestamp": 1533065493000
}
======================================================
When I call the function with the wrong SHA1 as argument:
b2 upload-file --sha1 1111111111111111111111111111111111111111 futuroapiteste test_file.txt test_file_b2_cli_wrong_sha1.txt
test_file.txt: 100%|██████████████████████████████████████████████████████████| 5.52k/5.52k [00:00<00:00, 6.10kB/s]
URL by file name: https://f002.backblazeb2.com/file/futuroapiteste/test_file_b2_cli_wrong_sha1.txt
URL by fileId: https://f002.backblazeb2.com/b2api/v1/b2_download_file_by_id?fileId=4_zeee396220d1bff11694a0a1d_f116da3bb244871bc_d20180731_m193245_c002_v0001094_t0044
{
"action": "upload",
"fileId": "4_zeee396220d1bff11694a0a1d_f116da3bb244871bc_d20180731_m193245_c002_v0001094_t0044",
"fileName": "arquivo_teste_b2_cli_wrong_sha1.txt",
"size": 5520,
"uploadTimestamp": 1533065565000
}
=======================================================
Using:
b2 command line tool, version 1.3.0
When I use b2 list-file-names, it shows me that b2 has the correct SHA1 for both files, which shows that the upload happened well, but then -
Did it check the hash I submitted?
If yes, why there was no error?
(Maybe it recalculated the hash anyway before submitting...?)
(Does b2 upload-file already compare the locally created hash with the hash b2 calculates and returns when the file gets there...? )
The built-in CLI help states:
"By default, upload_file will compute the sha1 checksum of the file
to be uploaded. But, if you already have it, you can provide it
on the command line to save a little time."
Which seems to suggest it does, but it doesn't explicitly say it compares, just 'computes', and the behavior would suggest otherwise.
- 主要语言
- Python
- 星标
- 638
- 派生
- 138
- 平均合并
- 8 小时 27 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Backblaze/B2_Command_Line_Tool 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
Backblaze/B2_Command_Line_Tool#553 · 2 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
Adopt the AI-native SDLC playbook and repository policies可能已有人在做 @goanpeca 于 18 天前认领。 未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
Backblaze/B2_Command_Line_Tool#1192 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
Backblaze/B2_Command_Line_Tool#1168 ·
维护者通常 1 天内回复
-
Add to MacPorts未关闭
难度 3/5 1-2 天 新手友好度 50/100
Backblaze/B2_Command_Line_Tool#1161 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 56/100
Backblaze/B2_Command_Line_Tool#1155 ·
维护者通常 1 天内回复
查看 Backblaze/B2_Command_Line_Tool 的全部 Issue
相似的 Issue
-
ライブラリを追加未关闭priority middle
难度 1/5 1 小时以内 新手友好度 62/100
KATO-Hiro/AtCoderClans#13015 ·
维护者通常 1 天内回复
-
StringLiteral to IntegerType/LongType silently truncates fractional strings, changing predicate meaning可能已有人在做 @Shahzeb-DataEngineer 今天认领。 未关闭kind:bug
难度 2/5 1-3 小时 新手友好度 68/100
apache/iceberg-python#4382 · 2 条评论 ·
维护者通常 1 天内回复
-
request-theme
难度 2/5 1 小时以内 新手友好度 62/100
LizardByte/ThemerrDB#10024 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 72/100
btclib-org/btclib-node#2505 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
open-webui/open-webui#34462 · 1 条评论 ·
维护者通常 1 天内回复