diff options
| -rw-r--r-- | cmd/authelia-gen/cmd_docs_jsonschema.go | 31 | ||||
| -rw-r--r-- | docs/static/schemas/latest/json-schema/configuration.json | 59 | ||||
| -rw-r--r-- | docs/static/schemas/v4.38/json-schema/configuration.json | 59 | ||||
| -rw-r--r-- | go.mod | 4 | ||||
| -rw-r--r-- | go.sum | 10 | ||||
| -rw-r--r-- | internal/configuration/schema/types.go | 46 | ||||
| -rw-r--r-- | internal/configuration/schema/types_address.go | 10 |
7 files changed, 59 insertions, 160 deletions
diff --git a/cmd/authelia-gen/cmd_docs_jsonschema.go b/cmd/authelia-gen/cmd_docs_jsonschema.go index 74ffbde29..8e0e54632 100644 --- a/cmd/authelia-gen/cmd_docs_jsonschema.go +++ b/cmd/authelia-gen/cmd_docs_jsonschema.go @@ -315,52 +315,43 @@ func jsonschemaKoanfMapper(t reflect.Type) *jsonschema.Schema { switch t.String() { case "regexp.Regexp", "*regexp.Regexp": return &jsonschema.Schema{ - Type: "string", - Format: "regex", + Type: jsonschema.TypeString, + Format: jsonschema.FormatStringRegex, } case "time.Duration", "*time.Duration": return &jsonschema.Schema{ OneOf: []*jsonschema.Schema{ { - Type: "string", - Pattern: `^\d+\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\s*\d+\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$`, - Comments: "Example comment", + Type: jsonschema.TypeString, + Pattern: `^\d+\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\s*\d+\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$`, }, { - Type: "integer", + Type: jsonschema.TypeInteger, Description: "The duration in seconds", }, }, } case "schema.CryptographicKey": return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, } case "schema.CryptographicPrivateKey": return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Pattern: `^-{5}(BEGIN ((RSA|EC) )?PRIVATE KEY-{5}\n([a-zA-Z0-9/+]{1,64}\n)+([a-zA-Z0-9/+]{1,64}[=]{0,2})\n-{5}END ((RSA|EC) )?PRIVATE KEY-{5}\n?)+$`, } case "rsa.PrivateKey", "*rsa.PrivateKey", "ecdsa.PrivateKey", "*.ecdsa.PrivateKey": return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, } case "mail.Address", "*mail.Address": return &jsonschema.Schema{ - OneOf: []*jsonschema.Schema{ - { - Type: "string", - Pattern: `^[a-zA-Z0-9.!#$%&'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$`, - }, - { - Type: "string", - Pattern: `^[^<]+ <[a-zA-Z0-9.!#$%&'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*>$`, - }, - }, + Type: jsonschema.TypeString, + Format: jsonschema.FormatStringEmail, } case "schema.CSPTemplate": return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Default: buildCSP(codeCSPProductionDefaultSrc, codeCSPValuesCommon, codeCSPValuesProduction), } } diff --git a/docs/static/schemas/latest/json-schema/configuration.json b/docs/static/schemas/latest/json-schema/configuration.json index 908a3ccfe..a57d0b88f 100644 --- a/docs/static/schemas/latest/json-schema/configuration.json +++ b/docs/static/schemas/latest/json-schema/configuration.json @@ -686,7 +686,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1271,7 +1270,6 @@ "pre_configured_consent_duration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1536,7 +1534,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1551,7 +1548,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1566,7 +1562,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1581,7 +1576,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1640,7 +1634,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1655,7 +1648,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1670,7 +1662,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1685,7 +1676,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1707,7 +1697,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1722,7 +1711,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1737,7 +1725,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1752,7 +1739,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1767,7 +1753,6 @@ "jwt_secured_authorization": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1804,7 +1789,6 @@ "context_lifespan": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1974,7 +1958,6 @@ "max_desync": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2053,7 +2036,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2082,16 +2064,8 @@ "default": "localhost" }, "sender": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" - }, - { - "type": "string", - "pattern": "^[^\u003c]+ \u003c[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*\u003e$" - } - ], + "type": "string", + "format": "email", "title": "Sender", "description": "The sender used for SMTP" }, @@ -2102,18 +2076,11 @@ "default": "[Authelia] {title}" }, "startup_check_address": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" - }, - { - "type": "string", - "pattern": "^[^\u003c]+ \u003c[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*\u003e$" - } - ], + "type": "string", + "format": "email", "title": "Startup Check Address", - "description": "The address used for the recipient in the startup check" + "description": "The address used for the recipient in the startup check", + "default": "Authelia Test \u003ctest@authelia.com\u003e" }, "disable_require_tls": { "type": "boolean", @@ -2277,7 +2244,6 @@ "find_time": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2292,7 +2258,6 @@ "ban_time": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2509,7 +2474,6 @@ "read": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2524,7 +2488,6 @@ "write": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2539,7 +2502,6 @@ "idle": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2574,7 +2536,6 @@ "expiration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2587,7 +2548,6 @@ "inactivity": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2600,7 +2560,6 @@ "remember_me": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2659,7 +2618,6 @@ "expiration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2672,7 +2630,6 @@ "inactivity": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2685,7 +2642,6 @@ "remember_me": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2890,7 +2846,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2945,7 +2900,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -3193,7 +3147,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, diff --git a/docs/static/schemas/v4.38/json-schema/configuration.json b/docs/static/schemas/v4.38/json-schema/configuration.json index 908a3ccfe..a57d0b88f 100644 --- a/docs/static/schemas/v4.38/json-schema/configuration.json +++ b/docs/static/schemas/v4.38/json-schema/configuration.json @@ -686,7 +686,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1271,7 +1270,6 @@ "pre_configured_consent_duration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1536,7 +1534,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1551,7 +1548,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1566,7 +1562,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1581,7 +1576,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1640,7 +1634,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1655,7 +1648,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1670,7 +1662,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1685,7 +1676,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1707,7 +1697,6 @@ "access_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1722,7 +1711,6 @@ "authorize_code": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1737,7 +1725,6 @@ "id_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1752,7 +1739,6 @@ "refresh_token": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1767,7 +1753,6 @@ "jwt_secured_authorization": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1804,7 +1789,6 @@ "context_lifespan": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -1974,7 +1958,6 @@ "max_desync": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2053,7 +2036,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2082,16 +2064,8 @@ "default": "localhost" }, "sender": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" - }, - { - "type": "string", - "pattern": "^[^\u003c]+ \u003c[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*\u003e$" - } - ], + "type": "string", + "format": "email", "title": "Sender", "description": "The sender used for SMTP" }, @@ -2102,18 +2076,11 @@ "default": "[Authelia] {title}" }, "startup_check_address": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" - }, - { - "type": "string", - "pattern": "^[^\u003c]+ \u003c[a-zA-Z0-9.!#$%\u0026'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*\u003e$" - } - ], + "type": "string", + "format": "email", "title": "Startup Check Address", - "description": "The address used for the recipient in the startup check" + "description": "The address used for the recipient in the startup check", + "default": "Authelia Test \u003ctest@authelia.com\u003e" }, "disable_require_tls": { "type": "boolean", @@ -2277,7 +2244,6 @@ "find_time": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2292,7 +2258,6 @@ "ban_time": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2509,7 +2474,6 @@ "read": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2524,7 +2488,6 @@ "write": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2539,7 +2502,6 @@ "idle": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2574,7 +2536,6 @@ "expiration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2587,7 +2548,6 @@ "inactivity": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2600,7 +2560,6 @@ "remember_me": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2659,7 +2618,6 @@ "expiration": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2672,7 +2630,6 @@ "inactivity": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2685,7 +2642,6 @@ "remember_me": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2890,7 +2846,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -2945,7 +2900,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -3193,7 +3147,6 @@ "timeout": { "oneOf": [ { - "$comment": "Example comment", "type": "string", "pattern": "^\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?))(\\s*\\d+\\s*(y|M|w|d|h|m|s|ms|((year|month|week|day|hour|minute|second|millisecond)s?)))*$" }, @@ -5,7 +5,7 @@ go 1.21 require ( github.com/Gurpartap/logrus-stack v0.0.0-20170710170904-89c00d8a28f4 github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d - github.com/authelia/jsonschema v0.1.5 + github.com/authelia/jsonschema v0.1.7 github.com/deckarep/golang-set/v2 v2.3.1 github.com/duosecurity/duo_api_golang v0.0.0-20230418202038-096d3306c029 github.com/fasthttp/router v1.4.20 @@ -81,7 +81,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/iancoleman/orderedmap v0.2.0 // indirect + github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect @@ -52,8 +52,10 @@ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/authelia/jsonschema v0.1.5 h1:y8ZND9c1UIhhpimZRU4WshhyG76jmZOWZ2HS0XPYHbk= -github.com/authelia/jsonschema v0.1.5/go.mod h1:v8XIVOs8fPffQr+9HPT2HJxlvD/Miwyss4petlzUOxk= +github.com/authelia/jsonschema v0.1.6 h1:l+AEmNtlCIq+gLyzDCHgfcnjOsjh+iMRukcfd6ocyIs= +github.com/authelia/jsonschema v0.1.6/go.mod h1:9l5WAhb73MyveI+xnNGK2Q367ynzLRAYHrN/PPcxptM= +github.com/authelia/jsonschema v0.1.7 h1:RbtTeTG7GiWIrx2A+3O+b33jr/mLlSmqGYyk1w5gLNA= +github.com/authelia/jsonschema v0.1.7/go.mod h1:9l5WAhb73MyveI+xnNGK2Q367ynzLRAYHrN/PPcxptM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -257,8 +259,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= -github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= diff --git a/internal/configuration/schema/types.go b/internal/configuration/schema/types.go index 7368cf023..7c4969a97 100644 --- a/internal/configuration/schema/types.go +++ b/internal/configuration/schema/types.go @@ -19,7 +19,7 @@ import ( "github.com/go-crypt/crypt/algorithm" "github.com/go-crypt/crypt/algorithm/plaintext" "github.com/valyala/fasthttp" - "gopkg.in/yaml.v3" + yaml "gopkg.in/yaml.v3" ) var cdecoder algorithm.DecoderRegister @@ -63,7 +63,7 @@ type PasswordDigest struct { // JSONSchema returns the JSON Schema information for the PasswordDigest type. func (PasswordDigest) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Pattern: `^\$((argon2(id|i|d)\$v=19\$m=\d+,t=\d+,p=\d+|scrypt\$ln=\d+,r=\d+,p=\d+)\$[a-zA-Z0-9\/+]+\$[a-zA-Z0-9\/+]+|pbkdf2(-sha(224|256|384|512))?\$\d+\$[a-zA-Z0-9\/.]+\$[a-zA-Z0-9\/.]+|bcrypt-sha256\$v=2,t=2b,r=\d+\$[a-zA-Z0-9\/.]+\$[a-zA-Z0-9\/.]+|2(a|b|y)?\$\d+\$[a-zA-Z0-9.\/]+|(5|6)\$rounds=\d+\$[a-zA-Z0-9.\/]+\$[a-zA-Z0-9.\/]+|plaintext\$.+|base64\$[a-zA-Z0-9.=\/]+)$`, } } @@ -180,7 +180,7 @@ type TLSVersion struct { // JSONSchema returns the JSON Schema information for the TLSVersion type. func (TLSVersion) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Enum: []any{ "TLS1.0", "TLS1.1", @@ -243,7 +243,7 @@ type X509CertificateChain struct { // JSONSchema returns the JSON Schema information for the X509CertificateChain type. func (X509CertificateChain) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Pattern: `^(-{5}BEGIN CERTIFICATE-{5}\n([a-zA-Z0-9/+]{1,64}\n)+([a-zA-Z0-9/+]{1,64}[=]{0,2})\n-{5}END CERTIFICATE-{5}\n?)+$`, } } @@ -416,7 +416,7 @@ func (IdentityProvidersOpenIDConnectClientRedirectURIs) JSONSchema() *jsonschema OneOf: []*jsonschema.Schema{ &jsonschemaURI, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschemaURI, UniqueItems: true, }, @@ -432,7 +432,7 @@ func (AccessControlNetworkNetworks) JSONSchema() *jsonschema.Schema { OneOf: []*jsonschema.Schema{ &jsonschemaACLNetwork, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschemaACLNetwork, UniqueItems: true, }, @@ -453,7 +453,7 @@ func (AccessControlRuleMethods) JSONSchema() *jsonschema.Schema { OneOf: []*jsonschema.Schema{ &jsonschemaACLMethod, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschemaACLMethod, UniqueItems: true, }, @@ -468,14 +468,14 @@ func (AccessControlRuleRegex) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ OneOf: []*jsonschema.Schema{ { - Type: "string", - Format: "regex", + Type: jsonschema.TypeString, + Format: jsonschema.FormatStringRegex, }, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschema.Schema{ - Type: "string", - Format: "regex", + Type: jsonschema.TypeString, + Format: jsonschema.FormatStringRegex, }, UniqueItems: true, }, @@ -491,13 +491,13 @@ func (AccessControlRuleSubjects) JSONSchema() *jsonschema.Schema { OneOf: []*jsonschema.Schema{ &jsonschemaACLSubject, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschemaACLSubject, }, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschema.Schema{ - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschemaACLSubject, }, UniqueItems: true, @@ -509,19 +509,19 @@ func (AccessControlRuleSubjects) JSONSchema() *jsonschema.Schema { type CSPTemplate string var jsonschemaURI = jsonschema.Schema{ - Type: "string", - Format: "uri", + Type: jsonschema.TypeString, + Format: jsonschema.FormatStringURI, } var jsonschemaWeakStringUniqueSlice = jsonschema.Schema{ OneOf: []*jsonschema.Schema{ { - Type: "string", + Type: jsonschema.TypeString, }, { - Type: "array", + Type: jsonschema.TypeArray, Items: &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, }, UniqueItems: true, }, @@ -529,17 +529,17 @@ var jsonschemaWeakStringUniqueSlice = jsonschema.Schema{ } var jsonschemaACLNetwork = jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Pattern: `((^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/([0-2]?[0-9]|3[0-2]))?$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))?(\/(12[0-8]|1[0-1][0-9]|[0-9]{1,2}))?$))`, } var jsonschemaACLSubject = jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Pattern: "^(user|group):.+$", } var jsonschemaACLMethod = jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Enum: []any{ fasthttp.MethodGet, fasthttp.MethodHead, diff --git a/internal/configuration/schema/types_address.go b/internal/configuration/schema/types_address.go index 3c7ce7cd5..75b28914c 100644 --- a/internal/configuration/schema/types_address.go +++ b/internal/configuration/schema/types_address.go @@ -134,7 +134,7 @@ type AddressTCP struct { // JSONSchema returns the appropriate *jsonschema.Schema for this type. func (AddressTCP) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Format: "uri", Pattern: `^((tcp(4|6)?:\/\/)?([^:\/]*(:\d+)|[^:\/]+(:\d+)?)(\/.*)?|unix:\/\/\/[^?\n]+(\?umask=[0-7]{3,4})?)$`, } @@ -148,7 +148,7 @@ type AddressUDP struct { // JSONSchema returns the appropriate *jsonschema.Schema for this type. func (AddressUDP) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Format: "uri", Pattern: `^(udp(4|6)?:\/\/)?([^:\/]*(:\d+)|[^:\/]+(:\d+)?)(\/.*)?$`, } @@ -162,7 +162,7 @@ type AddressLDAP struct { // JSONSchema returns the appropriate *jsonschema.Schema for this type. func (AddressLDAP) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Format: "uri", Pattern: `^((ldaps?:\/\/)?([^:\/]*(:\d+)|[^:\/]+(:\d+)?)?|ldapi:\/\/(\/[^?\n]+)?)$`, } @@ -176,7 +176,7 @@ type AddressSMTP struct { // JSONSchema returns the appropriate *jsonschema.Schema for this type. func (AddressSMTP) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Format: "uri", Pattern: `^((smtp|submissions?):\/\/)?([^:\/]*(:\d+)|[^:\/]+(:\d+)?)?$`, } @@ -195,7 +195,7 @@ type Address struct { // JSONSchema returns the appropriate *jsonschema.Schema for this type. func (Address) JSONSchema() *jsonschema.Schema { return &jsonschema.Schema{ - Type: "string", + Type: jsonschema.TypeString, Format: "uri", Pattern: `^((unix:\/\/)?\/[^?\n]+(\?umask=[0-7]{3,4})?|ldapi:\/\/(\/[^?\n]+)?|(((tcp|udp)(4|6)?|ldaps?|smtp|submissions?):\/\/)?[^:\/]*(:\d+)?(\/.*)?)$`, } |
