diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-09-22 13:11:21 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-09-22 18:08:47 +0200 |
commit | 555e59deba33284067298ce6130c379c75e3d2a3 (patch) | |
tree | c15c823913e917bc474f1cf163caf65a117ee9c3 /src/scm/webid-oidc/client.scm | |
parent | 0d74f8c1ca9c1e9bf9a04b85f598ba7a175d1d86 (diff) |
Use anonymous-http-request from (webid-oidc parameters) everywhere
Diffstat (limited to 'src/scm/webid-oidc/client.scm')
-rw-r--r-- | src/scm/webid-oidc/client.scm | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/scm/webid-oidc/client.scm b/src/scm/webid-oidc/client.scm index 2c16fb1..7eb8fe3 100644 --- a/src/scm/webid-oidc/client.scm +++ b/src/scm/webid-oidc/client.scm @@ -27,7 +27,6 @@ #:use-module ((webid-oidc client accounts) #:prefix account:) #:use-module ((webid-oidc client client) #:prefix client:) #:use-module (web uri) - #:use-module (web client) #:use-module (web request) #:use-module (web response) #:use-module (web server) @@ -54,7 +53,6 @@ (client:client . client) (account:authorization-process . authorization-process) (account:authorization-state . authorization-state) - (account:anonymous-http-request . anonymous-http-request) (client:->sexp . ->sexp) ) @@ -106,25 +104,9 @@ ((value port) (original-writer value port)))))) -(define default-http-get-with-cache - (cache:with-cache)) - -(define* (default-http-request uri . all-args) - (let try-get-with-cache ((args all-args)) - (match args - ((#:headers _) - (apply default-http-get-with-cache all-args)) - ((#:headers _ other-args ...) - (try-get-with-cache other-args)) - (else - (apply http-request all-args))))) - -(define* (initial-login client issuer - #:key - (http-request default-http-request)) +(define* (initial-login client issuer) (setup-headers!) - (parameterize ((account:anonymous-http-request default-http-request) - (client:client client)) + (parameterize ((client:client client)) (make <account:account> #:issuer issuer))) @@ -147,7 +129,7 @@ (authorization . (dpop . ,access-token)) ,@headers))) (receive (response body) - (apply (account:anonymous-http-request) uri + (apply (p:anonymous-http-request) uri #:headers all-headers non-header-args) (let ((code (response-code response))) |