Skip to content
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

feat: OAuth #219

Merged
merged 26 commits into from
Oct 23, 2024
Merged

feat: OAuth #219

merged 26 commits into from
Oct 23, 2024

Conversation

sugyan
Copy link
Owner

@sugyan sugyan commented Aug 18, 2024

No description provided.

@erlend-sh
Copy link

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
Copy link
Owner Author

sugyan commented Oct 22, 2024

@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
Copy link

avdb13 commented Oct 23, 2024

@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 sugyan marked this pull request as ready for review October 23, 2024 13:42
@sugyan sugyan merged commit bf75a70 into main Oct 23, 2024
13 checks passed
@sugyan
Copy link
Owner Author

sugyan commented Oct 23, 2024

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
Copy link

avdb13 commented Oct 26, 2024

@sugyan few questions:

  • am I supposed to port CachedGetter?
  • Should 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.

@github-actions github-actions bot mentioned this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants