sugyan / atrium

Rust libraries for Bluesky's AT Protocol services.
MIT License
218 stars 26 forks source link

feat: OAuth #219

Closed sugyan closed 1 month ago

erlend-sh commented 1 month ago

Just tested https://github.com/sugyan/atrium-oauth-wasm and it works for me ✨

Anything still pending here? We’re considering using this for another app.

sugyan commented 1 month ago

@erlend-sh Hi, sorry for the delayed response. Thank you for trying atrium-oauth-wasm! I would be very happy if you use it in another app.

Currently, I believe that the implementation has been completed up to the point of obtaining a token according to the OAuth flow. What I'm working on now is preparing a session management Agent that will hold the tokens and automatically refresh the expired tokens. However, I may merge this pull-request once and proceed with the implementation of the agent in another branch.

Also, the document is almost not written yet. After writing that, I am thinking that I can publish it as crate packages.

avdb13 commented 1 month ago

@sugyan do you mind assigning the second PR to me? I'm guessing session management requires a new field of type SessionStore to be added to OAuthClient.

sugyan commented 1 month ago

Anyway, I just merged this branch.

@avdb13, pull-requests are welcome from anyone! I have not been able to implement it recently, but I was thinking of designing it with the following image, (referring to TypeScript SDK): Create a trait called SessionManager, port the current atrium_api::AtpAgent as CredentialSession, and implement SessionManager. Separately create OAuthSession and implement SessionManager here as well. Define a new generic Agent that can be used for both.

avdb13 commented 3 weeks ago

@sugyan few questions:

Apologies in advance if my questions are incomprehensible.