Monorepo for Tangled โ€” https://tangled.org

appview: repo: trim leading @ from collaborator's handle #417

merged
opened by bad-example.com targeting master from bad-example.com/core: fix/contributor-handle

The "add collaborator" form currently fails if you submit a handle like @example.com, since the identity gets forwarded eventually directly to Bluesky's identity parse, which does not accept the @ prefix for handles.

This change is targetted to only fix that one form.

I do think it would be nice to put it in idresolver's ResolveIdent instead, but a change there seems like it could have wide effect across the app that i'm not equipped to test. Searching for strings.TrimPrefix shows manual stripping of @-prefixes in middleware, oauth, avatars, and keys, so I figure this direct change is consistent?

(I did not do a thorough survey of other handle handling that might also be missing @-stripping.)

0
by bad-example.com 2 comments
expand 1 commit
appview: repo: trim leading @ from collaborator's handle

thanks for the PR! i think this looks good.

i don't want to put this into ResolveIdent, but its a nice-to-have on all forms that accept dids/handles.

in the login form, we do a bit more validation around this (stripping the unicode bidi characters that bsky inserts is one, because people tend to copy their handle from bsky.app quite often).

sweet! and yeah that makes sense to me.

pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:hdhoaan3xa3jiuq4fg4mefid/sh.tangled.repo.pull/3lvt6pfbw3h22