Skip to content

Commit

Permalink
feat: add a simpler way to use no-op tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron authored and bobmcwhirter committed Sep 7, 2023
1 parent bb3d97a commit 1516ff6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auth/src/client/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ impl TokenProvider for NoTokenProvider {
}
}

#[async_trait]
impl TokenProvider for () {
async fn provide_access_token(&self) -> Result<Option<Credentials>, Error> {
Ok(None)
}
}

#[async_trait]
impl<T> TokenProvider for Option<T>
where
Expand Down

0 comments on commit 1516ff6

Please sign in to comment.