Comparison

mod_http_oauth2/mod_http_oauth2.lua @ 5553:67152838afbc

mod_http_oauth2: Improve error messages for URI properties Since there are separate validation checks for URI properties, including that they should use https, with better and more specific error reporting. Reverts 'luaPattern' to 'pattern' which is not currently supported by util.jsonschema, but allows anything that retrieves the schema over http to validate against it, should they wish to do so.
author Kim Alvefur <zash@zash.se>
date Sat, 17 Jun 2023 18:15:00 +0200
parent 5550:4fda06be6b08
child 5554:90449babaa48
comparison
equal deleted inserted replaced
5552:12828e969a60 5553:67152838afbc
923 uniqueItems = true; 923 uniqueItems = true;
924 items = { type = "string"; enum = { "code"; "token" } }; 924 items = { type = "string"; enum = { "code"; "token" } };
925 default = { "code" }; 925 default = { "code" };
926 }; 926 };
927 client_name = { type = "string" }; 927 client_name = { type = "string" };
928 client_uri = { type = "string"; format = "uri"; luaPattern = "^https:" }; 928 client_uri = { type = "string"; format = "uri"; pattern = "^https:" };
929 logo_uri = { type = "string"; format = "uri"; luaPattern = "^https:" }; 929 logo_uri = { type = "string"; format = "uri"; pattern = "^https:" };
930 scope = { type = "string" }; 930 scope = { type = "string" };
931 contacts = { type = "array"; minItems = 1; items = { type = "string"; format = "email" } }; 931 contacts = { type = "array"; minItems = 1; items = { type = "string"; format = "email" } };
932 tos_uri = { type = "string"; format = "uri"; luaPattern = "^https:" }; 932 tos_uri = { type = "string"; format = "uri"; pattern = "^https:" };
933 policy_uri = { type = "string"; format = "uri"; luaPattern = "^https:" }; 933 policy_uri = { type = "string"; format = "uri"; pattern = "^https:" };
934 jwks_uri = { type = "string"; format = "uri"; luaPattern = "^https:" }; 934 jwks_uri = { type = "string"; format = "uri"; pattern = "^https:" };
935 jwks = { type = "object"; description = "JSON Web Key Set, RFC 7517" }; 935 jwks = { type = "object"; description = "JSON Web Key Set, RFC 7517" };
936 software_id = { type = "string"; format = "uuid" }; 936 software_id = { type = "string"; format = "uuid" };
937 software_version = { type = "string" }; 937 software_version = { type = "string" };
938 }; 938 };
939 luaPatternProperties = { 939 luaPatternProperties = {
940 -- Localized versions of descriptive properties and URIs 940 -- Localized versions of descriptive properties and URIs
941 ["^client_name#"] = { description = "Localized version of 'client_name'"; type = "string" }; 941 ["^client_name#"] = { description = "Localized version of 'client_name'"; type = "string" };
942 ["^[a-z_]+_uri#"] = { type = "string"; format = "uri"; luaPattern = "^https:" }; 942 ["^[a-z_]+_uri#"] = { type = "string"; format = "uri" };
943 }; 943 };
944 } 944 }
945 945
946 local function redirect_uri_allowed(redirect_uri, client_uri, app_type) 946 local function redirect_uri_allowed(redirect_uri, client_uri, app_type)
947 local uri = url.parse(redirect_uri); 947 local uri = url.parse(redirect_uri);