Store a token with expiration time.
(&self, provider_name: String, access_token: String, expires_at_ms: i64)
| 114 | |
| 115 | /// Store a token with expiration time. |
| 116 | fn set(&self, provider_name: String, access_token: String, expires_at_ms: i64) { |
| 117 | if let Ok(mut tokens) = self.tokens.write() { |
| 118 | tokens.insert( |
| 119 | provider_name, |
| 120 | CachedToken { |
| 121 | access_token, |
| 122 | expires_at_ms, |
| 123 | }, |
| 124 | ); |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /// Obtain an `OAuth2` access token for a provider using JWT client assertion grant. |
no test coverage detected