HeroicKatora / oxide-auth

A OAuth2 server library, for use in combination with actix or other frontends, featuring a set of configurable and pluggable backends.
685 stars 91 forks source link

[DRAFT] Add async/await support for `oxide-auth-async` #165

Open FrancisMurillo opened 1 year ago

FrancisMurillo commented 1 year ago

This changes/fixes/improves …

Still fixing the main example work and adding another example to show explicit async/await usage

I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.

HeroicKatora commented 1 year ago

On a general note: I'd actually rather replace the actix bindings with fully asynchronous ones rather than have two separate packages for it, if that sounds appropriate.

FrancisMurillo commented 1 year ago

On a general note: I'd actually rather replace the actix bindings with fully asynchronous ones rather than have two separate packages for it, if that sounds appropriate.

I tried doing in a separate crate first to see if there might be any issues with types and compatibility. I did have a problem with the actix actor example since the current implementation of Generic kinda needs to be Clone-able to pass the compiler check.

FrancisMurillo commented 1 year ago

@HeroicKatora So this is kinda my async use case. (Mine was diesel but wrapped them in async domain methods.) I think you can inspect the current example while I try to make the original example with Generic work if possible.

FrancisMurillo commented 1 year ago

@HeroicKatora Okay, I have tried several attempts to make Generic work within the async actix handler but its kinda tricky without creating thread safe versions generic components or removing the &mut in every Endpoint method which I do not think is ideal. So my current example I think is the easiest way I found so far.

ConcurrentSquared commented 2 months ago

I don't want to bother anyone here (this PR is obviously inactive), but I do have a updated fork of this PR with some very small improvements (the largest being the addition of the async ClientCredentials OAuth operation).

However, it should be noted that my fork is only for a personal side-project; I will almost certainly will not submit my own PR (or try to help with this PR), as I do not feel like I have either the time or experience (in Rust or in OAuth) to help in any significant way.