Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Dec 6, 2022

This is a follow-up for #9457 that ensures we trim identify versions to ASCII-only, max 64 characters printable Unicode, max 128 runes.

It is applied to both values sent by Kubo, and ones read from other peers.

I also submitted

to make this canonical behavior across implementations.

@lidel lidel requested review from Jorropo and guseggert December 6, 2022 20:07
@lidel lidel self-assigned this Dec 6, 2022
@lidel lidel force-pushed the fix/agent-version-suffix branch from 6357a06 to 0d30552 Compare December 6, 2022 20:26
@lidel lidel force-pushed the fix/agent-version-suffix branch from 0d30552 to 7384cb4 Compare December 6, 2022 20:35
@lidel lidel marked this pull request as draft December 6, 2022 20:49
@lidel lidel force-pushed the fix/agent-version-suffix branch 2 times, most recently from 57cb269 to a593889 Compare December 6, 2022 21:30
@lidel lidel force-pushed the fix/agent-version-suffix branch from a593889 to 2ad8bf7 Compare December 6, 2022 21:35
@lidel lidel marked this pull request as ready for review December 6, 2022 22:55
@marten-seemann
Copy link
Member

I'm not sure I understand the motivation behind this. I'd prefer to embrace UTF-8, instead of taking extra steps to restrict ourselves to ASCII.

@BigLep BigLep marked this pull request as draft December 13, 2022 17:42
@BigLep BigLep mentioned this pull request Jan 3, 2023
@BigLep
Copy link
Contributor

BigLep commented Mar 9, 2023

@lidel : FYI I bumped this to 0.21 (not 0.20). Feel free to pull it in sooner.

lidel added a commit to ipfs/ipfs-webui that referenced this pull request Sep 12, 2025
- adopt ipfs-check sanitization approach (replace non-ASCII with _)
- sanitize AgentVersion in swarm peers --identify
- sanitize protocols in both id and swarm commands
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Sep 12, 2025
@lidel lidel changed the title fix(id): ascii-only identify versions fix(id): cmdutils.CleanAndTrim identify strings Sep 12, 2025
@lidel lidel changed the title fix(id): cmdutils.CleanAndTrim identify strings fix(cmds): CleanAndTrim unicode identify strings Sep 12, 2025
@lidel lidel force-pushed the fix/agent-version-suffix branch from 6696917 to d794bca Compare September 12, 2025 17:32
@lidel lidel removed their assignment Sep 12, 2025
@lidel
Copy link
Member Author

lidel commented Sep 12, 2025

Updated this PR and the specs one to allow up to 128 unicode runes:

Rationale: this is high enough to not impact anything that exists today, but acts as a sensible failsafe in places where we show these unicode strings to end users:

@lidel lidel marked this pull request as ready for review September 12, 2025 18:17
@lidel lidel requested a review from a team as a code owner September 12, 2025 18:17
@lidel lidel mentioned this pull request Sep 11, 2025
49 tasks
replace control/format/surrogate chars with U+FFFD instead of deleting
as deletion is a security risk

preserve private use characters as specified
enforce 128 rune limit on untrusted peer data

https://www.rfc-editor.org/rfc/rfc9839.html
@lidel lidel force-pushed the fix/agent-version-suffix branch from d794bca to 3807757 Compare September 12, 2025 18:46
@lidel lidel changed the title fix(cmds): CleanAndTrim unicode identify strings fix(cmds): cleanup unicode identify strings Sep 12, 2025
lidel added a commit to ipfs/ipfs-webui that referenced this pull request Sep 16, 2025
- removes client-side truncation as it will be handled upstream in kubo via ipfs/kubo#9465
- simplifies agentVersion to use undefined instead of empty string when not present
lidel added a commit to ipfs/ipfs-webui that referenced this pull request Sep 16, 2025
* feat: add Agent Version column to peers table

shows which IPFS implementation each peer is running (e.g., kubo/0.35.0)

depends on ipfs/js-kubo-rpc-client#342

* fix: increase agent version truncation to 64 chars

aligns with kubo's limit from ipfs/kubo#9465

* chore: update kubo-rpc-client to v5.3.0

- includes identify field support from ipfs/js-kubo-rpc-client#342
- add @babel/plugin-proposal-private-property-in-object to fix build warning
- update browserslist database

* refactor: remove agent version truncation

- removes client-side truncation as it will be handled upstream in kubo via ipfs/kubo#9465
- simplifies agentVersion to use undefined instead of empty string when not present

* refactor: compact connection column display

- use slash notation (ip4/tcp) instead of bullets
- shorten quic-v1 to quic
- use monospace font like other technical columns
ipfs-gui-bot pushed a commit to ipfs/ipfs-webui that referenced this pull request Sep 17, 2025
## [4.9.0](v4.8.0...v4.9.0) (2025-09-17)

 CID `bafybeietkqxghs3hm56e3w64s4papqlvvzqzjigs4eyuy24plkpz652fee`

 ---

### Features

* add Agent Version column to peers table ([#2433](#2433)) ([614f30d](614f30d)), closes [ipfs/kubo#9465](ipfs/kubo#9465) [ipfs/js-kubo-rpc-client#342](ipfs/js-kubo-rpc-client#342) [ipfs/kubo#9465](ipfs/kubo#9465)
* add close button to file viewer for improved navigation ([#2401](#2401)) ([84969a5](84969a5))
* add diagnostics screen ([#2392](#2392)) ([f3a8179](f3a8179)), closes [#2424](#2424) [ipfs-check#102](ipfs/ipfs-check#102) [/github.com/ipfs/ipfs-check/pull/102#pullrequestreview-3214396503](https://github.com/ipfs//github.com/ipfs/ipfs-check/pull/102/issues/pullrequestreview-3214396503) [#2434](#2434)
* **files:** advanced sorting options ([#2421](#2421)) ([c9251eb](c9251eb))
* migrate Tooltip from Javascript to Typescript ([#2381](#2381)) ([dc9e9ac](dc9e9ac))

### Bug Fixes

* create redux-bundler migration helpers ([#2388](#2388)) ([d1fdb87](d1fdb87))
* display UX friendly error for missing files ([#2346](#2346)) ([d4e7fca](d4e7fca))
* **files:** rename in Grid View ([#2422](#2422)) ([e39bce6](e39bce6))
* **i18n:** prevent English replacements in translation sync workflow ([#2418](#2418)) ([323c59e](323c59e))
* macos input focus issue in draggable regions ([#2416](#2416)) ([5382688](5382688))
* migrate error boundary to typescript ([#2402](#2402)) ([b33775a](b33775a))
* **navbar:**  highlighting on browser back ([#2425](#2425)) ([cec6dfd](cec6dfd))
* Prevent layout breaks with long filenames in file preview ([#2415](#2415)) ([f82efcd](f82efcd))
* reference to `global` in browser environment ([#2408](#2408)) ([03b2e92](03b2e92))
* shared max for bandwidth chart ([#2426](#2426)) ([cd17032](cd17032))
* typecheck more files ([#2409](#2409)) ([fb967ee](fb967ee))

### Tests

* fix bring-your-own kubo node functionality ([#2396](#2396)) ([0883cfa](0883cfa))
* make e2e tests more robust ([#2438](#2438)) ([3de544b](3de544b))

### Trivial Changes

* **readme:** update links ([dc6f8f4](dc6f8f4))
* remove selectApiUrl selector ([#2412](#2412)) ([d4710e8](d4710e8))
- resolved go.mod conflict by accepting newer dependency versions
- kept go-ipfs-cmds v0.15.0 alongside new dependencies
@lidel lidel merged commit f6a9b34 into master Sep 19, 2025
16 checks passed
@lidel lidel deleted the fix/agent-version-suffix branch September 19, 2025 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

No open projects
Status: 🔎 In Review

Development

Successfully merging this pull request may close these issues.

4 participants