Rewrite URLs to represent user/instance pair #2

Closed
opened 2024-07-03 00:06:24 +00:00 by ari · 2 comments
Owner

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.

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.
ari added this to the v1.0 project 2024-07-03 00:06:24 +00:00
ari added the
feature
label 2024-07-03 00:08:48 +00:00
Author
Owner

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.

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.
ari self-assigned this 2024-07-07 12:05:54 +00:00
Author
Owner

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.

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.
ari closed this issue 2024-07-07 13:36:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: blisstown/campfire#2
No description provided.