diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-07-28 16:58:13 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-07-29 18:43:54 +0200 |
commit | 80aff364dbd8d78392582124b51b46b556db7e4c (patch) | |
tree | 85f3331d1f614b1ac9d380c1aceb81a72bafbbdc /src/scm/webid-oidc/program.scm | |
parent | dbd7407c825f9fc0ddbbeba6e7eef6f5430c8cf2 (diff) |
The server supports XML catalogs.
This will be used to set up an integration test suite with HTTPS,
without needing to provide certificates, because the test harness will
have an XML catalog mapping HTTPS targets to local HTTP mockups.
Diffstat (limited to 'src/scm/webid-oidc/program.scm')
-rw-r--r-- | src/scm/webid-oidc/program.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/program.scm b/src/scm/webid-oidc/program.scm index 79f13cb..6b8ad29 100644 --- a/src/scm/webid-oidc/program.scm +++ b/src/scm/webid-oidc/program.scm @@ -24,6 +24,7 @@ #:use-module (webid-oidc server create) #:use-module (webid-oidc jti) #:use-module (webid-oidc offloading) + #:use-module (webid-oidc catalog) #:use-module ((webid-oidc stubs) #:prefix stubs:) #:use-module ((webid-oidc config) #:prefix cfg:) #:use-module (ice-9 optargs) @@ -55,8 +56,20 @@ (define date (date->string (time-utc->date (current-time)))) (define uri-string (if (uri? uri) (uri->string uri) uri)) (with-mutex logging-mutex + (when (getenv "XML_CATALOG_FILES") + (format (current-error-port) "~a: Warning: XML_CATALOG_FILES is set to ~s.\n" + date + (getenv "XML_CATALOG_FILES"))) (format (current-error-port) "~a: GET ~a ~s...\n" date uri-string headers)) + (set! uri (resolve-uri uri + #:http-get + (lambda* (uri . args) + (with-mutex logging-mutex + (format (current-error-port) "~a: Warning: loading XML catalog from the web, ~s.\n" + date + (uri->string uri))) + (apply http-get uri args)))) (receive (response response-body) (in-another-thread (http-get uri #:headers headers)) @@ -399,6 +412,17 @@ Options for the client service:")) (format #t (G_ " Environment variables:")) (format #t (G_ " + XML_CATALOG_FILES: the server will fetch resources on the web. By + setting this environment variable to a space-separated list of + catalog URIs, the server will redirect these requests to another + server. Currently, it is not possible to load files from the + file system, because there is no way to specify the + content-type.")) + (when (getenv "XML_CATALOG_FILES") + (format #t (G_ "the-environment-variable| + It is currently set to ~s.") + (getenv "XML_CATALOG_FILES"))) + (format #t (G_ " LANG: set the locale of the user interface (for the server commands, the user is the system administrator).")) (when (getenv "LANG") |