From 55195e4659339f56036c2f98d06cfd59a0141514 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Fri, 17 Sep 2021 18:31:01 +0200 Subject: JWK: the default signature algorithm "alg" is now a key parameter --- tests/authorization-endpoint-get-form.scm | 3 +-- tests/authorization-endpoint-no-args.scm | 3 +-- tests/authorization-endpoint-submit-form.scm | 3 +-- tests/dpop-proof-iat-in-future.scm | 1 - tests/dpop-proof-iat-too-late.scm | 1 - tests/dpop-proof-invalid-ath.scm | 2 -- tests/dpop-proof-no-ath.scm | 1 - tests/dpop-proof-replay.scm | 1 - tests/dpop-proof-valid-ath.scm | 2 -- tests/dpop-proof-valid.scm | 1 - tests/dpop-proof-wrong-htm.scm | 1 - tests/dpop-proof-wrong-htu.scm | 1 - tests/dpop-proof-wrong-key.scm | 1 - tests/resource-server.scm | 2 -- tests/token-endpoint-issue.scm | 6 +----- tests/token-endpoint-refresh.scm | 5 +---- 16 files changed, 5 insertions(+), 29 deletions(-) (limited to 'tests') diff --git a/tests/authorization-endpoint-get-form.scm b/tests/authorization-endpoint-get-form.scm index 7dbf6ba..6830df8 100644 --- a/tests/authorization-endpoint-get-form.scm +++ b/tests/authorization-endpoint-get-form.scm @@ -29,7 +29,6 @@ (with-test-environment "authorization-endpoint-get-form" (lambda () - (define alg 'RS256) (define key (generate-key #:n-size 2048)) (define subject (string->uri "https://authorization-endpoint-get-form.scm/profile/card#me")) (define password "p4ssw0rd") @@ -38,7 +37,7 @@ (exit 2)) (define endpoint (make-authorization-endpoint - subject password alg key validity + subject password key validity #:http-get http-get)) (receive (response response-body) (parameterize ((p:current-date 0)) diff --git a/tests/authorization-endpoint-no-args.scm b/tests/authorization-endpoint-no-args.scm index e996db3..a9661cd 100644 --- a/tests/authorization-endpoint-no-args.scm +++ b/tests/authorization-endpoint-no-args.scm @@ -29,7 +29,6 @@ (with-test-environment "authorization-endpoint-no-args" (lambda () - (define alg 'RS256) (define key (generate-key #:n-size 2048)) (define subject (string->uri "https://authorization-endpoint-get-form.scm/profile/card#me")) (define password "p4ssw0rd") @@ -38,7 +37,7 @@ (exit 2)) (define endpoint (make-authorization-endpoint - subject password alg key validity + subject password key validity #:http-get http-get)) (receive (response response-body) (parameterize ((p:current-date 0)) diff --git a/tests/authorization-endpoint-submit-form.scm b/tests/authorization-endpoint-submit-form.scm index ef84f40..37059fe 100644 --- a/tests/authorization-endpoint-submit-form.scm +++ b/tests/authorization-endpoint-submit-form.scm @@ -33,7 +33,6 @@ (with-test-environment "authorization-endpoint-submit-form" (lambda () - (define alg 'RS256) (define key (generate-key #:n-size 2048)) (define subject (string->uri "https://authorization-endpoint-submit-form.scm/profile/card#me")) (define client (string->uri "https://authorization-endpoint-submit-form.scm/client/card#app")) @@ -58,7 +57,7 @@ (with-cache #:http-get http-get)) (define endpoint (make-authorization-endpoint - subject encrypted-password alg key validity + subject encrypted-password key validity #:http-get cached-http-get)) (receive (response response-body) ;; The password is fake! diff --git a/tests/dpop-proof-iat-in-future.scm b/tests/dpop-proof-iat-in-future.scm index d7f345b..f212643 100644 --- a/tests/dpop-proof-iat-in-future.scm +++ b/tests/dpop-proof-iat-in-future.scm @@ -34,7 +34,6 @@ (parameterize ((p:current-date 10)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag")))) (with-exception-handler diff --git a/tests/dpop-proof-iat-too-late.scm b/tests/dpop-proof-iat-too-late.scm index 7cf2146..149e814 100644 --- a/tests/dpop-proof-iat-too-late.scm +++ b/tests/dpop-proof-iat-too-late.scm @@ -34,7 +34,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag")))) (with-exception-handler diff --git a/tests/dpop-proof-invalid-ath.scm b/tests/dpop-proof-invalid-ath.scm index cecd162..a82cf47 100644 --- a/tests/dpop-proof-invalid-ath.scm +++ b/tests/dpop-proof-invalid-ath.scm @@ -35,7 +35,6 @@ (parameterize ((p:current-date 10)) (issue-access-token idp-key - #:alg 'RS256 #:webid (string->uri "https://data.provider/subject") #:iss (string->uri "https://identity.provider") #:validity 3600 @@ -45,7 +44,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res?query") #:access-token "aaaaaaaaaaaaaaa"))) diff --git a/tests/dpop-proof-no-ath.scm b/tests/dpop-proof-no-ath.scm index 3d87368..ec37836 100644 --- a/tests/dpop-proof-no-ath.scm +++ b/tests/dpop-proof-no-ath.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res?query")))) (with-exception-handler diff --git a/tests/dpop-proof-replay.scm b/tests/dpop-proof-replay.scm index 71cabe5..19e6a30 100644 --- a/tests/dpop-proof-replay.scm +++ b/tests/dpop-proof-replay.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag")))) (define (decode) diff --git a/tests/dpop-proof-valid-ath.scm b/tests/dpop-proof-valid-ath.scm index d916dcd..2a27e88 100644 --- a/tests/dpop-proof-valid-ath.scm +++ b/tests/dpop-proof-valid-ath.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 10)) (issue-access-token idp-key - #:alg 'RS256 #:webid (string->uri "https://data.provider/subject") #:iss (string->uri "https://identity.provider") #:validity 3600 @@ -43,7 +42,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag") #:access-token access-token))) diff --git a/tests/dpop-proof-valid.scm b/tests/dpop-proof-valid.scm index 893687d..71ef602 100644 --- a/tests/dpop-proof-valid.scm +++ b/tests/dpop-proof-valid.scm @@ -32,7 +32,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag")))) (define decoded diff --git a/tests/dpop-proof-wrong-htm.scm b/tests/dpop-proof-wrong-htm.scm index 204e87a..1e94f72 100644 --- a/tests/dpop-proof-wrong-htm.scm +++ b/tests/dpop-proof-wrong-htm.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'POST #:htu (string->uri "https://example.com/res#frag")))) (with-exception-handler diff --git a/tests/dpop-proof-wrong-htu.scm b/tests/dpop-proof-wrong-htu.scm index 05bdea5..299060e 100644 --- a/tests/dpop-proof-wrong-htu.scm +++ b/tests/dpop-proof-wrong-htu.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/other-res#frag")))) (with-exception-handler diff --git a/tests/dpop-proof-wrong-key.scm b/tests/dpop-proof-wrong-key.scm index ca1e01b..1f3d033 100644 --- a/tests/dpop-proof-wrong-key.scm +++ b/tests/dpop-proof-wrong-key.scm @@ -33,7 +33,6 @@ (parameterize ((p:current-date 0)) (issue-dpop-proof jwk - #:alg 'RS256 #:htm 'GET #:htu (string->uri "https://example.com/res#frag")))) (with-exception-handler diff --git a/tests/resource-server.scm b/tests/resource-server.scm index 4df742f..02b7e46 100644 --- a/tests/resource-server.scm +++ b/tests/resource-server.scm @@ -59,7 +59,6 @@ (parameterize ((p:current-date 10)) (issue-access-token idp-key - #:alg 'RS256 #:webid subject #:iss (string->uri "https://identity.provider") #:validity 3600 @@ -72,7 +71,6 @@ (parameterize ((p:current-date 15)) (issue-dpop-proof client-key - #:alg 'RS256 #:htm method #:htu uri #:access-token access-token))) diff --git a/tests/token-endpoint-issue.scm b/tests/token-endpoint-issue.scm index 3b21f9b..c80658c 100644 --- a/tests/token-endpoint-issue.scm +++ b/tests/token-endpoint-issue.scm @@ -35,7 +35,6 @@ (with-test-environment "token-endpoint-issue" (lambda () - (define alg 'RS256) (define key (generate-key #:n-size 2048)) (define client-key (generate-key #:n-size 2048)) (define subject (string->uri "https://token-endpoint-issue.scm/profile/card#me")) @@ -46,21 +45,19 @@ (parameterize ((p:current-date 0)) (issue-authorization-code key - #:alg alg #:validity 120 #:webid subject #:client-id client))) (define endpoint (make-token-endpoint (string->uri "https://token-endpoint-issue.scm/token") - issuer alg key validity)) + issuer key validity)) (receive (response response-body . _) ;; The code is fake! (let ((dpop (parameterize ((p:current-date 0)) (issue-dpop-proof client-key - #:alg alg #:htm 'POST #:htu (string->uri "https://token-endpoint-issue.scm/token"))))) @@ -80,7 +77,6 @@ (parameterize ((p:current-date 10)) (issue-dpop-proof client-key - #:alg alg #:htm 'POST #:htu (string->uri "https://token-endpoint-issue.scm/token"))))) diff --git a/tests/token-endpoint-refresh.scm b/tests/token-endpoint-refresh.scm index 2d5ece4..f14d648 100644 --- a/tests/token-endpoint-refresh.scm +++ b/tests/token-endpoint-refresh.scm @@ -35,7 +35,6 @@ (with-test-environment "token-endpoint-refresh" (lambda () - (define alg 'RS256) (define key (generate-key #:n-size 2048)) (define client-key (generate-key #:n-size 2048)) (define subject (string->uri "https://token-endpoint-issue.scm/profile/card#me")) @@ -46,14 +45,13 @@ (issue-refresh-token subject client (jkt client-key))) (define endpoint (make-token-endpoint (string->uri "https://token-endpoint-issue.scm/token") - issuer alg key validity)) + issuer key validity)) (receive (response response-body . _) ;; The refresh token is fake! (let ((dpop (parameterize ((p:current-date 0)) (issue-dpop-proof client-key - #:alg alg #:htm 'POST #:htu (string->uri "https://token-endpoint-issue.scm/token"))))) @@ -73,7 +71,6 @@ (parameterize ((p:current-date 10)) (issue-dpop-proof client-key - #:alg alg #:htm 'POST #:htu (string->uri "https://token-endpoint-issue.scm/token"))))) -- cgit v1.2.3