-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add trackers support #720
add trackers support #720
Conversation
path("track") { | ||
get("list", TrackController.list) | ||
post("login", TrackController.login) | ||
post("logout", TrackController.logout) | ||
post("search", TrackController.search) | ||
post("bind", TrackController.bind) | ||
post("update", TrackController.update) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you would be able to add GraphQL endpoints for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Syer10, I'm sorry that I have very limited knowledge about GraphQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to take a look at implementing it when I have time, I'll push to this branch so that it can be included in the PR.
We have deprecated the REST api and all future development is to take place in the GraphQL api(under the suwayomi.tachidesk.graphql package). So we need GraphQL endpoints for these before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, the related PR to Sorayomi can be found here: Suwayomi/Tachidesk-Sorayomi#236
@tachimanga I did a bunch of cleanup as well as add GraphQL support. Can you verify that everything still works as intended? One thing to note is that I changed the track/bind endpoint to add a |
@Syer10 I am a Kotlin beginner, and my code often shows some Java flavor. I have learned a lot from your modifications, and I will make the necessary changes to Sorayomi to handle the endpoint changes. I will reply once I have finished the modifications. |
@Syer10 Everything is working great! It was a good idea to remove mangaId from the MangaTrackerDataClass. |
Great! I'll look into the client ids in the next few days, we should be able to merge it sometime soon. |
@Syer10 Some notes about the callback URL. |
Hmm, I see. |
It might be possible to set it up via github pages? Does their oauth request accept additional arguments so we could pass it the real redirect url? Alternatively this could be the first electron only feature in WebUI. |
@AriaMoradi Github Pages is OK, and when the OAuth process is completed, it will jump back to a URL such as If we implement the tracker setting in the web UI, we can set up a github page with the URL as |
server/src/main/kotlin/suwayomi/tachidesk/manga/impl/track/tracker/TrackerPreferences.kt
Outdated
Show resolved
Hide resolved
I've decided to just merge it, and disable the endpoints until we have a working auth solution |
There's also Auth Pin option from AniList at least:
|
Now that I think about it, alternatively the Suwayomi-Server could be transparent regarding OAuth client and the actual client e.g. WebUI should determine OAuth client therefore you could have multiple URI scheme redirections. So basically the original initiator gets the token if it's supported by the UI type, stores it to server and the server makes use of it amongsts different UIs. You can think of it like, Suwayomi-Server will act like transparent proxy while fetching the token and then grab it. |
That is how it works, kind o. after a tracker is authenticated, the token get served in the server, and any client (even if they dont have a login implementations) can use it and make authenticated called to the tracker. A Pr I was working on give you another OATH2 implementation (authentication code), which let you set the redirect uri instead of using the hardcoded one, then the client can pick/implement what redirect uri will be use for authenticating. Since tracking has just been implemented in the webUI, I have put move the PR to low priority, but I am thinking on finish it in the future. The logic for the implementation can be reused to add oath2 authentication to secure suwayomi. |
Note: the Anilist & MyAnimeList clientId should be replaced with official clientId, and set callback url to suwayomi://oauth/anilist and suwayomi://oauth/myanimelist
MyAnimeListApi.kt
AnilistApi.kt
close #80