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/jws.scm | |
parent | 0d74f8c1ca9c1e9bf9a04b85f598ba7a175d1d86 (diff) |
Use anonymous-http-request from (webid-oidc parameters) everywhere
Diffstat (limited to 'src/scm/webid-oidc/jws.scm')
-rw-r--r-- | src/scm/webid-oidc/jws.scm | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/src/scm/webid-oidc/jws.scm b/src/scm/webid-oidc/jws.scm index bfb941f..e0eba54 100644 --- a/src/scm/webid-oidc/jws.scm +++ b/src/scm/webid-oidc/jws.scm @@ -225,7 +225,7 @@ (define-method (default-validity (token <oidc-token>)) (let ((next (next-method)) - (mine 3600)) + (mine (p:oidc-token-default-validity))) (if (and next (< next mine)) next mine))) @@ -264,7 +264,7 @@ (define-method (default-validity (token <single-use-token>)) (let ((next (next-method)) - (mine 120)) + (mine (p:authorization-code-default-validity))) (if (and next (< next mine)) next mine))) @@ -470,43 +470,37 @@ #:neutral (list '()))) (define-method (lookup-keys (token <oidc-token>) args) - (let-keywords - args #f - ((http-request (p:anonymous-http-request))) - (let ((iss (iss token))) - (let ((cfg - (with-exception-handler - (lambda (error) - (let ((final-message - (if (exception-with-message? error) - (format #f (G_ "I cannot query the identity provider configuration: ~a") - (exception-message error)) - (format #f (G_ "I cannot query the identity provider configuration"))))) - (raise-exception - (make-exception - (make-cannot-query-identity-provider iss) - (make-exception-with-message final-message) - error)))) - (lambda () - (make <oidc-configuration> - #:server iss - #:http-request http-request))))) - (with-exception-handler - (lambda (error) - (raise-exception - (make-exception - (make-cannot-query-identity-provider iss) - (make-exception-with-message - (if (exception-with-message? error) - (format #f (G_ "I cannot query the JWKS URI of the identity provider: ~a") - (exception-message error)) - (format #f (G_ "I cannot query the JWKS URI of the identity provider"))))))) - (lambda () - (append - (keys (next-method)) - (keys - (parameterize ((p:anonymous-http-request http-request)) - (jwks cfg)))))))))) + (let ((iss (iss token))) + (let ((cfg + (with-exception-handler + (lambda (error) + (let ((final-message + (if (exception-with-message? error) + (format #f (G_ "I cannot query the identity provider configuration: ~a") + (exception-message error)) + (format #f (G_ "I cannot query the identity provider configuration"))))) + (raise-exception + (make-exception + (make-cannot-query-identity-provider iss) + (make-exception-with-message final-message) + error)))) + (lambda () + (make <oidc-configuration> + #:server iss))))) + (with-exception-handler + (lambda (error) + (raise-exception + (make-exception + (make-cannot-query-identity-provider iss) + (make-exception-with-message + (if (exception-with-message? error) + (format #f (G_ "I cannot query the JWKS URI of the identity provider: ~a") + (exception-message error)) + (format #f (G_ "I cannot query the JWKS URI of the identity provider"))))))) + (lambda () + (append + (keys (next-method)) + (keys (jwks cfg)))))))) (define verify (make <generic-with-default> |