Closed sugyan closed 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.
@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
.
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.
@sugyan few questions:
AtpAgent
's convenience methods (the ones invoking XrpcClient
) be part of a new impl Agent
block, with a trait bound that only allows their usage when XrpcClient
is a generic parameter?Apologies in advance if my questions are incomprehensible.
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.