mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 06:25:54 +03:00
[GH-ISSUE #269] Add GET endpoint to add bookmarks to use with bookmarklet and other methods #193
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#193
Loading…
Add table
Add a link
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?
Originally created by @deanishe on GitHub (Aug 20, 2020).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/269
Add GET endpoint for submitting bookmarks via bookmarklet, Web Share API, other integrations.
Acceptance criteria
GET /bookmarklet: Only for authenticated owners. Receive url via get parameter:/bookmarklet?url=(urlencoded url).@akavel commented on GitHub (May 30, 2024):
Hi! I would be interested to try if I could implement this; would you have any pointers for how to approach that for a person not familiar with the codebase? also, how the authentication should work in this case? also, any specifics on how to & how not to implement this? TIA! @fmartingr ?
I would like to try do it in coordination with the amazing maintainers of this project, the way you'd like it to be done, so that you hopefully get more return from this than trouble 😂 I am happy for discussions and back and forth on the PR once it is ready. I'm a maintainer myself, so I know how the things look from the other side. I'd just be grateful for some guidelines for start - for one thing, to begin in roughly good for you direction instead of wasting time on random ideas that would show up be completely against your vision; for the second thing, you know the codebase way better than me so you can easily point to me some initial appropriate places; for the third thing, it could give us a tiny bit better chance at having this maybe actually merged in the future 😂 Anyway, if that's too much effort for you at this moment, I'm totally fine with that too - just please let me know so I can try to dive head-first and just discuss later on a PR (if I even get there). However little or much you can tell me, I'll be grateful - just I'd love rather faster than later if possible 😅❤️ but still ok if not, I will understand. Cheers!
@fmartingr commented on GitHub (May 31, 2024):
Hey @akavel, thank you for volunteering! Some details as how I saw this happening:
/bookmarks/addor/bookmarks/bookmarklet) living underinternal/http/routes/bookmark.goBookmarkDomainin charge of adding bookmarks. Right now that can be just a passthrough to call the database, but in the future we would want to differentiate database and publicly exposed objects and this will be the layer in charge of that.SaveBookmarks. You can access it from the domain underd.deps.Database.SaveBookmarks.This is briefly what I've been thinking about this. Let me know if you have further questions or if you think something would be done in a different way things are obviously up for discussion.
Thanks again!
@akavel commented on GitHub (May 31, 2024):
Thanks @fmartingr for a quick reply! ❤️❤️
One thing that is not super clear to me, both from implementation, but also esp. usage and maybe testing perspective, is how auth should work here? In particular:
@fmartingr commented on GitHub (May 31, 2024):
You only need to add the handler in the bookmark.go file.
Since the main purpose of this endpoint would be using it from a bookmarklet I'd say cookie auth is enough. Authentication is available automatically in all routes via middlewares for both JWT and Cookies.
My concern is mostly to try and test all new additions to the codebase because most of the code is currently not covered and since we are undergoing some refactors I expect basic test of the new features/refactors being worked on. Regarding how to test, you can test the handler directly, keep an eye on other tests to check how we did it. We have a bunch of helpers under testutil to ease out asserts done to HTTP handlers, I believe is mainly focused for the API but it can be used/adapted for other handlers.