Documentation ¶
Index ¶
- Constants
- func ContextSetRoot(err *jsonschema.ValidationError, head string) *jsonschema.ValidationError
- func GetKeysInOrder(schemaRef string) ([]string, error)
- func NewDuplicateCredentialsError() error
- func NewInvalidCredentialsError() error
- func NewInvalidFormatError(instancePtr, format, value string) error
- func NewMinLengthError(instancePtr string, expected, actual int) error
- func NewPasswordPolicyViolationError(instancePtr string, reason string) error
- func NewRequiredError(missingPtr, missingFieldName string) error
- func WithExtensionRunner(e *ExtensionRunner) func(*validatorOptions)
- type Extension
- type ExtensionConfig
- type ExtensionRunner
- type ExtensionRunnerMetaSchema
- type Handler
- type HandlerProvider
- type Schema
- type Schemas
- type ValidationError
- type ValidationErrorContextDuplicateCredentialsError
- type ValidationErrorContextInvalidCredentialsError
- type ValidationErrorContextPasswordPolicyViolation
- type ValidationProvider
- type Validator
Constants ¶
View Source
const SchemasPath string = "schemas"
Variables ¶
This section is empty.
Functions ¶
func ContextSetRoot ¶
func ContextSetRoot(err *jsonschema.ValidationError, head string) *jsonschema.ValidationError
func GetKeysInOrder ¶
func NewDuplicateCredentialsError ¶
func NewDuplicateCredentialsError() error
func NewInvalidCredentialsError ¶
func NewInvalidCredentialsError() error
func NewInvalidFormatError ¶
func NewMinLengthError ¶
func NewRequiredError ¶
func WithExtensionRunner ¶
func WithExtensionRunner(e *ExtensionRunner) func(*validatorOptions)
Types ¶
type Extension ¶
type Extension interface { Run(ctx jsonschema.ValidationContext, config ExtensionConfig, value interface{}) error Finish() error }
type ExtensionConfig ¶
type ExtensionConfig struct { Credentials struct { Password struct { Identifier bool `json:"identifier"` } `json:"password"` } `json:"credentials"` Verification struct { Via string `json:"via"` } `json:"verification"` Recovery struct { Via string `json:"via"` } `json:"recovery"` Mappings struct { Identity struct { Traits []struct { Path string `json:"path"` } `json:"traits"` } `json:"identity"` } `json:"mappings"` }
type ExtensionRunner ¶
type ExtensionRunner struct {
// contains filtered or unexported fields
}
func NewExtensionRunner ¶
func NewExtensionRunner(meta ExtensionRunnerMetaSchema, runners ...Extension) (*ExtensionRunner, error)
func (*ExtensionRunner) AddRunner ¶
func (r *ExtensionRunner) AddRunner(run Extension) *ExtensionRunner
func (*ExtensionRunner) Extension ¶
func (r *ExtensionRunner) Extension() jsonschema.Extension
func (*ExtensionRunner) Finish ¶
func (r *ExtensionRunner) Finish() error
func (*ExtensionRunner) Register ¶
func (r *ExtensionRunner) Register(compiler *jsonschema.Compiler) *ExtensionRunner
type ExtensionRunnerMetaSchema ¶
type ExtensionRunnerMetaSchema string
const (
ExtensionRunnerIdentityMetaSchema ExtensionRunnerMetaSchema = "extension/identity.schema.json"
)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(r handlerDependencies) *Handler
func (*Handler) RegisterAdminRoutes ¶
func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin)
func (*Handler) RegisterPublicRoutes ¶
func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic)
type HandlerProvider ¶
type HandlerProvider interface {
SchemaHandler() *Handler
}
type ValidationError ¶
type ValidationErrorContextDuplicateCredentialsError ¶
type ValidationErrorContextDuplicateCredentialsError struct{}
func (*ValidationErrorContextDuplicateCredentialsError) AddContext ¶
func (r *ValidationErrorContextDuplicateCredentialsError) AddContext(_, _ string)
func (*ValidationErrorContextDuplicateCredentialsError) FinishInstanceContext ¶
func (r *ValidationErrorContextDuplicateCredentialsError) FinishInstanceContext()
type ValidationErrorContextInvalidCredentialsError ¶
type ValidationErrorContextInvalidCredentialsError struct{}
func (*ValidationErrorContextInvalidCredentialsError) AddContext ¶
func (r *ValidationErrorContextInvalidCredentialsError) AddContext(_, _ string)
func (*ValidationErrorContextInvalidCredentialsError) FinishInstanceContext ¶
func (r *ValidationErrorContextInvalidCredentialsError) FinishInstanceContext()
type ValidationErrorContextPasswordPolicyViolation ¶
type ValidationErrorContextPasswordPolicyViolation struct {
Reason string
}
func (*ValidationErrorContextPasswordPolicyViolation) AddContext ¶
func (r *ValidationErrorContextPasswordPolicyViolation) AddContext(_, _ string)
func (*ValidationErrorContextPasswordPolicyViolation) FinishInstanceContext ¶
func (r *ValidationErrorContextPasswordPolicyViolation) FinishInstanceContext()
type ValidationProvider ¶
type ValidationProvider interface {
SchemaValidator() *Validator
}
Click to show internal directories.
Click to hide internal directories.