diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-08-01 14:51:28 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-08-01 18:08:56 +0200 |
commit | bae1843f1a1d644fb3bd4f8c40b1dbb900aa3325 (patch) | |
tree | 00f590033af904a6a493e41bdebe9b3ddd73043b /tests/dpop-proof-wrong-htm.scm | |
parent | d8c2ca930673da858d63f2dea9526c259a2dd936 (diff) |
Use guile parameters
With parameters, the API does not need to care about the directory
where to load files and how to get the time.
Diffstat (limited to 'tests/dpop-proof-wrong-htm.scm')
-rw-r--r-- | tests/dpop-proof-wrong-htm.scm | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/dpop-proof-wrong-htm.scm b/tests/dpop-proof-wrong-htm.scm index eaedfe5..1b30161 100644 --- a/tests/dpop-proof-wrong-htm.scm +++ b/tests/dpop-proof-wrong-htm.scm @@ -19,6 +19,7 @@ (webid-oidc jwk) (webid-oidc testing) (webid-oidc errors) + ((webid-oidc parameters) #:prefix p:) (web uri) (srfi srfi-19) (web response)) @@ -28,26 +29,24 @@ (lambda () (define jwk (generate-key #:n-size 2048)) (define cnf (jkt jwk)) - (define blacklist (make-jti-list)) (define proof - (issue-dpop-proof - jwk - #:alg 'RS256 - #:htm 'POST - #:htu (string->uri "https://example.com/res#frag") - #:iat (time-utc->date (make-time time-utc 0 0)))) + (parameterize ((p:current-date 0)) + (issue-dpop-proof + jwk + #:alg 'RS256 + #:htm 'POST + #:htu (string->uri "https://example.com/res#frag")))) (with-exception-handler (lambda (error) (unless ((record-predicate &dpop-method-mismatch) ((record-accessor &cannot-decode-dpop-proof 'cause) error)) (raise-exception error))) (lambda () - (dpop-proof-decode (time-utc->date (make-time time-utc 0 10)) - blacklist - 'GET - (string->uri "https://example.com/res?query") - proof - cnf) + (parameterize ((p:current-date 10)) + (dpop-proof-decode 'GET + (string->uri "https://example.com/res?query") + proof + cnf)) (exit 2)) #:unwind? #t #:unwind-for-type &cannot-decode-dpop-proof))) |