diff options
Diffstat (limited to 'tests/client-manifest.scm')
-rw-r--r-- | tests/client-manifest.scm | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/client-manifest.scm b/tests/client-manifest.scm index 7f8e130..9aa32b5 100644 --- a/tests/client-manifest.scm +++ b/tests/client-manifest.scm @@ -24,7 +24,10 @@ #:use-module (srfi srfi-19) #:use-module (web response) #:use-module (ice-9 optargs) - #:use-module (ice-9 receive)) + #:use-module (ice-9 receive) + #:use-module (oop goops) + #:declarative? #t + #:duplicates (merge-generics)) (with-test-environment "client-manifest" @@ -59,38 +62,34 @@ (lambda () (define mf (parameterize ((p:current-date 0)) - (get-client-manifest - (string->uri "https://app.example.com/id#app")))) - (define id (client-manifest-client-id mf)) + (make <client-manifest> + #:client-id "https://app.example.com/id#app"))) + (define id (client-id mf)) (unless (equal? id (string->uri "https://app.example.com/id#app")) (exit 3)) - (unless (client-manifest-check-redirect-uri mf "https://app.example.com/callback") + (unless (check-redirect-uri mf "https://app.example.com/callback") (exit 4)) (with-exception-handler (lambda (error) (unless (unauthorized-redirect-uri? error) (exit 5))) (lambda () - (client-manifest-check-redirect-uri mf "https://fraudulent-app.example.com/callback") + (check-redirect-uri mf "https://fraudulent-app.example.com/callback") (exit 55)) #:unwind? #t #:unwind-for-type &unauthorized-redirect-uri) (receive (response response-body) - (serve-client-manifest - (time-utc->date (make-time time-utc 0 3600)) - mf) + (serve mf (time-utc->date (make-time time-utc 0 3600))) (unless (equal? (response-content-type response) '(application/ld+json)) (exit 6)) (set! what-to-respond response) (set! what-to-respond-body response-body) (let ((re-parsed (parameterize ((p:current-date 10)) - (get-client-manifest - (string->uri "https://app.example.com/id#app"))))) + (make <client-manifest> + #:client-id "https://app.example.com/id#app")))) (map (lambda (key) (unless (equal? (assq-ref mf key) (assq-ref re-parsed key)) (exit 9))) - '(client_id redirect_uris client_name client_uri - logo_uri tos_uri scope grant_types response_types - default_max_age require_auth_time))))))))) + '(client_id redirect_uris))))))))) |