1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Implement Clone on ClientCredentials

This commit is contained in:
Kévin Commaille
2023-01-01 16:45:55 +01:00
committed by Quentin Gliech
parent ecf101fe2d
commit d0c5eb3741
3 changed files with 9 additions and 14 deletions

View File

@ -130,7 +130,7 @@ fn id_token(issuer: &str) -> (IdToken, PublicJsonWebKeySet) {
fn client_credentials(
auth_method: OAuthClientAuthenticationMethod,
issuer: &Url,
custom_signing: Option<Box<JwtSigningFn>>,
custom_signing: Option<JwtSigningFn>,
) -> ClientCredentials {
match auth_method {
OAuthClientAuthenticationMethod::None => ClientCredentials::None {

View File

@ -372,7 +372,7 @@ async fn pass_private_key_jwt_with_custom_signing() {
let client_credentials = client_credentials(
OAuthClientAuthenticationMethod::PrivateKeyJwt,
&issuer,
Some(Box::new(|_claims, _alg| Ok("fake.signed.jwt".to_owned()))),
Some(|_claims, _alg| Ok("fake.signed.jwt".to_owned())),
);
let token_endpoint = issuer.join("token").unwrap();
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42);
@ -441,7 +441,7 @@ async fn fail_private_key_jwt_with_custom_signing() {
let client_credentials = client_credentials(
OAuthClientAuthenticationMethod::PrivateKeyJwt,
&issuer,
Some(Box::new(|_claims, _alg| Err("Something went wrong".into()))),
Some(|_claims, _alg| Err("Something went wrong".into())),
);
let token_endpoint = issuer.join("token").unwrap();
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42);