Note: this PR was originally opened as #21, however since that was a PR from @xlambein's fork of this repo I had to move the branch over to this repo in order to push new changes. I'm reopening the PR exactly as before, but with this note & a commit which makes tokio a required dependency.
Original description
This PR's aim was to add service account impersonation as an authentication method, but in order to do this I had to update the version of yup-oauth to 8.1, which required quite a lot of changes.
The main one is that I removed the concept of TokenSource from this repository, for two reasons:
first, yup-oauth changed a bunch of things regarding how tokens work (a big one is that token generation can produce None now), making TokenSource difficult to adapt;
and second, because TokenSource was a bit redundant with yup-oauth's own concept of authenticators.
Since version 6, the library has added many new authenticators, covering (I think) the use cases that TokenSource was covering. Instead of a token source, AuthGrpcService now carries an authenticator and a list of scopes.
Updating yup-oauth also required replacing the C: crate::Connect + Clone + Send + Sync + 'static bounds with the following mouthful:
the reason being that hyper::Connect is actually a private trait that cannot be implemented, and so yup-oauth changed at some point to the bounds above, which are equivalent, albeit annoying.
Note: this PR was originally opened as #21, however since that was a PR from @xlambein's fork of this repo I had to move the branch over to this repo in order to push new changes. I'm reopening the PR exactly as before, but with this note & a commit which makes
tokio
a required dependency.Original description
This PR's aim was to add service account impersonation as an authentication method, but in order to do this I had to update the version of
yup-oauth
to 8.1, which required quite a lot of changes.The main one is that I removed the concept of
TokenSource
from this repository, for two reasons:yup-oauth
changed a bunch of things regarding how tokens work (a big one is that token generation can produceNone
now), makingTokenSource
difficult to adapt;TokenSource
was a bit redundant withyup-oauth
's own concept of authenticators.Since version 6, the library has added many new authenticators, covering (I think) the use cases that
TokenSource
was covering. Instead of a token source,AuthGrpcService
now carries an authenticator and a list of scopes.Updating
yup-oauth
also required replacing theC: crate::Connect + Clone + Send + Sync + 'static
bounds with the following mouthful:the reason being that
hyper::Connect
is actually a private trait that cannot be implemented, and soyup-oauth
changed at some point to the bounds above, which are equivalent, albeit annoying.