1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

storage: make the access token expiration optional

This commit is contained in:
Quentin Gliech
2023-09-11 11:37:06 +02:00
parent e6b91c1ce4
commit 9c97a0c37a
11 changed files with 36 additions and 41 deletions

View File

@ -66,7 +66,8 @@ pub trait OAuth2AccessTokenRepository: Send + Sync {
/// * `clock`: The clock used to generate timestamps
/// * `session`: The session the access token is associated with
/// * `access_token`: The access token to add
/// * `expires_after`: The duration after which the access token expires
/// * `expires_after`: The duration after which the access token expires. If
/// [`None`] the access token never expires
///
/// # Errors
///
@ -77,7 +78,7 @@ pub trait OAuth2AccessTokenRepository: Send + Sync {
clock: &dyn Clock,
session: &Session,
access_token: String,
expires_after: Duration,
expires_after: Option<Duration>,
) -> Result<AccessToken, Self::Error>;
/// Revoke an access token
@ -126,7 +127,7 @@ repository_impl!(OAuth2AccessTokenRepository:
clock: &dyn Clock,
session: &Session,
access_token: String,
expires_after: Duration,
expires_after: Option<Duration>,
) -> Result<AccessToken, Self::Error>;
async fn revoke(