Skip to content

Commit 0b972c0

Browse files
committed
test: refactor conformance tests
1 parent 498da4d commit 0b972c0

File tree

58 files changed

+123
-120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+123
-120
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('encrypted-idtoken-usingrsa15')) {
4-
test.serial(red(), module, 'failed to decrypt ID Token')
4+
test.serial(rejects(flow()), module, 'failed to decrypt ID Token')
55
}

conformance/fapi/encrypted-idtoken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('encrypted-idtoken')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-authorization-response-with-invalid-missing-state-fails')) {
4-
test.serial(red({ useState: true }), module, 'response parameter "state" missing')
4+
test.serial(rejects(flow({ useState: true })), module, 'response parameter "state" missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-authorization-response-with-invalid-state-fails')) {
4-
test.serial(red(), module, 'unexpected "state" response parameter encountered')
4+
test.serial(rejects(flow()), module, 'unexpected "state" response parameter encountered')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-signature-is-not-none')) {
4-
test.serial(red(), module, 'unexpected JWT "alg" header parameter')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "alg" header parameter')
55
}

conformance/fapi/ensure-jarm-with-expired-exp-fails.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-with-expired-exp-fails')) {
44
test.serial(
5-
red(),
5+
rejects(flow()),
66
module,
77
'unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()',
88
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-with-invalid-aud-fails')) {
4-
test.serial(red(), module, 'unexpected JWT "aud" (audience) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "aud" (audience) claim value')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-with-invalid-iss-fails')) {
4-
test.serial(red(), module, 'unexpected JWT "iss" (issuer) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "iss" (issuer) claim value')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-with-invalid-sig-fails')) {
4-
test.serial(red(), module, 'JWT signature verification failed')
4+
test.serial(rejects(flow()), module, 'JWT signature verification failed')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-without-aud-fails')) {
4-
test.serial(red(), module, 'JWT "aud" (audience) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "aud" (audience) claim missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-without-exp-fails')) {
4-
test.serial(red(), module, 'JWT "exp" (expiration time) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "exp" (expiration time) claim missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('ensure-jarm-without-iss-fails')) {
4-
test.serial(red(), module, 'JWT "iss" (issuer) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "iss" (issuer) claim missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('fapi1-advanced-final-client-test')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}

conformance/fapi/happy-path.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('happy-path')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}

conformance/fapi/iat-is-week-in-past.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, red, modules, variant } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('iat-is-week-in-past')) {
44
test.serial(
5-
red(),
5+
rejects(flow()),
66
module,
77
'unexpected JWT "iat" (issued at) claim value, it is too far in the past',
88
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-alternate-alg')) {
4-
test.serial(red(), module, 'unexpected JWT "alg" header parameter')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "alg" header parameter')
55
}

conformance/fapi/invalid-aud.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-aud')) {
4-
test.serial(red(), module, 'unexpected JWT "aud" (audience) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "aud" (audience) claim value')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-authorization-response-iss')) {
4-
test.serial(red(), module, 'unexpected "iss" (issuer) response parameter value')
4+
test.serial(rejects(flow()), module, 'unexpected "iss" (issuer) response parameter value')
55
}

conformance/fapi/invalid-chash.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-chash')) {
4-
test.serial(red(), module, 'invalid ID Token "c_hash" (code hash) claim value')
4+
test.serial(rejects(flow()), module, 'invalid ID Token "c_hash" (code hash) claim value')
55
}

conformance/fapi/invalid-expired-exp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-expired-exp')) {
44
test.serial(
5-
red(),
5+
rejects(flow()),
66
module,
77
'unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()',
88
'OperationProcessingError',

conformance/fapi/invalid-iss.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-iss')) {
4-
test.serial(red(), module, 'unexpected JWT "iss" (issuer) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "iss" (issuer) claim value')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-missing-aud')) {
4-
test.serial(red(), module, 'JWT "aud" (audience) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "aud" (audience) claim missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-missing-exp')) {
4-
test.serial(red(), module, 'JWT "exp" (expiration time) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "exp" (expiration time) claim missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-missing-iss')) {
4-
test.serial(red(), module, 'JWT "iss" (issuer) claim missing')
4+
test.serial(rejects(flow()), module, 'JWT "iss" (issuer) claim missing')
55
}

conformance/fapi/invalid-missing-nonce.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, red, modules, plan, variant } from '../runner.js'
1+
import { test, rejects, flow, modules, plan, variant } from '../runner.js'
22

33
for (const module of modules('invalid-missing-nonce')) {
44
test.serial(
5-
red({ useNonce: true }),
5+
rejects(flow({ useNonce: true })),
66
module,
77
plan.name.startsWith('fapi1') && variant.fapi_response_mode !== 'jarm'
88
? 'JWT "nonce" (nonce) claim missing'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-missing-shash')) {
4-
test.serial(red({ useState: true }), module, 'JWT "s_hash" (state hash) claim missing')
4+
test.serial(rejects(flow({ useState: true })), module, 'JWT "s_hash" (state hash) claim missing')
55
}

conformance/fapi/invalid-nonce.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-nonce')) {
4-
test.serial(red(), module, 'unexpected ID Token "nonce" claim value')
4+
test.serial(rejects(flow()), module, 'unexpected ID Token "nonce" claim value')
55
}

conformance/fapi/invalid-null-alg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-null-alg')) {
4-
test.serial(red(), module, 'unexpected JWT "alg" header parameter')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "alg" header parameter')
55
}

conformance/fapi/invalid-secondary-aud.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-secondary-aud')) {
44
test.serial(
5-
red(),
5+
rejects(flow()),
66
module,
77
'unexpected ID Token "azp" (authorized party) claim value',
88
'OperationProcessingError',

conformance/fapi/invalid-shash.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-shash')) {
4-
test.serial(red({ useState: true }), module, 'invalid ID Token "s_hash" (state hash) claim value')
4+
test.serial(
5+
rejects(flow({ useState: true })),
6+
module,
7+
'invalid ID Token "s_hash" (state hash) claim value',
8+
)
59
}

conformance/fapi/invalid-signature.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, skippable, modules } from '../runner.js'
1+
import { test, skippable, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-signature')) {
4-
test.serial(skippable(), module)
4+
test.serial(skippable(flow()), module)
55
}

conformance/fapi/missing-athash.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('missing-athash')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('no-scope-in-token-endpoint-response')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('remove-authorization-response-iss')) {
4-
test.serial(red(), module, 'response parameter "iss" (issuer) missing')
4+
test.serial(rejects(flow()), module, 'response parameter "iss" (issuer) missing')
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('token-endpoint-response-without-expires_in')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('token-type-case-insensitivity')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('valid-aud-as-array')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { plan, test, green, modules } from '../runner.js'
1+
import { plan, test, flow, modules } from '../runner.js'
22

33
if (plan.name === 'oidcc-client-test-plan') {
44
test.todo('client-secret-basic')
55
} else {
66
for (const module of modules('client-secret-basic')) {
7-
test.serial(green(), module)
7+
test.serial(flow(), module)
88
}
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('discovery-issuer-mismatch')) {
4-
test.serial(red(), module, '"response" body "issuer" does not match "expectedIssuer"')
4+
test.serial(rejects(flow()), module, '"response" body "issuer" does not match "expectedIssuer"')
55
}

conformance/oidc/idtoken-sig-none.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('idtoken-sig-none')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}

conformance/oidc/idtoken-sig-rs256.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('idtoken-sig-rs256')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}

conformance/oidc/invalid-aud.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-aud')) {
4-
test.serial(red(), module, 'unexpected JWT "aud" (audience) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "aud" (audience) claim value')
55
}

conformance/oidc/invalid-iss.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, red, modules } from '../runner.js'
1+
import { test, rejects, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-iss')) {
4-
test.serial(red(), module, 'unexpected JWT "iss" (issuer) claim value')
4+
test.serial(rejects(flow()), module, 'unexpected JWT "iss" (issuer) claim value')
55
}

conformance/oidc/invalid-sig-es256.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, skippable, modules } from '../runner.js'
1+
import { test, skippable, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-sig-es256')) {
4-
test.serial(skippable(), module)
4+
test.serial(skippable(flow()), module)
55
}

conformance/oidc/invalid-sig-hs256.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, skippable, modules } from '../runner.js'
1+
import { test, skippable, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-sig-hs256')) {
4-
test.serial(skippable(), module)
4+
test.serial(skippable(flow()), module)
55
}

conformance/oidc/invalid-sig-rs256.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, skippable, modules } from '../runner.js'
1+
import { test, skippable, flow, modules } from '../runner.js'
22

33
for (const module of modules('invalid-sig-rs256')) {
4-
test.serial(skippable(), module)
4+
test.serial(skippable(flow()), module)
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { test, green, modules } from '../runner.js'
1+
import { test, flow, modules } from '../runner.js'
22

33
for (const module of modules('kid-absent-multiple-jwks')) {
4-
test.serial(green(), module)
4+
test.serial(flow(), module)
55
}

0 commit comments

Comments
 (0)