summaryrefslogtreecommitdiff
path: root/tests/dpop-proof-invalid-ath.scm
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2021-08-09 18:46:48 +0200
committerVivien Kraus <vivien@planete-kraus.eu>2021-08-13 01:06:38 +0200
commitded10e28782f289ad3db15320bcf619ab4336876 (patch)
tree32609fd9f1eb0d2f8a23105e09f193827d16a275 /tests/dpop-proof-invalid-ath.scm
parent7b62790238902e10edb83c07286cf0643b097997 (diff)
Switch to a more sensible error reporting system
Diffstat (limited to 'tests/dpop-proof-invalid-ath.scm')
-rw-r--r--tests/dpop-proof-invalid-ath.scm24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/dpop-proof-invalid-ath.scm b/tests/dpop-proof-invalid-ath.scm
index 90cd168..cecd162 100644
--- a/tests/dpop-proof-invalid-ath.scm
+++ b/tests/dpop-proof-invalid-ath.scm
@@ -1,4 +1,4 @@
-;; webid-oidc, implementation of the Solid specification
+;; disfluid, implementation of the Solid specification
;; Copyright (C) 2021 Vivien Kraus
;; This program is free software: you can redistribute it and/or modify
@@ -36,11 +36,11 @@
(issue-access-token
idp-key
#:alg 'RS256
- #:webid "https://data.provider/subject"
- #:iss "https://identity.provider"
+ #:webid (string->uri "https://data.provider/subject")
+ #:iss (string->uri "https://identity.provider")
#:validity 3600
#:client-key jwk
- #:client-id "https://client")))
+ #:client-id (string->uri "https://client"))))
(define proof
(parameterize ((p:current-date 0))
(issue-dpop-proof
@@ -51,14 +51,12 @@
#:access-token "aaaaaaaaaaaaaaa")))
(with-exception-handler
(lambda (error)
- (let ((cause
- ((record-accessor &cannot-decode-dpop-proof 'cause) error)))
- (unless (dpop-invalid-access-token-hash? cause)
- (raise-exception error))
- (unless (and (equal? (dpop-invalid-access-token-hash-hash cause)
- (stubs:hash 'SHA-256 "aaaaaaaaaaaaaaa"))
- (equal? (dpop-invalid-access-token-hash-access-token cause) access-token))
- (exit 1))))
+ (unless (and (dpop-invalid-ath? error)
+ (equal? (dpop-invalid-ath-hash error)
+ (stubs:hash 'SHA-256 "aaaaaaaaaaaaaaa"))
+ (equal? (dpop-invalid-ath-access-token error)
+ access-token))
+ (raise-exception error)))
(lambda ()
(parameterize ((p:current-date 10))
(dpop-proof-decode 'GET
@@ -68,4 +66,4 @@
#:access-token access-token))
(exit 2))
#:unwind? #t
- #:unwind-for-type &cannot-decode-dpop-proof)))
+ #:unwind-for-type &dpop-invalid-ath)))