diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2023-09-03 20:20:10 +1000 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-03 20:20:10 +1000 | 
| commit | 8e4e8ce8768fb1cabef13a794454cf4486a65f64 (patch) | |
| tree | e189c47641b727fe36db4f05386a81c413c8febe /cmd/authelia-gen | |
| parent | 99def7194d691e362bef6c0fd1a2c1c24c6b7a90 (diff) | |
build(deps): update module github.com/authelia/jsonschema to v0.1.7 (#5950)
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'cmd/authelia-gen')
| -rw-r--r-- | cmd/authelia-gen/cmd_docs_jsonschema.go | 31 | 
1 files changed, 11 insertions, 20 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),  		}  	}  | 
