From 1b7a485bbd05802432539984f3df078b5b8134ac Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Sat, 19 Jun 2021 10:54:43 +0200 Subject: Implement the GET, HEAD, OPTIONS methods for the server --- doc/webid-oidc.texi | 5 + po/fr.po | 277 +++++++++++++++++----------------- po/webid-oidc.pot | 271 +++++++++++++++++---------------- src/scm/webid-oidc/errors.scm | 17 +++ src/scm/webid-oidc/server/Makefile.am | 6 +- src/scm/webid-oidc/server/read.scm | 207 +++++++++++++++++++++++++ tests/crud.scm | 107 ++++++++++++- 7 files changed, 615 insertions(+), 275 deletions(-) create mode 100644 src/scm/webid-oidc/server/read.scm diff --git a/doc/webid-oidc.texi b/doc/webid-oidc.texi index 8f08485..ccb6e25 100644 --- a/doc/webid-oidc.texi +++ b/doc/webid-oidc.texi @@ -1218,6 +1218,11 @@ conditions. There is no registered resource at @var{path}. @end deftp +@deftp {exception type} &auxiliary-resource-absent @var{path} @var{kind} +The auxiliary resource of given @var{kind} is not instanciated on the +server for the base resource @var{path}. +@end deftp + @deftp {exception type} &uri-slash-semantics-error @var{path} @var{expected-path} While the resource at @var{path} does not exist, the resource at @var{expected-path} does, and @var{path} and @var{expected-path} diff --git a/po/fr.po b/po/fr.po index 9c5810c..9660730 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: webid-oidc 0.0.0\n" "Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n" -"POT-Creation-Date: 2021-06-18 16:41+0200\n" -"PO-Revision-Date: 2021-06-18 15:50+0200\n" +"POT-Creation-Date: 2021-06-19 11:40+0200\n" +"PO-Revision-Date: 2021-06-19 11:41+0200\n" "Last-Translator: Vivien Kraus \n" "Language-Team: French \n" "Language: fr\n" @@ -126,101 +126,101 @@ msgstr "Utilisation : generate-random [NOMBRE D'OCTETS]\n" msgid "Usage: generate-key [NUMBER OF BITS | CURVE]\n" msgstr "Utilisation : generate-key [NOMBRE DE BITS | COURBE]\n" -#: src/scm/webid-oidc/errors.scm:999 +#: src/scm/webid-oidc/errors.scm:1013 msgid "that’s how it is" msgstr "c’est comme ça" -#: src/scm/webid-oidc/errors.scm:1004 +#: src/scm/webid-oidc/errors.scm:1018 #, scheme-format msgid "the value ~s is not a base64 string (because ~a)" msgstr "la valeur ~s n’est pas une chaîne base64 (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1007 +#: src/scm/webid-oidc/errors.scm:1021 #, scheme-format msgid "the value ~s is not JSON (because ~a)" msgstr "la valeur ~s n’est pas du JSON (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1010 +#: src/scm/webid-oidc/errors.scm:1024 #, scheme-format msgid "the value ~s is not Turtle (because ~a)" msgstr "la valeur ~s n’est pas du Turtle (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1013 +#: src/scm/webid-oidc/errors.scm:1027 #, scheme-format msgid "the value ~s does not identify an elleptic curve" msgstr "la valeur ~s n’identifie pas une courbe elliptique" -#: src/scm/webid-oidc/errors.scm:1018 +#: src/scm/webid-oidc/errors.scm:1032 #, scheme-format msgid "the value ~s does not identify a JWK (because ~a)" msgstr "la valeur ~s n’identifie pas une JWK (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1020 +#: src/scm/webid-oidc/errors.scm:1034 #, scheme-format msgid "the value ~s does not identify a JWK" msgstr "la valeur ~s n’identifie pas une JWK" -#: src/scm/webid-oidc/errors.scm:1025 +#: src/scm/webid-oidc/errors.scm:1039 #, scheme-format msgid "the value ~s does not identify a public JWK (because ~a)" msgstr "la valeur ~s n’identifie pas une JWK publique (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1027 +#: src/scm/webid-oidc/errors.scm:1041 #, scheme-format msgid "the value ~s does not identify a public JWK" msgstr "la valeur ~s n’identifie pas une JWK publique" -#: src/scm/webid-oidc/errors.scm:1032 +#: src/scm/webid-oidc/errors.scm:1046 #, scheme-format msgid "the value ~s does not identify a private JWK (because ~a)" msgstr "la valeur ~s n’identifie pas une JWK privée (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1034 +#: src/scm/webid-oidc/errors.scm:1048 #, scheme-format msgid "the value ~s does not identify a private JWK" msgstr "la valeur ~s n’identifie pas une JWK privée" -#: src/scm/webid-oidc/errors.scm:1039 +#: src/scm/webid-oidc/errors.scm:1053 #, scheme-format msgid "the value ~s does not identify a JWKS (because ~a)" msgstr "la valeur ~s n’identifie pas un JWKS (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1041 +#: src/scm/webid-oidc/errors.scm:1055 #, scheme-format msgid "the value ~s does not identify a JWKS" msgstr "la valeur ~s n’identifie pas un JWKS" -#: src/scm/webid-oidc/errors.scm:1044 +#: src/scm/webid-oidc/errors.scm:1058 #, scheme-format msgid "the value ~s does not identify a hash algorithm" msgstr "la valeur ~s n’identifie pas un algorithme de hachage" -#: src/scm/webid-oidc/errors.scm:1047 +#: src/scm/webid-oidc/errors.scm:1061 #, scheme-format msgid "the value ~s is not an alist or misses key ~s" msgstr "la valeur ~s n’est pas une alist ou il manque la clé ~s" -#: src/scm/webid-oidc/errors.scm:1050 +#: src/scm/webid-oidc/errors.scm:1064 #, scheme-format msgid "the value ~s is not a JWS header (because ~a)" msgstr "la valeur ~s n’est pas un header JWS (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1053 +#: src/scm/webid-oidc/errors.scm:1067 #, scheme-format msgid "the value ~s is not a JWS payload (because ~a)" msgstr "la valeur ~s n’est pas un contenu JWS (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1056 +#: src/scm/webid-oidc/errors.scm:1070 #, scheme-format msgid "the value ~s is not a JWS (because ~a)" msgstr "la valeur ~s n’est pas un JWS (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1059 +#: src/scm/webid-oidc/errors.scm:1073 #, scheme-format msgid "the string ~s cannot be split in 3 parts with ~s" msgstr "la chaîne ~s ne peut pas être découpée en 3 parties avec ~s" -#: src/scm/webid-oidc/errors.scm:1062 +#: src/scm/webid-oidc/errors.scm:1076 #, scheme-format msgid "" "all key candidates failed to verify signature ~s with algorithm ~s and " @@ -229,17 +229,17 @@ msgstr "" "aucune clé candidate n’a pu vérifier la signature ~s avec l’algorithme ~s et " "le contenu ~a (il y en avait ~a : ~s)" -#: src/scm/webid-oidc/errors.scm:1065 +#: src/scm/webid-oidc/errors.scm:1079 #, scheme-format msgid "I cannot decode JWS ~a (because ~a)" msgstr "je n’ai pas pu décoder le JWS encodé par ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1068 +#: src/scm/webid-oidc/errors.scm:1082 #, scheme-format msgid "I cannot encode JWS ~a (because ~a)" msgstr "je n’ai pas pu encoder le JWS ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1071 +#: src/scm/webid-oidc/errors.scm:1085 #, scheme-format msgid "" "the server request unexpectedly failed with code ~a and reason phrase ~s" @@ -247,338 +247,338 @@ msgstr "" "la requête au serveur a échoué de façon inattendue avec un code ~a et une " "raison ~s" -#: src/scm/webid-oidc/errors.scm:1076 +#: src/scm/webid-oidc/errors.scm:1090 #, scheme-format msgid "the header ~a should not have the value ~s" msgstr "l’en-tête ~a ne devrait pas avoir la valeur ~s" -#: src/scm/webid-oidc/errors.scm:1078 +#: src/scm/webid-oidc/errors.scm:1092 #, scheme-format msgid "the header ~a should be present" msgstr "l’en-tête ~a devrait être présent" -#: src/scm/webid-oidc/errors.scm:1081 +#: src/scm/webid-oidc/errors.scm:1095 #, scheme-format msgid "the server response wasn't expected: ~s (because ~a)" msgstr "la réponse du serveur est inattendue : ~s (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1087 +#: src/scm/webid-oidc/errors.scm:1101 #, scheme-format msgid "the value ~s is not an OIDC configuration (because ~a)" msgstr "la valeur ~s n’est pas une configuration OIDC (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1092 +#: src/scm/webid-oidc/errors.scm:1106 #, scheme-format msgid "the webid field is incorrect: ~s" msgstr "le champ webid est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1093 +#: src/scm/webid-oidc/errors.scm:1107 msgid "the webid field is missing" msgstr "le champ webid est manquant" -#: src/scm/webid-oidc/errors.scm:1097 +#: src/scm/webid-oidc/errors.scm:1111 #, scheme-format msgid "the sub field is incorrect: ~s" msgstr "le champ sub est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1098 +#: src/scm/webid-oidc/errors.scm:1112 msgid "the sub field is missing" msgstr "le champ sub est manquant" -#: src/scm/webid-oidc/errors.scm:1102 +#: src/scm/webid-oidc/errors.scm:1116 #, scheme-format msgid "the iss field is incorrect: ~s" msgstr "le champ iss est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1103 +#: src/scm/webid-oidc/errors.scm:1117 msgid "the iss field is missing" msgstr "le champ iss est manquant" -#: src/scm/webid-oidc/errors.scm:1107 +#: src/scm/webid-oidc/errors.scm:1121 #, scheme-format msgid "the aud field is incorrect: ~s" msgstr "le champ aud est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1108 +#: src/scm/webid-oidc/errors.scm:1122 msgid "the aud field is missing" msgstr "le champ aud est manquant" -#: src/scm/webid-oidc/errors.scm:1112 +#: src/scm/webid-oidc/errors.scm:1126 #, scheme-format msgid "the iat field is incorrect: ~s" msgstr "le champ iat est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1113 +#: src/scm/webid-oidc/errors.scm:1127 msgid "the iat field is missing" msgstr "le champ iat est manquant" -#: src/scm/webid-oidc/errors.scm:1117 +#: src/scm/webid-oidc/errors.scm:1131 #, scheme-format msgid "the exp field is incorrect: ~s" msgstr "le champ exp est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1118 +#: src/scm/webid-oidc/errors.scm:1132 msgid "the exp field is missing" msgstr "le champ exp est manquant" -#: src/scm/webid-oidc/errors.scm:1122 +#: src/scm/webid-oidc/errors.scm:1136 #, scheme-format msgid "the cnf/jkt field is incorrect: ~s" msgstr "le champ cnf/jkt est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1123 +#: src/scm/webid-oidc/errors.scm:1137 msgid "the cnf/jkt field is missing" msgstr "le champ cnf/jkt est manquant" -#: src/scm/webid-oidc/errors.scm:1127 +#: src/scm/webid-oidc/errors.scm:1141 #, scheme-format msgid "the client-id field is incorrect: ~s" msgstr "le champ client-id est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1128 +#: src/scm/webid-oidc/errors.scm:1142 msgid "the client-id field is missing" msgstr "le champ client-id est manquant" -#: src/scm/webid-oidc/errors.scm:1132 +#: src/scm/webid-oidc/errors.scm:1146 #: src/scm/webid-oidc/authorization-page-unsafe.scm:133 #, scheme-format msgid "the redirect_uris field is incorrect: ~s" msgstr "le champ redirect_uris est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1133 +#: src/scm/webid-oidc/errors.scm:1147 #: src/scm/webid-oidc/authorization-page-unsafe.scm:134 msgid "the redirect_uris field is missing" msgstr "le champ redirect_uris est manquant" -#: src/scm/webid-oidc/errors.scm:1137 +#: src/scm/webid-oidc/errors.scm:1151 #, scheme-format msgid "the typ field is incorrect: ~s" msgstr "le champ typ est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1138 +#: src/scm/webid-oidc/errors.scm:1152 msgid "the typ field is missing" msgstr "le champ typ est manquant" -#: src/scm/webid-oidc/errors.scm:1142 +#: src/scm/webid-oidc/errors.scm:1156 #, scheme-format msgid "the jwk field is incorrect: ~s (because ~a)" msgstr "le champ jwk est incorrect : ~s (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1144 +#: src/scm/webid-oidc/errors.scm:1158 msgid "the jwk field is missing" msgstr "le champ jwk est manquant" -#: src/scm/webid-oidc/errors.scm:1148 +#: src/scm/webid-oidc/errors.scm:1162 #, scheme-format msgid "the jti field is incorrect: ~s" msgstr "le champ jti est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1149 +#: src/scm/webid-oidc/errors.scm:1163 msgid "the jti field is missing" msgstr "le champ jti est manquant" -#: src/scm/webid-oidc/errors.scm:1153 +#: src/scm/webid-oidc/errors.scm:1167 #, scheme-format msgid "the nonce field is incorrect: ~s" msgstr "le champ nonce est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1154 +#: src/scm/webid-oidc/errors.scm:1168 msgid "the nonce field is missing" msgstr "le champ nonce est manquant" -#: src/scm/webid-oidc/errors.scm:1158 +#: src/scm/webid-oidc/errors.scm:1172 #, scheme-format msgid "the htm field is incorrect: ~s" msgstr "le champ htm est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1159 +#: src/scm/webid-oidc/errors.scm:1173 msgid "the htm field is missing" msgstr "le champ htm est manquant" -#: src/scm/webid-oidc/errors.scm:1163 +#: src/scm/webid-oidc/errors.scm:1177 #, scheme-format msgid "the htu field is incorrect: ~s" msgstr "le champ htu est incorrect : ~s" -#: src/scm/webid-oidc/errors.scm:1164 +#: src/scm/webid-oidc/errors.scm:1178 msgid "the htu field is missing" msgstr "le champ htu est manquant" -#: src/scm/webid-oidc/errors.scm:1166 +#: src/scm/webid-oidc/errors.scm:1180 #, scheme-format msgid "~s is not an access token (because ~a)" msgstr "~s n’est pas un jeton d’accès (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1169 +#: src/scm/webid-oidc/errors.scm:1183 #, scheme-format msgid "~s is not an access token header (because ~a)" msgstr "~s n’est pas un en-tête de jeton d’accès (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1172 +#: src/scm/webid-oidc/errors.scm:1186 #, scheme-format msgid "~s is not an access token payload (because ~a)" msgstr "~s n’est pas un contenu de jeton d’accès (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1175 +#: src/scm/webid-oidc/errors.scm:1189 #, scheme-format msgid "~s is not a DPoP proof (because ~a)" msgstr "~s n’est pas une preuve DPoP (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1178 +#: src/scm/webid-oidc/errors.scm:1192 #, scheme-format msgid "~s is not a DPoP proof header (because ~a)" msgstr "~s n’est pas un en-tête de preuve DPoP (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1181 +#: src/scm/webid-oidc/errors.scm:1195 #, scheme-format msgid "~s is not a DPoP proof payload (because ~a)" msgstr "~s n’est pas un contenu de preuve DPoP (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1184 +#: src/scm/webid-oidc/errors.scm:1198 #, scheme-format msgid "I cannot fetch the issuer configuration of ~a (because ~a)" msgstr "" "je n’ai pas pu récupérer la configuration de l’émetteur ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1191 +#: src/scm/webid-oidc/errors.scm:1205 #, scheme-format msgid "I cannot fetch the JWKS of ~a at ~a (because ~a)" msgstr "je n’ai pas pu récupérer le JWKS de ~a à ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1202 +#: src/scm/webid-oidc/errors.scm:1216 #, scheme-format msgid "the HTTP method is signed for ~s, but ~s was requested" msgstr "la méthode HTTP a été signée pour ~s, mais ~s a été demandé" -#: src/scm/webid-oidc/errors.scm:1205 +#: src/scm/webid-oidc/errors.scm:1219 #, scheme-format msgid "the HTTP uri is signed for ~a, but ~a was requested" msgstr "l’uri HTTP a été signé pour ~a, mais ~a a été demandé" -#: src/scm/webid-oidc/errors.scm:1208 +#: src/scm/webid-oidc/errors.scm:1222 #, scheme-format msgid "the date is ~a, but the DPoP proof is signed in the future at ~a" msgstr "la date est ~a, mais la preuve DPoP a été signée dans le futur à ~a" -#: src/scm/webid-oidc/errors.scm:1212 +#: src/scm/webid-oidc/errors.scm:1226 #, scheme-format msgid "the date is ~a, but the DPoP proof was signed too long ago at ~a" msgstr "" "la date est ~a, mais la preuve DPoP a été signée il y a trop longtemps à ~a" -#: src/scm/webid-oidc/errors.scm:1221 +#: src/scm/webid-oidc/errors.scm:1235 #, scheme-format msgid "the key ~s does not hash to ~a" msgstr "la clé ~s ne donne pas un hash de ~a" -#: src/scm/webid-oidc/errors.scm:1223 +#: src/scm/webid-oidc/errors.scm:1237 #, scheme-format msgid "the key confirmation of ~s failed (because ~a)" msgstr "la confirmation de clé de ~s a échoué (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1225 +#: src/scm/webid-oidc/errors.scm:1239 #, scheme-format msgid "the key confirmation of ~s failed" msgstr "la confirmation de la clé ~s a échoué" -#: src/scm/webid-oidc/errors.scm:1227 +#: src/scm/webid-oidc/errors.scm:1241 #, scheme-format msgid "the jti ~s has already been found (because ~a)" msgstr "le jti ~s a déjà été trouvé (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1230 +#: src/scm/webid-oidc/errors.scm:1244 #, scheme-format msgid "I cannot decode ~s as an access token (because ~a)" msgstr "je n’ai pas pu décoder ~s comme jeton d’accès (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1233 +#: src/scm/webid-oidc/errors.scm:1247 #, scheme-format msgid "I cannot encode ~s as an access token with key ~s (because ~a)" msgstr "" "je n’ai pas pu encoder ~s comme un jeton d’accès avec la clé ~s (parce que " "~a)" -#: src/scm/webid-oidc/errors.scm:1236 +#: src/scm/webid-oidc/errors.scm:1250 #, scheme-format msgid "I cannot decode ~s as a DPoP proof (because ~a)" msgstr "je n’ai pas pu décoder ~s comme preuve DPoP (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1239 +#: src/scm/webid-oidc/errors.scm:1253 #, scheme-format msgid "I cannot encode ~s as a DPoP proof (because ~a)" msgstr "je n’ai pas pu encoder ~s comme une preuve DPoP (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1242 +#: src/scm/webid-oidc/errors.scm:1256 #, scheme-format msgid "I could not fetch a RDF graph at ~a (because ~a)" msgstr "je n’ai pas pu récupérer de graphe RDF à ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1245 +#: src/scm/webid-oidc/errors.scm:1259 #, scheme-format msgid "~s is not a client manifest (because ~a)" msgstr "~s n’est pas un manifeste client (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1248 +#: src/scm/webid-oidc/errors.scm:1262 #, scheme-format msgid "~s does not authorize redirection URI ~a" msgstr "~s n’autorise pas l’URI de redirection ~a" -#: src/scm/webid-oidc/errors.scm:1251 +#: src/scm/webid-oidc/errors.scm:1265 msgid "I cannot serve a public manifest" msgstr "je ne peux pas servir un manifeste public" -#: src/scm/webid-oidc/errors.scm:1253 +#: src/scm/webid-oidc/errors.scm:1267 #, scheme-format msgid "~a does not have a client manifest registration triple" msgstr "~a n’a pas de triplet d’enregistrement de manifeste client" -#: src/scm/webid-oidc/errors.scm:1256 +#: src/scm/webid-oidc/errors.scm:1270 #, scheme-format msgid "the client manifest at ~a is advertised for ~a" msgstr "le manifeste client ~a est publié pour ~a" -#: src/scm/webid-oidc/errors.scm:1259 +#: src/scm/webid-oidc/errors.scm:1273 #, scheme-format msgid "I could not fetch the client manifest of ~a (because ~a)" msgstr "je n’ai pas pu récupérer le manifeste client de ~a (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1262 +#: src/scm/webid-oidc/errors.scm:1276 #, scheme-format msgid "~s is not an authorization code (because ~a)" msgstr "~s n’est pas un code d’autorisation (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1265 +#: src/scm/webid-oidc/errors.scm:1279 #, scheme-format msgid "~s is not an authorization code header (because ~a)" msgstr "~s n’est pas un en-tête de code d’autorisation (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1268 +#: src/scm/webid-oidc/errors.scm:1282 #, scheme-format msgid "~s is not an authorization code payload (because ~a)" msgstr "~s n’est pas un contenu de code d’autorisation (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1271 +#: src/scm/webid-oidc/errors.scm:1285 #, scheme-format msgid "the current time is ~a, and the authorization code expired at ~a" msgstr "" "la date est actuellement ~a, et le code d’autorisation a expiré à la date ~a" -#: src/scm/webid-oidc/errors.scm:1275 +#: src/scm/webid-oidc/errors.scm:1289 #, scheme-format msgid "I cannot decode ~s as an authorization code (because ~a)" msgstr "je n’ai pas pu décoder ~s comme un code d’autorisation (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1278 +#: src/scm/webid-oidc/errors.scm:1292 #, scheme-format msgid "I cannot encode ~s as an authorization code (because ~a)" msgstr "je n’ai pas pu encoder ~s comme un code d’autorisation (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1281 +#: src/scm/webid-oidc/errors.scm:1295 #, scheme-format msgid "there is no such refresh token as ~s" msgstr "il n’y a pas de jeton de rafraîchissement ~s" -#: src/scm/webid-oidc/errors.scm:1284 +#: src/scm/webid-oidc/errors.scm:1298 #, scheme-format msgid "" "the refresh token is bound to a key confirmed as ~s, but it is used with key " @@ -587,45 +587,45 @@ msgstr "" "Le jeton de rafraîchissement est lié à une clé confirmée par ~s, mais il est " "utilisé avec la clé ~s" -#: src/scm/webid-oidc/errors.scm:1287 +#: src/scm/webid-oidc/errors.scm:1301 #, scheme-format msgid "I cannot decode ~s as an ID token (because ~a)" msgstr "je n’ai pas pu décoder ~s comme jeton d’identité (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1290 +#: src/scm/webid-oidc/errors.scm:1304 #, scheme-format msgid "I cannot encode ~s as an ID token (because ~a)" msgstr "je n’ai pas pu encoder ~s comme un jeton d’identité (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1293 +#: src/scm/webid-oidc/errors.scm:1307 #, scheme-format msgid "the grant type ~s is not supported" msgstr "le type d’octroi ~s n’est pas supporté " -#: src/scm/webid-oidc/errors.scm:1296 +#: src/scm/webid-oidc/errors.scm:1310 msgid "there is no authorization code in the request" msgstr "il n’y a pas de code d’autorisation dans la requête" -#: src/scm/webid-oidc/errors.scm:1298 +#: src/scm/webid-oidc/errors.scm:1312 msgid "there is no refresh token in the request" msgstr "il n’y a pas de jeton de rafraîchissement dans la requête" -#: src/scm/webid-oidc/errors.scm:1300 +#: src/scm/webid-oidc/errors.scm:1314 #, scheme-format msgid "~s is not an ID token (because ~a)" msgstr "~s n’est pas un jeton d’identité (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1303 +#: src/scm/webid-oidc/errors.scm:1317 #, scheme-format msgid "~s is not an ID token header (because ~a)" msgstr "~s n’est pas un en-tête de jeton d’identité (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1306 +#: src/scm/webid-oidc/errors.scm:1320 #, scheme-format msgid "~s is not an ID token payload (because ~a)" msgstr "~s n’est pas un contenu de jeton d’identité (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1309 +#: src/scm/webid-oidc/errors.scm:1323 #, scheme-format msgid "" "I couldn’t set the locale to ~s as an approximation of the client locale ~s" @@ -633,12 +633,12 @@ msgstr "" "je n’ai pas pu définir la locale à ~s comme approximation de la locale du " "client ~s" -#: src/scm/webid-oidc/errors.scm:1312 +#: src/scm/webid-oidc/errors.scm:1326 #, scheme-format msgid "~s does not admit ~s as an identity provider" msgstr "~s n’admet pas ~s comme fournisseur d’identité" -#: src/scm/webid-oidc/errors.scm:1315 +#: src/scm/webid-oidc/errors.scm:1329 #, scheme-format msgid "" "~a is neither an identity provider (because ~a) nor a webid (because ~a)" @@ -646,71 +646,76 @@ msgstr "" "~a n’est ni un fournisseur d’identité (parce que ~a) ni un webid (parce que " "~a)" -#: src/scm/webid-oidc/errors.scm:1320 +#: src/scm/webid-oidc/errors.scm:1334 #, scheme-format msgid "the token request failed (because ~a)" msgstr "la requête de jeton a échoué (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1323 +#: src/scm/webid-oidc/errors.scm:1337 #, scheme-format msgid "you don’t have a refresh token for identity ~a certified by ~a in ~s" msgstr "" "vous n’avez pas de jeton de rafraîchissement pour l’identité ~a certifié par " "~a dans ~s" -#: src/scm/webid-oidc/errors.scm:1328 +#: src/scm/webid-oidc/errors.scm:1342 #, scheme-format msgid "all identity provider candidates for ~a failed: ~a" msgstr "tous les candidats de fournisseurs d’identité pour ~a ont échoué : ~a" -#: src/scm/webid-oidc/errors.scm:1332 +#: src/scm/webid-oidc/errors.scm:1346 #, scheme-format msgid "~s failed (because ~a)" msgstr "~s a échoué (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1335 +#: src/scm/webid-oidc/errors.scm:1349 msgid ", " msgstr ", " -#: src/scm/webid-oidc/errors.scm:1337 +#: src/scm/webid-oidc/errors.scm:1351 #, scheme-format msgid "no resource has been found to serve URI path ~s" msgstr "aucune ressource n’a été trouvée pour servir le chemin d’URI ~s" -#: src/scm/webid-oidc/errors.scm:1340 +#: src/scm/webid-oidc/errors.scm:1354 +#, scheme-format +msgid "the resource kind ~s is absent for the resource at ~s" +msgstr "le type de ressource ~s est absent pour la ressource ~s" + +#: src/scm/webid-oidc/errors.scm:1357 #, scheme-format msgid "no resource has been found to serve URI path ~s, but ~s exists" msgstr "" "aucune ressource n’a été trouvée pour servir le chemin d’URI ~s, mais ~s " "existe" -#: src/scm/webid-oidc/errors.scm:1343 +#: src/scm/webid-oidc/errors.scm:1360 msgid "the root storage cannot be deleted" msgstr "le stockage racine ne peut pas être détruit" -#: src/scm/webid-oidc/errors.scm:1345 +#: src/scm/webid-oidc/errors.scm:1362 #, scheme-format msgid "the container ~s should be emptied before being deleted" msgstr "le conteneur ~s doit être vidé avant d’être détruit" -#: src/scm/webid-oidc/errors.scm:1348 +#: src/scm/webid-oidc/errors.scm:1365 #, scheme-format msgid "the group ~s cannot be fetched (because ~a)" msgstr "le groupe ~s n’a pas pu être récupéré (parce que ~a)" -#: src/scm/webid-oidc/errors.scm:1352 +#: src/scm/webid-oidc/errors.scm:1369 #, scheme-format msgid "the containment triples in the request to update ~s are not up to date" msgstr "" "les triplets de contention dans la requête pour changer ~s ne sont pas à jour" -#: src/scm/webid-oidc/errors.scm:1355 +#: src/scm/webid-oidc/errors.scm:1372 #, scheme-format msgid "the server cannot process resources with the ~s content-type" msgstr "" "le serveur ne peut pas traiter des ressources avec le type de contenu ~s" -#: src/scm/webid-oidc/errors.scm:1358 +#: src/scm/webid-oidc/errors.scm:1375 #, scheme-format msgid "" "the client wants to create a resource at ~s, which is reserved for an " @@ -719,7 +724,7 @@ msgstr "" "le client veut créer une ressource en tant que ~s, qui est réservé pour une " "ressource auxiliare" -#: src/scm/webid-oidc/errors.scm:1361 +#: src/scm/webid-oidc/errors.scm:1378 #, scheme-format msgid "" "the operation on ~s by ~s is refused, because it’s not by ~s and the access " @@ -728,70 +733,70 @@ msgstr "" "l’opération sur ~s par ~s est refusée, parce que ce n’est pas ~s et le " "contrôle d’accès refuse le mode d’opération suivant : ~s" -#: src/scm/webid-oidc/errors.scm:1367 +#: src/scm/webid-oidc/errors.scm:1384 msgid "that’s it" msgstr "c’est tout" -#: src/scm/webid-oidc/errors.scm:1371 +#: src/scm/webid-oidc/errors.scm:1388 #, scheme-format msgid "~a and ~a" msgstr "~a et ~a" -#: src/scm/webid-oidc/errors.scm:1374 +#: src/scm/webid-oidc/errors.scm:1391 #, scheme-format msgid "~a, ~a" msgstr "~a, ~a" -#: src/scm/webid-oidc/errors.scm:1378 +#: src/scm/webid-oidc/errors.scm:1395 #, scheme-format msgid "the signature ~a does not match key ~s with payload ~a" msgstr "la signature ~a ne correspond pas à la clé ~s avec le contenu ~a" -#: src/scm/webid-oidc/errors.scm:1381 +#: src/scm/webid-oidc/errors.scm:1398 msgid "there is an undefined variable" msgstr "il y a une variable non définie" -#: src/scm/webid-oidc/errors.scm:1383 +#: src/scm/webid-oidc/errors.scm:1400 #, scheme-format msgid "the origin is ~a" msgstr "l’origine est ~a" -#: src/scm/webid-oidc/errors.scm:1386 +#: src/scm/webid-oidc/errors.scm:1403 #, scheme-format msgid "a message is attached: ~a" msgstr "un message est attaché : ~a" -#: src/scm/webid-oidc/errors.scm:1389 +#: src/scm/webid-oidc/errors.scm:1406 #, scheme-format msgid "the values ~s are problematic" msgstr "les valeurs ~s sont problématiques" -#: src/scm/webid-oidc/errors.scm:1392 +#: src/scm/webid-oidc/errors.scm:1409 msgid "there is a kind and args" msgstr "il y a un type et des arguments" -#: src/scm/webid-oidc/errors.scm:1394 +#: src/scm/webid-oidc/errors.scm:1411 msgid "there is an assertion failure" msgstr "il y a un échec d’assertion" -#: src/scm/webid-oidc/errors.scm:1396 +#: src/scm/webid-oidc/errors.scm:1413 #, scheme-format msgid "the program quits with code ~a" msgstr "le programme quitte avec le code ~a" -#: src/scm/webid-oidc/errors.scm:1399 +#: src/scm/webid-oidc/errors.scm:1416 msgid "the program cannot recover from this exception" msgstr "le programme ne peut pas récupérer après cette exception" -#: src/scm/webid-oidc/errors.scm:1401 +#: src/scm/webid-oidc/errors.scm:1418 msgid "there is an external error" msgstr "il y a une erreur externe" -#: src/scm/webid-oidc/errors.scm:1403 +#: src/scm/webid-oidc/errors.scm:1420 msgid "there is an error" msgstr "il y a une erreur" -#: src/scm/webid-oidc/errors.scm:1405 +#: src/scm/webid-oidc/errors.scm:1422 #, scheme-format msgid "Unhandled exception type ~a." msgstr "Type d’exception non pris en charge ~a." @@ -1649,10 +1654,6 @@ msgstr "Il y a eu une erreur : ~a\n" #~ msgid "the resource is missing an etag (see ~s)" #~ msgstr "la ressource n’a pas d’etag (voir ~s)" -#, scheme-format -#~ msgid "the resource is missing a content type (see ~s)" -#~ msgstr "la ressource n’a pas de type de contenu (voir ~s)" - #, scheme-format #~ msgid "" #~ "the precondition failed for etag ~s: if-match ~s and if-none-match ~s" diff --git a/po/webid-oidc.pot b/po/webid-oidc.pot index fc25133..9812c8a 100644 --- a/po/webid-oidc.pot +++ b/po/webid-oidc.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: webid-oidc SNAPSHOT\n" "Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n" -"POT-Creation-Date: 2021-06-18 16:41+0200\n" +"POT-Creation-Date: 2021-06-19 11:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -122,647 +122,652 @@ msgstr "" msgid "Usage: generate-key [NUMBER OF BITS | CURVE]\n" msgstr "" -#: src/scm/webid-oidc/errors.scm:999 +#: src/scm/webid-oidc/errors.scm:1013 msgid "that’s how it is" msgstr "" -#: src/scm/webid-oidc/errors.scm:1004 +#: src/scm/webid-oidc/errors.scm:1018 #, scheme-format msgid "the value ~s is not a base64 string (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1007 +#: src/scm/webid-oidc/errors.scm:1021 #, scheme-format msgid "the value ~s is not JSON (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1010 +#: src/scm/webid-oidc/errors.scm:1024 #, scheme-format msgid "the value ~s is not Turtle (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1013 +#: src/scm/webid-oidc/errors.scm:1027 #, scheme-format msgid "the value ~s does not identify an elleptic curve" msgstr "" -#: src/scm/webid-oidc/errors.scm:1018 +#: src/scm/webid-oidc/errors.scm:1032 #, scheme-format msgid "the value ~s does not identify a JWK (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1020 +#: src/scm/webid-oidc/errors.scm:1034 #, scheme-format msgid "the value ~s does not identify a JWK" msgstr "" -#: src/scm/webid-oidc/errors.scm:1025 +#: src/scm/webid-oidc/errors.scm:1039 #, scheme-format msgid "the value ~s does not identify a public JWK (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1027 +#: src/scm/webid-oidc/errors.scm:1041 #, scheme-format msgid "the value ~s does not identify a public JWK" msgstr "" -#: src/scm/webid-oidc/errors.scm:1032 +#: src/scm/webid-oidc/errors.scm:1046 #, scheme-format msgid "the value ~s does not identify a private JWK (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1034 +#: src/scm/webid-oidc/errors.scm:1048 #, scheme-format msgid "the value ~s does not identify a private JWK" msgstr "" -#: src/scm/webid-oidc/errors.scm:1039 +#: src/scm/webid-oidc/errors.scm:1053 #, scheme-format msgid "the value ~s does not identify a JWKS (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1041 +#: src/scm/webid-oidc/errors.scm:1055 #, scheme-format msgid "the value ~s does not identify a JWKS" msgstr "" -#: src/scm/webid-oidc/errors.scm:1044 +#: src/scm/webid-oidc/errors.scm:1058 #, scheme-format msgid "the value ~s does not identify a hash algorithm" msgstr "" -#: src/scm/webid-oidc/errors.scm:1047 +#: src/scm/webid-oidc/errors.scm:1061 #, scheme-format msgid "the value ~s is not an alist or misses key ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1050 +#: src/scm/webid-oidc/errors.scm:1064 #, scheme-format msgid "the value ~s is not a JWS header (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1053 +#: src/scm/webid-oidc/errors.scm:1067 #, scheme-format msgid "the value ~s is not a JWS payload (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1056 +#: src/scm/webid-oidc/errors.scm:1070 #, scheme-format msgid "the value ~s is not a JWS (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1059 +#: src/scm/webid-oidc/errors.scm:1073 #, scheme-format msgid "the string ~s cannot be split in 3 parts with ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1062 +#: src/scm/webid-oidc/errors.scm:1076 #, scheme-format msgid "" "all key candidates failed to verify signature ~s with algorithm ~s and " "payload ~a (there were ~a: ~s)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1065 +#: src/scm/webid-oidc/errors.scm:1079 #, scheme-format msgid "I cannot decode JWS ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1068 +#: src/scm/webid-oidc/errors.scm:1082 #, scheme-format msgid "I cannot encode JWS ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1071 +#: src/scm/webid-oidc/errors.scm:1085 #, scheme-format msgid "" "the server request unexpectedly failed with code ~a and reason phrase ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1076 +#: src/scm/webid-oidc/errors.scm:1090 #, scheme-format msgid "the header ~a should not have the value ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1078 +#: src/scm/webid-oidc/errors.scm:1092 #, scheme-format msgid "the header ~a should be present" msgstr "" -#: src/scm/webid-oidc/errors.scm:1081 +#: src/scm/webid-oidc/errors.scm:1095 #, scheme-format msgid "the server response wasn't expected: ~s (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1087 +#: src/scm/webid-oidc/errors.scm:1101 #, scheme-format msgid "the value ~s is not an OIDC configuration (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1092 +#: src/scm/webid-oidc/errors.scm:1106 #, scheme-format msgid "the webid field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1093 +#: src/scm/webid-oidc/errors.scm:1107 msgid "the webid field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1097 +#: src/scm/webid-oidc/errors.scm:1111 #, scheme-format msgid "the sub field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1098 +#: src/scm/webid-oidc/errors.scm:1112 msgid "the sub field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1102 +#: src/scm/webid-oidc/errors.scm:1116 #, scheme-format msgid "the iss field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1103 +#: src/scm/webid-oidc/errors.scm:1117 msgid "the iss field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1107 +#: src/scm/webid-oidc/errors.scm:1121 #, scheme-format msgid "the aud field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1108 +#: src/scm/webid-oidc/errors.scm:1122 msgid "the aud field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1112 +#: src/scm/webid-oidc/errors.scm:1126 #, scheme-format msgid "the iat field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1113 +#: src/scm/webid-oidc/errors.scm:1127 msgid "the iat field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1117 +#: src/scm/webid-oidc/errors.scm:1131 #, scheme-format msgid "the exp field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1118 +#: src/scm/webid-oidc/errors.scm:1132 msgid "the exp field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1122 +#: src/scm/webid-oidc/errors.scm:1136 #, scheme-format msgid "the cnf/jkt field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1123 +#: src/scm/webid-oidc/errors.scm:1137 msgid "the cnf/jkt field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1127 +#: src/scm/webid-oidc/errors.scm:1141 #, scheme-format msgid "the client-id field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1128 +#: src/scm/webid-oidc/errors.scm:1142 msgid "the client-id field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1132 +#: src/scm/webid-oidc/errors.scm:1146 #: src/scm/webid-oidc/authorization-page-unsafe.scm:133 #, scheme-format msgid "the redirect_uris field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1133 +#: src/scm/webid-oidc/errors.scm:1147 #: src/scm/webid-oidc/authorization-page-unsafe.scm:134 msgid "the redirect_uris field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1137 +#: src/scm/webid-oidc/errors.scm:1151 #, scheme-format msgid "the typ field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1138 +#: src/scm/webid-oidc/errors.scm:1152 msgid "the typ field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1142 +#: src/scm/webid-oidc/errors.scm:1156 #, scheme-format msgid "the jwk field is incorrect: ~s (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1144 +#: src/scm/webid-oidc/errors.scm:1158 msgid "the jwk field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1148 +#: src/scm/webid-oidc/errors.scm:1162 #, scheme-format msgid "the jti field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1149 +#: src/scm/webid-oidc/errors.scm:1163 msgid "the jti field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1153 +#: src/scm/webid-oidc/errors.scm:1167 #, scheme-format msgid "the nonce field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1154 +#: src/scm/webid-oidc/errors.scm:1168 msgid "the nonce field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1158 +#: src/scm/webid-oidc/errors.scm:1172 #, scheme-format msgid "the htm field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1159 +#: src/scm/webid-oidc/errors.scm:1173 msgid "the htm field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1163 +#: src/scm/webid-oidc/errors.scm:1177 #, scheme-format msgid "the htu field is incorrect: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1164 +#: src/scm/webid-oidc/errors.scm:1178 msgid "the htu field is missing" msgstr "" -#: src/scm/webid-oidc/errors.scm:1166 +#: src/scm/webid-oidc/errors.scm:1180 #, scheme-format msgid "~s is not an access token (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1169 +#: src/scm/webid-oidc/errors.scm:1183 #, scheme-format msgid "~s is not an access token header (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1172 +#: src/scm/webid-oidc/errors.scm:1186 #, scheme-format msgid "~s is not an access token payload (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1175 +#: src/scm/webid-oidc/errors.scm:1189 #, scheme-format msgid "~s is not a DPoP proof (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1178 +#: src/scm/webid-oidc/errors.scm:1192 #, scheme-format msgid "~s is not a DPoP proof header (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1181 +#: src/scm/webid-oidc/errors.scm:1195 #, scheme-format msgid "~s is not a DPoP proof payload (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1184 +#: src/scm/webid-oidc/errors.scm:1198 #, scheme-format msgid "I cannot fetch the issuer configuration of ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1191 +#: src/scm/webid-oidc/errors.scm:1205 #, scheme-format msgid "I cannot fetch the JWKS of ~a at ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1202 +#: src/scm/webid-oidc/errors.scm:1216 #, scheme-format msgid "the HTTP method is signed for ~s, but ~s was requested" msgstr "" -#: src/scm/webid-oidc/errors.scm:1205 +#: src/scm/webid-oidc/errors.scm:1219 #, scheme-format msgid "the HTTP uri is signed for ~a, but ~a was requested" msgstr "" -#: src/scm/webid-oidc/errors.scm:1208 +#: src/scm/webid-oidc/errors.scm:1222 #, scheme-format msgid "the date is ~a, but the DPoP proof is signed in the future at ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1212 +#: src/scm/webid-oidc/errors.scm:1226 #, scheme-format msgid "the date is ~a, but the DPoP proof was signed too long ago at ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1221 +#: src/scm/webid-oidc/errors.scm:1235 #, scheme-format msgid "the key ~s does not hash to ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1223 +#: src/scm/webid-oidc/errors.scm:1237 #, scheme-format msgid "the key confirmation of ~s failed (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1225 +#: src/scm/webid-oidc/errors.scm:1239 #, scheme-format msgid "the key confirmation of ~s failed" msgstr "" -#: src/scm/webid-oidc/errors.scm:1227 +#: src/scm/webid-oidc/errors.scm:1241 #, scheme-format msgid "the jti ~s has already been found (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1230 +#: src/scm/webid-oidc/errors.scm:1244 #, scheme-format msgid "I cannot decode ~s as an access token (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1233 +#: src/scm/webid-oidc/errors.scm:1247 #, scheme-format msgid "I cannot encode ~s as an access token with key ~s (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1236 +#: src/scm/webid-oidc/errors.scm:1250 #, scheme-format msgid "I cannot decode ~s as a DPoP proof (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1239 +#: src/scm/webid-oidc/errors.scm:1253 #, scheme-format msgid "I cannot encode ~s as a DPoP proof (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1242 +#: src/scm/webid-oidc/errors.scm:1256 #, scheme-format msgid "I could not fetch a RDF graph at ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1245 +#: src/scm/webid-oidc/errors.scm:1259 #, scheme-format msgid "~s is not a client manifest (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1248 +#: src/scm/webid-oidc/errors.scm:1262 #, scheme-format msgid "~s does not authorize redirection URI ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1251 +#: src/scm/webid-oidc/errors.scm:1265 msgid "I cannot serve a public manifest" msgstr "" -#: src/scm/webid-oidc/errors.scm:1253 +#: src/scm/webid-oidc/errors.scm:1267 #, scheme-format msgid "~a does not have a client manifest registration triple" msgstr "" -#: src/scm/webid-oidc/errors.scm:1256 +#: src/scm/webid-oidc/errors.scm:1270 #, scheme-format msgid "the client manifest at ~a is advertised for ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1259 +#: src/scm/webid-oidc/errors.scm:1273 #, scheme-format msgid "I could not fetch the client manifest of ~a (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1262 +#: src/scm/webid-oidc/errors.scm:1276 #, scheme-format msgid "~s is not an authorization code (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1265 +#: src/scm/webid-oidc/errors.scm:1279 #, scheme-format msgid "~s is not an authorization code header (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1268 +#: src/scm/webid-oidc/errors.scm:1282 #, scheme-format msgid "~s is not an authorization code payload (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1271 +#: src/scm/webid-oidc/errors.scm:1285 #, scheme-format msgid "the current time is ~a, and the authorization code expired at ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1275 +#: src/scm/webid-oidc/errors.scm:1289 #, scheme-format msgid "I cannot decode ~s as an authorization code (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1278 +#: src/scm/webid-oidc/errors.scm:1292 #, scheme-format msgid "I cannot encode ~s as an authorization code (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1281 +#: src/scm/webid-oidc/errors.scm:1295 #, scheme-format msgid "there is no such refresh token as ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1284 +#: src/scm/webid-oidc/errors.scm:1298 #, scheme-format msgid "" "the refresh token is bound to a key confirmed as ~s, but it is used with key " "~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1287 +#: src/scm/webid-oidc/errors.scm:1301 #, scheme-format msgid "I cannot decode ~s as an ID token (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1290 +#: src/scm/webid-oidc/errors.scm:1304 #, scheme-format msgid "I cannot encode ~s as an ID token (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1293 +#: src/scm/webid-oidc/errors.scm:1307 #, scheme-format msgid "the grant type ~s is not supported" msgstr "" -#: src/scm/webid-oidc/errors.scm:1296 +#: src/scm/webid-oidc/errors.scm:1310 msgid "there is no authorization code in the request" msgstr "" -#: src/scm/webid-oidc/errors.scm:1298 +#: src/scm/webid-oidc/errors.scm:1312 msgid "there is no refresh token in the request" msgstr "" -#: src/scm/webid-oidc/errors.scm:1300 +#: src/scm/webid-oidc/errors.scm:1314 #, scheme-format msgid "~s is not an ID token (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1303 +#: src/scm/webid-oidc/errors.scm:1317 #, scheme-format msgid "~s is not an ID token header (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1306 +#: src/scm/webid-oidc/errors.scm:1320 #, scheme-format msgid "~s is not an ID token payload (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1309 +#: src/scm/webid-oidc/errors.scm:1323 #, scheme-format msgid "" "I couldn’t set the locale to ~s as an approximation of the client locale ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1312 +#: src/scm/webid-oidc/errors.scm:1326 #, scheme-format msgid "~s does not admit ~s as an identity provider" msgstr "" -#: src/scm/webid-oidc/errors.scm:1315 +#: src/scm/webid-oidc/errors.scm:1329 #, scheme-format msgid "" "~a is neither an identity provider (because ~a) nor a webid (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1320 +#: src/scm/webid-oidc/errors.scm:1334 #, scheme-format msgid "the token request failed (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1323 +#: src/scm/webid-oidc/errors.scm:1337 #, scheme-format msgid "you don’t have a refresh token for identity ~a certified by ~a in ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1328 +#: src/scm/webid-oidc/errors.scm:1342 #, scheme-format msgid "all identity provider candidates for ~a failed: ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1332 +#: src/scm/webid-oidc/errors.scm:1346 #, scheme-format msgid "~s failed (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1335 +#: src/scm/webid-oidc/errors.scm:1349 msgid ", " msgstr "" -#: src/scm/webid-oidc/errors.scm:1337 +#: src/scm/webid-oidc/errors.scm:1351 #, scheme-format msgid "no resource has been found to serve URI path ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1340 +#: src/scm/webid-oidc/errors.scm:1354 +#, scheme-format +msgid "the resource kind ~s is absent for the resource at ~s" +msgstr "" + +#: src/scm/webid-oidc/errors.scm:1357 #, scheme-format msgid "no resource has been found to serve URI path ~s, but ~s exists" msgstr "" -#: src/scm/webid-oidc/errors.scm:1343 +#: src/scm/webid-oidc/errors.scm:1360 msgid "the root storage cannot be deleted" msgstr "" -#: src/scm/webid-oidc/errors.scm:1345 +#: src/scm/webid-oidc/errors.scm:1362 #, scheme-format msgid "the container ~s should be emptied before being deleted" msgstr "" -#: src/scm/webid-oidc/errors.scm:1348 +#: src/scm/webid-oidc/errors.scm:1365 #, scheme-format msgid "the group ~s cannot be fetched (because ~a)" msgstr "" -#: src/scm/webid-oidc/errors.scm:1352 +#: src/scm/webid-oidc/errors.scm:1369 #, scheme-format msgid "the containment triples in the request to update ~s are not up to date" msgstr "" -#: src/scm/webid-oidc/errors.scm:1355 +#: src/scm/webid-oidc/errors.scm:1372 #, scheme-format msgid "the server cannot process resources with the ~s content-type" msgstr "" -#: src/scm/webid-oidc/errors.scm:1358 +#: src/scm/webid-oidc/errors.scm:1375 #, scheme-format msgid "" "the client wants to create a resource at ~s, which is reserved for an " "auxiliary resource" msgstr "" -#: src/scm/webid-oidc/errors.scm:1361 +#: src/scm/webid-oidc/errors.scm:1378 #, scheme-format msgid "" "the operation on ~s by ~s is refused, because it’s not by ~s and the access " "control forbids the following mode of operation: ~s" msgstr "" -#: src/scm/webid-oidc/errors.scm:1367 +#: src/scm/webid-oidc/errors.scm:1384 msgid "that’s it" msgstr "" -#: src/scm/webid-oidc/errors.scm:1371 +#: src/scm/webid-oidc/errors.scm:1388 #, scheme-format msgid "~a and ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1374 +#: src/scm/webid-oidc/errors.scm:1391 #, scheme-format msgid "~a, ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1378 +#: src/scm/webid-oidc/errors.scm:1395 #, scheme-format msgid "the signature ~a does not match key ~s with payload ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1381 +#: src/scm/webid-oidc/errors.scm:1398 msgid "there is an undefined variable" msgstr "" -#: src/scm/webid-oidc/errors.scm:1383 +#: src/scm/webid-oidc/errors.scm:1400 #, scheme-format msgid "the origin is ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1386 +#: src/scm/webid-oidc/errors.scm:1403 #, scheme-format msgid "a message is attached: ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1389 +#: src/scm/webid-oidc/errors.scm:1406 #, scheme-format msgid "the values ~s are problematic" msgstr "" -#: src/scm/webid-oidc/errors.scm:1392 +#: src/scm/webid-oidc/errors.scm:1409 msgid "there is a kind and args" msgstr "" -#: src/scm/webid-oidc/errors.scm:1394 +#: src/scm/webid-oidc/errors.scm:1411 msgid "there is an assertion failure" msgstr "" -#: src/scm/webid-oidc/errors.scm:1396 +#: src/scm/webid-oidc/errors.scm:1413 #, scheme-format msgid "the program quits with code ~a" msgstr "" -#: src/scm/webid-oidc/errors.scm:1399 +#: src/scm/webid-oidc/errors.scm:1416 msgid "the program cannot recover from this exception" msgstr "" -#: src/scm/webid-oidc/errors.scm:1401 +#: src/scm/webid-oidc/errors.scm:1418 msgid "there is an external error" msgstr "" -#: src/scm/webid-oidc/errors.scm:1403 +#: src/scm/webid-oidc/errors.scm:1420 msgid "there is an error" msgstr "" -#: src/scm/webid-oidc/errors.scm:1405 +#: src/scm/webid-oidc/errors.scm:1422 #, scheme-format msgid "Unhandled exception type ~a." msgstr "" diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index 76ce8af..80a4f37 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -884,6 +884,20 @@ path-not-found? path-not-found-path) +(define-exception-type + &auxiliary-resource-absent + &external-error + make-auxiliary-resource-absent + auxiliary-resource-absent? + (path auxiliary-resource-absent-path) + (kind auxiliary-resource-absent-kind)) + +(export &auxiliary-resource-absent + make-auxiliary-resource-absent + auxiliary-resource-absent? + auxiliary-resource-absent-path + auxiliary-resource-absent-kind) + (define-exception-type &uri-slash-semantics-error &external-error @@ -1336,6 +1350,9 @@ ((&path-not-found) (format #f (G_ "no resource has been found to serve URI path ~s") (get 'path))) + ((&auxiliary-resource-absent) + (format #f (G_ "the resource kind ~s is absent for the resource at ~s") + (get 'kind') (get 'path))) ((&uri-slash-semantics-error) (format #f (G_ "no resource has been found to serve URI path ~s, but ~s exists") (get 'path) (get 'expected-path))) diff --git a/src/scm/webid-oidc/server/Makefile.am b/src/scm/webid-oidc/server/Makefile.am index 12dad08..2f14df5 100644 --- a/src/scm/webid-oidc/server/Makefile.am +++ b/src/scm/webid-oidc/server/Makefile.am @@ -1,7 +1,9 @@ dist_serverwebidoidcmod_DATA += \ - %reldir%/create.scm + %reldir%/create.scm \ + %reldir%/read.scm serverwebidoidcgo_DATA += \ - %reldir%/create.go + %reldir%/create.go \ + %reldir%/read.go include %reldir%/resource/Makefile.am diff --git a/src/scm/webid-oidc/server/read.scm b/src/scm/webid-oidc/server/read.scm new file mode 100644 index 0000000..bff241a --- /dev/null +++ b/src/scm/webid-oidc/server/read.scm @@ -0,0 +1,207 @@ +(define-module (webid-oidc server read) + #:use-module (webid-oidc errors) + #:use-module (webid-oidc server resource path) + #:use-module (webid-oidc server resource content) + #:use-module (webid-oidc cache) + #:use-module (webid-oidc fetch) + #:use-module (webid-oidc http-link) + #:use-module (webid-oidc server resource wac) + #:use-module ((webid-oidc stubs) #:prefix stubs:) + #:use-module (webid-oidc rdf-index) + #:use-module ((webid-oidc refresh-token) #:prefix refresh:) + #:use-module (web uri) + #:use-module (web client) + #:use-module (web response) + #:use-module (rdf rdf) + #:use-module (turtle tordf) + #:use-module (turtle fromrdf) + #:use-module (rnrs bytevectors) + #:use-module (ice-9 exceptions) + #:use-module (ice-9 receive) + #:use-module (ice-9 optargs) + #:use-module (ice-9 iconv) + #:use-module (ice-9 textual-ports) + #:use-module (ice-9 binary-ports) + #:use-module (ice-9 threads) + #:use-module (rnrs bytevectors) + #:use-module (oop goops) + #:export + ( + + read + + )) + +(define (check-mode server-name path owner user http-get expected-mode) + (let ((modes (wac-get-modes server-name path user #:http-get http-get))) + (define (check-modes modes) + (if (null? modes) + (raise-exception + (make-forbidden path user owner expected-mode)) + (or + (equal? (car modes) expected-mode) + (check-modes (cdr modes))))) + (check-modes modes))) + +(define (check-acl-can-read server-name path owner user http-get) + (check-mode server-name path owner user http-get + (string->uri "http://www.w3.org/ns/auth/acl#Read"))) + +(define (check-acl-can-control server-name path owner user http-get) + (check-mode server-name path owner user http-get + (string->uri "http://www.w3.org/ns/auth/acl#Control"))) + +(define* (read server-name owner user path + #:key + (http-get http-get)) + (declare-link-header!) + (with-session + (lambda (load-content-type load-contained load-static-content + do-create do-delete) + (let ((acl? (string-suffix? ".acl" path)) + (description? (string-suffix? ".meta" path)) + (base-path + (cond + ((string-suffix? ".acl" path) + (substring path 0 (- (string-length path) (string-length ".acl")))) + ((string-suffix? ".meta" path) + (substring path 0 (- (string-length path) (string-length ".meta")))) + (else path))) + (container? (string-suffix? path "/")) + (root? (equal? path "/"))) + (unless (equal? user owner) + (if acl? + (check-acl-can-control server-name base-path owner user http-get) + (check-acl-can-read server-name path owner user http-get))) + (receive (main-etag auxiliary) + (read-path base-path) + (let ((relevant-etag + (cond + (acl? + (assoc-ref auxiliary + (string->uri "http://www.w3.org/ns/auth/acl#accessControl"))) + (description? + (assoc-ref auxiliary + (string->uri "https://www.w3.org/ns/iana/link-relations/relation#describedby"))) + (else + main-etag))) + (non-rdf? (not (eq? (load-content-type main-etag) 'text/turtle))) + (auxiliary? (or acl? description?)) + (allow (cond (root? '(GET HEAD OPTIONS POST PUT)) + (container? '(GET HEAD OPTIONS POST PUT DELETE)) + (else '(GET HEAD OPTIONS PUT DELETE))))) + (unless relevant-etag + (raise-exception + (make-auxiliary-resource-absent + base-path + (cond + (acl? + (assoc-ref auxiliary + (string->uri "http://www.w3.org/ns/auth/acl#accessControl"))) + (description? + (assoc-ref auxiliary + (string->uri "https://www.w3.org/ns/iana/link-relations/relation#describedby"))))))) + (let ((description (and non-rdf? (string-append path ".meta"))) + (accept-put (if (or container? auxiliary?) "text/turtle" "*/*"))) + (values + ;; Headers + (let ((links + (let ((type + (cons + (if container? + (string->uri "http://www.w3.org/ns/ldp#BasicContainer") + (string->uri "http://www.w3.org/ns/ldp#Resource")) + '((rel . "type")))) + (acl + (and (not acl?) + (cons + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path (string-append path ".acl")) + '((rel . "acl"))))) + (describedby + (and non-rdf? + (cons + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path (string-append path ".acl")) + '((rel . "describedby"))))) + (describes + (and description? + (cons + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path (string-append path ".acl")) + '((rel . "https://www.w3.org/ns/iana/link-relations/relation#describes"))))) + (storage + (and root? + (list + (list + (string->uri "http://www.w3.org/ns/pim/space#Storage") + '(rel . "type")) + (list + owner + '(rel . "http://www.w3.org/ns/solid/terms#owner")))))) + (append + (list type) + (if acl (list acl) '()) + (if describedby (list describedby) '()) + (if describes (list describes) '()) + (or storage '()))))) + `((link . ,links) + (allow . ,allow) + (accept-put . ,accept-put) + (content-type + . (,(if container? + 'text/turtle + (load-content-type relevant-etag)))) + (etag . (,relevant-etag . #f)))) + ;; Content + (if container? + (let ((static-graph + (fetch + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path path) + #:http-get + (lambda (uri . args) + (values + (build-response + #:headers `((content-type ,(load-content-type relevant-etag)))) + (load-static-content relevant-etag)))))) + (let ((final-graph + (reverse + (append + (map (lambda (contained-path) + (make-rdf-triple + (uri->string + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path path)) + "http://www.w3.org/ns/ldp#contains" + (uri->string + (build-uri + 'https + #:userinfo (uri-userinfo server-name) + #:host (uri-host server-name) + #:port (uri-port server-name) + #:path contained-path)))) + (load-contained relevant-etag)) + static-graph)))) + (rdf->turtle final-graph))) + (load-static-content relevant-etag)))))))))) diff --git a/tests/crud.scm b/tests/crud.scm index 422b1da..222bcc3 100644 --- a/tests/crud.scm +++ b/tests/crud.scm @@ -1,12 +1,17 @@ (use-modules (webid-oidc server create) + (webid-oidc server read) (webid-oidc server resource content) (webid-oidc server resource path) (webid-oidc errors) (webid-oidc testing) + (webid-oidc fetch) + (webid-oidc rdf-index) (web http) (web request) (web response) - (web uri)) + (web uri) + (ice-9 receive) + (rnrs bytevectors)) (with-test-environment "crud" @@ -40,6 +45,7 @@ "i/l7asoJjJEMhngUeSt4tHVu8Zxx4EFG_FDeJfL3-oPE")) (let ((server-name (string->uri "https://example.com")) (owner (string->uri "https://alice.databox.me"))) + ;; CREATE (unless (create-root server-name owner) (exit 1)) @@ -77,4 +83,101 @@ (exit 5)) #:unwind? #t #:unwind-for-type &path-is-auxiliary)) - '(".acl" ".meta"))))) + '(".acl" ".meta")) + ;; READ + (receive (headers-root root) (read server-name owner owner "/") + ;; For root, we’re looking for the following headers: + ;; - link: ldp:BasicContainer; rel = "type", ; rel = "acl", pim:Storage; rel = "type", owner; rel = "solid:owner" + ;; - allow: GET, HEAD, OPTIONS, PUT, POST, but not DELETE + ;; - accept-put: 'text/turtle + ;; - content-type: 'text/turtle + ;; - etag: weak + ;; The content is a RDF graph, it should contain 1 triple: ldp:contains . + (when (bytevector? root) + (set! root (utf8->string root))) + (let ((links (assq-ref headers-root 'link)) + (allow (assq-ref headers-root 'allow)) + (accept-put (assq-ref headers-root 'accept-put)) + (content-type (assq-ref headers-root 'content-type)) + (etag (assq-ref headers-root 'etag))) + (unless (equal? (assoc-ref links (string->uri "http://www.w3.org/ns/ldp#BasicContainer")) + '((rel . "type"))) + (exit 6)) + (unless (equal? (assoc-ref links (string->uri "https://example.com/.acl")) + '((rel . "acl"))) + (exit 7)) + (unless (equal? (assoc-ref links (string->uri "http://www.w3.org/ns/pim/space#Storage")) + '((rel . "type"))) + (exit 8)) + (unless (equal? (assoc-ref links owner) + '((rel . "http://www.w3.org/ns/solid/terms#owner"))) + (exit 9)) + (unless (and (memq 'GET allow) + (memq 'HEAD allow) + (memq 'OPTIONS allow) + (memq 'PUT allow) + (memq 'POST allow)) + (exit 10)) + (when (memq 'DELETE allow) + (exit 11)) + (unless (equal? accept-put "text/turtle") + (exit 12)) + (unless (equal? content-type '(text/turtle)) + (exit 13)) + (unless (string? (car etag)) + (exit 14)) + (when (cdr etag) + (exit 15)) + (with-index + (fetch "https://example.com/" + #:http-get + (lambda (uri . rest) + (values + (build-response #:headers `((content-type . ,content-type))) + root))) + (lambda (rdf-match) + (when (null? (rdf-match "https://example.com/" + "http://www.w3.org/ns/ldp#contains" + "https://example.com/inbox/")) + (exit 16)))))) + (receive (headers-/.acl /.acl) (read server-name owner owner "/.acl") + ;; The ACL has the following headers: + ;; - allow: GET, HEAD, OPTIONS, PUT, DELETE, but not POST + ;; - accept-put: 'text/turtle + ;; - content-type: 'text/turtle + ;; - etag: weak + ;; The content is a RDF graph containing at least one authorization. + (when (bytevector? /.acl) + (set! /.acl (utf8->string /.acl))) + (let ((allow (assq-ref headers-/.acl 'allow)) + (accept-put (assq-ref headers-/.acl 'accept-put)) + (content-type (assq-ref headers-/.acl 'content-type)) + (etag (assq-ref headers-/.acl 'etag))) + (unless (and (memq 'GET allow) + (memq 'HEAD allow) + (memq 'OPTIONS allow) + (memq 'PUT allow) + (memq 'DELETE allow)) + (exit 17)) + (when (memq 'POST allow) + (exit 18)) + (unless (equal? accept-put "text/turtle") + (exit 19)) + (unless (equal? content-type '(text/turtle)) + (exit 20)) + (unless (string? (car etag)) + (exit 21)) + (when (cdr etag) + (exit 22)) + (with-index + (fetch "https://example.com/.acl" + #:http-get + (lambda (uri . rest) + (values + (build-response #:headers `((content-type . ,content-type))) + /.acl))) + (lambda (rdf-match) + (when (null? (rdf-match #f + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" + "http://www.w3.org/ns/auth/acl#Authorization")) + (exit 23))))))))) -- cgit v1.2.3