Skip to content

Commit 1c552aa

Browse files
committed
fix: add team parameter to verify_access_token
This function is exclusively used in the tests and previously the team was defaulting to always be None, which will now fail because of to the more strict team comparision introduced in the previous commit.
1 parent 0024daf commit 1c552aa

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

e2e-identity/tests/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ fn e2e_api() {
277277
&client_id,
278278
&handle,
279279
display_name,
280+
&team.into(),
280281
challenge,
281282
leeway,
282283
max_expiry,

jwt/src/access/verify.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl RustyJwtTools {
2929
/// of base64url characters (header, claims, signature) separated by period characters.
3030
/// ex: b"eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJqb2UiLA0KICJleiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk" (whitespace in the example is not included in the actual proof)
3131
/// * `client_id` - see [ClientId]
32+
/// * `team` - see [Team]
3233
/// * `challenge` - The most recent challenge nonce provided by the ACME server to the current client ex: hex!("71515234fac0b04b2008db62551e7287")
3334
/// * `max_skew_secs` - The maximum number of seconds of clock skew the implementation will allow ex: 360 (5 min)
3435
/// * `max_expiration` - The maximal expiration date and time, in seconds since epoch ex: 1668987368
@@ -42,6 +43,7 @@ impl RustyJwtTools {
4243
client_id: &ClientId,
4344
handle: &QualifiedHandle,
4445
display_name: &str,
46+
team: &Team,
4547
challenge: AcmeNonce,
4648
max_skew_secs: u16,
4749
max_expiration: u64,
@@ -61,6 +63,7 @@ impl RustyJwtTools {
6163
client_id,
6264
handle,
6365
display_name,
66+
team,
6467
&challenge,
6568
max_expiration,
6669
issuer,
@@ -91,6 +94,7 @@ impl RustyJwtTools {
9194
client_id: &ClientId,
9295
handle: &QualifiedHandle,
9396
display_name: &str,
97+
team: &Team,
9498
challenge: &AcmeNonce,
9599
max_expiration: u64,
96100
issuer: Htu,
@@ -144,7 +148,7 @@ impl RustyJwtTools {
144148
client_id,
145149
handle,
146150
display_name,
147-
&None.into(),
151+
team,
148152
&nonce,
149153
Some(&claims.custom.challenge),
150154
None,
@@ -1606,6 +1610,7 @@ pub mod tests {
16061610
pub client_id: ClientId,
16071611
pub handle: QualifiedHandle,
16081612
pub display_name: String,
1613+
pub team: Team,
16091614
pub challenge: AcmeNonce,
16101615
pub leeway: u16,
16111616
pub max_expiration: u64,
@@ -1622,6 +1627,7 @@ pub mod tests {
16221627
client_id: ClientId::default(),
16231628
handle: QualifiedHandle::default(),
16241629
display_name: "John Doe".to_string(),
1630+
team: Team::default(),
16251631
challenge: AcmeNonce::default(),
16261632
leeway: 5,
16271633
max_expiration: 2136351646, // somewhere in 2037
@@ -1639,6 +1645,7 @@ pub mod tests {
16391645
client_id,
16401646
handle,
16411647
display_name,
1648+
team,
16421649
challenge,
16431650
leeway,
16441651
max_expiration,
@@ -1674,6 +1681,7 @@ pub mod tests {
16741681
&client_id,
16751682
&handle,
16761683
&display_name,
1684+
&team,
16771685
challenge,
16781686
leeway,
16791687
max_expiration,

jwt/tests/e2e.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn e2e_jwt() {
9898
&alice,
9999
&handle,
100100
display_name,
101+
&team.into(),
101102
challenge,
102103
leeway,
103104
max_expiration,

0 commit comments

Comments
 (0)