Skip to content

Commit 0b75f00

Browse files
author
dtsiflit
committed
[fix] attestation based unit test updates
1 parent b03d885 commit 0b75f00

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Sources/Main/AttestationBasedClient/ClientAttestation.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public struct ClientAttestationJWT {
3939

4040
/*
4141
guard payload[JWTClaimNames.subject].string != nil else {
42-
throw AttestationError.missingSubject
42+
throw ClientAttestationError.missingSubject
4343
}
4444
*/
4545

@@ -50,11 +50,10 @@ public struct ClientAttestationJWT {
5050
guard cnf[JWTClaimNames.JWK] != nil else {
5151
throw ClientAttestationError.missingJwkClaim
5252
}
53-
/*
54-
guard payload[JWTClaimNames.expirationTime].string != nil else {
55-
throw AttestationError.missingExpirationClaim
53+
54+
guard payload[JWTClaimNames.expirationTime].number != nil else {
55+
throw ClientAttestationError.missingExpirationClaim
5656
}
57-
*/
5857
}
5958

6059
public var clientId: ClientId {

Tests/Helpers/SelfSignedClientAttestation.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ internal func selfSignedClient(
3939
let payload: Payload = try! .init([
4040
"iss": clientId,
4141
"clientId": clientId,
42+
"sub": clientId,
43+
"exp": 1800000000,
4244
"cnf": [
4345
"jwk": ECPublicKey(
4446
publicKey: try! KeyController.generateECDHPublicKey(

0 commit comments

Comments
 (0)