URL encode SSB public keys on profile page #116

Merged
glyph merged 5 commits from fix_encoding_decoding into main 2022-06-16 10:38:19 +00:00
Owner

Replaces / with %2F for all SSB public keys on the /scuttlebutt/profile route.

This addresses #91 and #96.

Replaces `/` with `%2F` for all SSB public keys on the `/scuttlebutt/profile` route. This addresses https://git.coopcloud.tech/PeachCloud/peach-workspace/issues/91 and https://git.coopcloud.tech/PeachCloud/peach-workspace/issues/96.
glyph added 2 commits 2022-06-15 07:42:16 +00:00
glyph requested review from notplants 2022-06-15 07:42:26 +00:00
glyph added the
bug
peach-web
labels 2022-06-15 08:05:14 +00:00
Owner

is there some type of encoding that we could use that would be more general than just replacing / with %2F , or is the only possible character that needs to be changed?

Otherwise looks good!

is there some type of encoding that we could use that would be more general than just replacing / with %2F , or is the only possible character that needs to be changed? Otherwise looks good!
Author
Owner

@notplants

The / seemed to be the only character causing issues for the route handler so I went with the simplest solution.

A more general approach would be to URL-encode the entire key. Here's an example:

@Sur8RwcDh6kBjub8pLZpHNWDfuuRpYVyCHrVo+TdA/4=.ed25519

becomes...

%40Sur8RwcDh6kBjub8pLZpHNWDfuuRpYVyCHrVo%2BTdA%2F4%3D%2Eed25519

One thing I like about the /-only solution is that the key remains fairly readable and recognisable as an SSB ID. I'm tempted to stick with that solution and only implement the more complete encoding if we run into another issue.

@notplants The `/` seemed to be the only character causing issues for the route handler so I went with the simplest solution. A more general approach would be to URL-encode the entire key. Here's an example: `@Sur8RwcDh6kBjub8pLZpHNWDfuuRpYVyCHrVo+TdA/4=.ed25519` becomes... `%40Sur8RwcDh6kBjub8pLZpHNWDfuuRpYVyCHrVo%2BTdA%2F4%3D%2Eed25519` One thing I like about the `/`-only solution is that the key remains fairly readable and recognisable as an SSB ID. I'm tempted to stick with that solution and only implement the more complete encoding if we run into another issue.
glyph added 2 commits 2022-06-16 10:10:41 +00:00
glyph added 1 commit 2022-06-16 10:19:15 +00:00
continuous-integration/drone/pr Build is passing Details
76d5e6a355
fix probes version
glyph merged commit 6ad5c620c1 into main 2022-06-16 10:38:19 +00:00
glyph deleted branch fix_encoding_decoding 2022-06-16 10:38:20 +00:00
Sign in to join this conversation.
No description provided.