-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,29 @@ | ||
use super::E2eiEnrollment; | ||
use crate::prelude::{E2eIdentityError, E2eIdentityResult, MlsCentral}; | ||
use crate::CryptoResult; | ||
use zeroize::Zeroize; | ||
|
||
/// An OIDC refresh token managed by CoreCrypto to benefir from encryption-at-rest | ||
#[derive(Debug, serde::Serialize, serde::Deserialize, Zeroize, derive_more::From, derive_more::Deref)] | ||
#[zeroize(drop)] | ||
pub struct RefreshToken(String); | ||
|
||
impl E2eiEnrollment { | ||
/// Lets clients retrieve the OIDC refresh token to try to renew the user's authorization. | ||
/// If it's expired, the user needs to reauthenticate and they will update the refresh token | ||
/// in [E2eiEnrollment::new_oidc_challenge_request] | ||
pub fn get_refresh_token(&self) -> E2eIdentityResult<&str> { | ||
self.refresh_token | ||
.as_ref() | ||
.map(|rt| rt.as_str()) | ||
.ok_or(E2eIdentityError::OutOfOrderEnrollment( | ||
"No OIDC refresh token registered yet", | ||
)) | ||
} | ||
} | ||
|
||
impl MlsCentral { | ||
pub(crate) fn find_refresh_token(&self) -> CryptoResult<RefreshToken> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,7 @@ pub mod tests { | |
&backend, | ||
e.ciphersuite, | ||
None, | ||
None, | ||
) | ||
.unwrap(); | ||
(enrollment, cc) | ||
|