Rewrite URLs to represent user/instance pair #2
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: blisstown/campfire#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ideally, campfire URLs shared by users should be accessible for all who open them; not just those who are logged in.
an unprivileged route could be resolved by the client by including the instance and post ID in the URI
example:
https://ice.arimelody.me/notes/9v8fb35icsnoy4e7
would map to:
https://campfire.bliss.town/ice.arimelody.me/9v8fb35icsnoy4e7
the client can assume a secure (HTTPS) connection to the target instance, create an application via the mastodon API endpoint, and make an unprivileged request to the post.
amending this:
considering a consistent URI hierarchy (instances contain accounts which make posts), it may be beneficial to format URIs in an instance/account/post format.
the above example would instead map to:
https://campfire.bliss.town/ice.arimelody.me/@ari/9v8fb35icsnoy4e7
or, for an account on a foreign instance:
https://campfire.bliss.town/ice.arimelody.me/@ari@wetdry.world/9v8fb35icsnoy4e7
profile pages would then be mapped accordingly, of course disregarding a post ID:
https://campfire.bliss.town/ice.arimelody.me/@ari
this does result in significantly longer URIs, and effectively maps 1:1 with the URI format that the Elk client uses, though considering the benefits it's fair to say they had a good point when structuring their URIs in this way.
profile pages are still WIP and not implemented yet, but the
/<instance>/<@account>
route is now available for further implementation. posts are currently accessible via/<instance>/<@account>/<post_id>
.this method, while resulting in much longer URIs than just
/<instance>/<post_id>
(which would be sufficient for simply retrieving post data), would be much more complicated to implement, as it would require the second URI parameter to be handled as some generic account/post/etc. reference. this may be handled in the future, but as stated, this method works for now.