From d9f183614b1516834f648cc0269cd62a49154c18 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Sun, 9 May 2021 22:26:23 +0200 Subject: Define the web pages for the authorization endpoint --- tests/Makefile.am | 5 +++-- tests/unknown-client-locale.scm | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 tests/unknown-client-locale.scm (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 1a23201..6a0eb0d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -29,9 +29,10 @@ TESTS = %reldir%/load-library.scm \ %reldir%/client-manifest-fraudulent.scm \ %reldir%/refresh-token.scm \ %reldir%/too-many-refresh-tokens.scm \ - %reldir%/refresh-token-with-wrong-key.scm + %reldir%/refresh-token-with-wrong-key.scm \ + %reldir%/unknown-client-locale.scm -EXTRA_DIST += $(TESTS) +EXTRA_DIST += $(TESTS) %reldir%/ChangeLog TEST_EXTENSIONS = .scm diff --git a/tests/unknown-client-locale.scm b/tests/unknown-client-locale.scm new file mode 100644 index 0000000..fcd84da --- /dev/null +++ b/tests/unknown-client-locale.scm @@ -0,0 +1,29 @@ +(use-modules (webid-oidc authorization-page) + (webid-oidc testing) + (webid-oidc errors) + (web uri) + (srfi srfi-19) + (web response) + (ice-9 optargs) + (ice-9 receive)) + +(with-test-environment + "unknown-client-locale" + (lambda () + (let ((problem-acknowledged #f)) + (receive (response response-body) + (with-exception-handler + (lambda (error) + (unless ((record-predicate &unknown-client-locale) error) + (format (current-error-port) "Huh... ~a\n" (error->str error)) + (exit 1)) + (set! problem-acknowledged #t)) + (lambda () + (authorization-page "qdfkljsmfklsjmf" #f + (string->uri "https://example.com") + (string->uri "https://example.com")))) + (unless (eqv? (response-code response) 200) + (exit 2)) + (unless problem-acknowledged + (exit 3)) + (format (current-error-port) "~a" response-body))))) -- cgit v1.2.3