Problems with `identity` in cpost configs
- Dominant language
- C
- Stars
- 4
- Forks
- 1
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Description
While trying to migrate some v2 cpost configs to sr3 cpost, I came across some problems.
### First problem:
The `identity` option isn't parsed correctly:
| config option | parsed as `sum=` | result |
|-|-|-|
| `sum d` md5 on data | `d` | ✅
| `sum n` md5 on file name | `n` | ✅
| `sum s` sha512 on data | `s` | ✅
| `identity md5name` | `m` | :x: should be `n` md5 on file name
| `identity md5` | `m` | :x: should be `d` md5 on file data
| `identity sha512` | `s` | ✅
### Second problem:
When using `sum n` (md5name) with v03 format messages, identity is missing from the message:
`{ "pubTime" : "20260129T174716.2993753", "baseUrl" : "sftp://localhost/", "relPath" : "tmp/test", "source" : "bunnymaster", "size" : "5", "atime" : "20260129T161256.87121107", "mtime" : "20260129T161246.786308", "mode" : "644" }`
compared to v02 format messages:
Maybe this was intentional, because `identity` is optional in v03 messages and md5 on the file name is kind of useless? But the behaviour is inconsistent with the Python version and surprising/confusing.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the cpost migration cases for identity, sum n, and v03 versus v02 messages, then trace the configuration parsing and message-generation entry points. Compare the behavior with the Python version; done means md5name and md5 map to the reported sum modes and v03 messages consistently include identity when sum n is selected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100