foliolib.folio.api.passwordValidator.Validatorregistry

class foliolib.folio.api.passwordValidator.Validatorregistry(tenant: str)

Bases: foliolib.folio.FolioApi

Validator Registry

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

gettenantrulebyid(ruleId)

GET /tenant/rules/{ruleId}

gettenantrules(**kwargs)

Get a list of existing validation rules for a tenant

posttenantrules(validationRule)

Add a rule to a tenant

puttenantrule(validationRule)

Enable/disable/change the rule

gettenantrulebyid(ruleId)

GET /tenant/rules/{ruleId}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Rule not found

  • OkapiRequestFatalError – Internal server error

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Rule Schema",
    "type": "object",
    "properties": {
        "id": {
            "description": "Rule id",
            "type": "string"
        },
        "ruleId": {
            "description": "Rule id",
            "type": "string"
        },
        "name": {
            "description": "Rule name",
            "type": "string"
        },
        "type": {
            "description": "Rule type: RegExp or Programmatic or PwnedPassword",
            "type": "string",
            "enum": [
                "RegExp",
                "Programmatic",
                "PwnedPassword"
            ]
        },
        "validationType": {
            "description": "Validation type: Strong or Soft. In case of soft rule validation failure the password processing can be continued",
            "type": "string",
            "enum": [
                "Soft",
                "Strong"
            ]
        },
        "state": {
            "description": "Rule state: Enabled or Disabled",
            "type": "string",
            "enum": [
                "Enabled",
                "Disabled"
            ]
        },
        "moduleName": {
            "description": "Name of the module",
            "type": "string"
        },
        "implementationReference": {
            "description": "For Programmatic rules ImplementationReference reflects the approach to call particular validation implementation whether it REST endpoint or local service",
            "type": "string"
        },
        "expression": {
            "description": "For RegExp type contains the actual expression",
            "type": "string"
        },
        "description": {
            "description": "Validation rule description",
            "type": "string"
        },
        "orderNo": {
            "description": "Defines the order of rule processing",
            "type": "integer"
        },
        "errMessageId": {
            "description": "message identifier which should be returned to UI in case the rule validation fails",
            "type": "string"
        },
        "metadata": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "type": "object",
            "properties": {
                "createdDate": {
                    "description": "Date and time when the record was created",
                    "type": "string",
                    "format": "date-time"
                },
                "createdByUserId": {
                    "description": "ID of the user who created the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "createdByUsername": {
                    "description": "Username of the user who created the record (when available)",
                    "type": "string"
                },
                "updatedDate": {
                    "description": "Date and time when the record was last updated",
                    "type": "string",
                    "format": "date-time"
                },
                "updatedByUserId": {
                    "description": "ID of the user who last updated the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "updatedByUsername": {
                    "description": "Username of the user who last updated the record (when available)",
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "createdDate"
            ]
        }
    },
    "additionalProperties": false,
    "required": [
        "name",
        "type",
        "validationType",
        "state",
        "moduleName",
        "orderNo"
    ]
}
gettenantrules(**kwargs)

Get a list of existing validation rules for a tenant

GET /tenant/rules

Keyword Arguments
  • offset (int) – Skip over a number of elements by specifying an offset value for the query (default: 0, minimum: 0, maximum: 2147483647)

  • limit (int) – Limit the number of elements returned in the response (default: 10, minimum: 0, maximum: 2147483647)

  • query (str) – A query string to filter rules based on matching criteria in fields.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal server error

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Rules Collection",
    "type": "object",
    "properties": {
        "rules": {
            "description": "List of rules",
            "type": "array",
            "id": "ruleList",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "description": "Rule Schema",
                "type": "object",
                "properties": {
                    "id": {
                        "description": "Rule id",
                        "type": "string"
                    },
                    "ruleId": {
                        "description": "Rule id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Rule name",
                        "type": "string"
                    },
                    "type": {
                        "description": "Rule type: RegExp or Programmatic or PwnedPassword",
                        "type": "string",
                        "enum": [
                            "RegExp",
                            "Programmatic",
                            "PwnedPassword"
                        ]
                    },
                    "validationType": {
                        "description": "Validation type: Strong or Soft. In case of soft rule validation failure the password processing can be continued",
                        "type": "string",
                        "enum": [
                            "Soft",
                            "Strong"
                        ]
                    },
                    "state": {
                        "description": "Rule state: Enabled or Disabled",
                        "type": "string",
                        "enum": [
                            "Enabled",
                            "Disabled"
                        ]
                    },
                    "moduleName": {
                        "description": "Name of the module",
                        "type": "string"
                    },
                    "implementationReference": {
                        "description": "For Programmatic rules ImplementationReference reflects the approach to call particular validation implementation whether it REST endpoint or local service",
                        "type": "string"
                    },
                    "expression": {
                        "description": "For RegExp type contains the actual expression",
                        "type": "string"
                    },
                    "description": {
                        "description": "Validation rule description",
                        "type": "string"
                    },
                    "orderNo": {
                        "description": "Defines the order of rule processing",
                        "type": "integer"
                    },
                    "errMessageId": {
                        "description": "message identifier which should be returned to UI in case the rule validation fails",
                        "type": "string"
                    },
                    "metadata": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "title": "Metadata Schema",
                        "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
                        "type": "object",
                        "properties": {
                            "createdDate": {
                                "description": "Date and time when the record was created",
                                "type": "string",
                                "format": "date-time"
                            },
                            "createdByUserId": {
                                "description": "ID of the user who created the record (when available)",
                                "type": "string",
                                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                            },
                            "createdByUsername": {
                                "description": "Username of the user who created the record (when available)",
                                "type": "string"
                            },
                            "updatedDate": {
                                "description": "Date and time when the record was last updated",
                                "type": "string",
                                "format": "date-time"
                            },
                            "updatedByUserId": {
                                "description": "ID of the user who last updated the record (when available)",
                                "type": "string",
                                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                            },
                            "updatedByUsername": {
                                "description": "Username of the user who last updated the record (when available)",
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "required": [
                            "createdDate"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name",
                    "type",
                    "validationType",
                    "state",
                    "moduleName",
                    "orderNo"
                ]
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "rules",
        "totalRecords"
    ]
}
posttenantrules(validationRule)

Add a rule to a tenant

POST /tenant/rules

Parameters

validationRule (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal server error

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Rule Schema",
    "type": "object",
    "properties": {
        "id": {
            "description": "Rule id",
            "type": "string"
        },
        "ruleId": {
            "description": "Rule id",
            "type": "string"
        },
        "name": {
            "description": "Rule name",
            "type": "string"
        },
        "type": {
            "description": "Rule type: RegExp or Programmatic or PwnedPassword",
            "type": "string",
            "enum": [
                "RegExp",
                "Programmatic",
                "PwnedPassword"
            ]
        },
        "validationType": {
            "description": "Validation type: Strong or Soft. In case of soft rule validation failure the password processing can be continued",
            "type": "string",
            "enum": [
                "Soft",
                "Strong"
            ]
        },
        "state": {
            "description": "Rule state: Enabled or Disabled",
            "type": "string",
            "enum": [
                "Enabled",
                "Disabled"
            ]
        },
        "moduleName": {
            "description": "Name of the module",
            "type": "string"
        },
        "implementationReference": {
            "description": "For Programmatic rules ImplementationReference reflects the approach to call particular validation implementation whether it REST endpoint or local service",
            "type": "string"
        },
        "expression": {
            "description": "For RegExp type contains the actual expression",
            "type": "string"
        },
        "description": {
            "description": "Validation rule description",
            "type": "string"
        },
        "orderNo": {
            "description": "Defines the order of rule processing",
            "type": "integer"
        },
        "errMessageId": {
            "description": "message identifier which should be returned to UI in case the rule validation fails",
            "type": "string"
        },
        "metadata": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "type": "object",
            "properties": {
                "createdDate": {
                    "description": "Date and time when the record was created",
                    "type": "string",
                    "format": "date-time"
                },
                "createdByUserId": {
                    "description": "ID of the user who created the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "createdByUsername": {
                    "description": "Username of the user who created the record (when available)",
                    "type": "string"
                },
                "updatedDate": {
                    "description": "Date and time when the record was last updated",
                    "type": "string",
                    "format": "date-time"
                },
                "updatedByUserId": {
                    "description": "ID of the user who last updated the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "updatedByUsername": {
                    "description": "Username of the user who last updated the record (when available)",
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "createdDate"
            ]
        }
    },
    "additionalProperties": false,
    "required": [
        "name",
        "type",
        "validationType",
        "state",
        "moduleName",
        "orderNo"
    ]
}
puttenantrule(validationRule)

Enable/disable/change the rule

PUT /tenant/rules

Parameters

validationRule (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Rule not found

  • OkapiRequestFatalError – Internal server error

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Rule Schema",
    "type": "object",
    "properties": {
        "id": {
            "description": "Rule id",
            "type": "string"
        },
        "ruleId": {
            "description": "Rule id",
            "type": "string"
        },
        "name": {
            "description": "Rule name",
            "type": "string"
        },
        "type": {
            "description": "Rule type: RegExp or Programmatic or PwnedPassword",
            "type": "string",
            "enum": [
                "RegExp",
                "Programmatic",
                "PwnedPassword"
            ]
        },
        "validationType": {
            "description": "Validation type: Strong or Soft. In case of soft rule validation failure the password processing can be continued",
            "type": "string",
            "enum": [
                "Soft",
                "Strong"
            ]
        },
        "state": {
            "description": "Rule state: Enabled or Disabled",
            "type": "string",
            "enum": [
                "Enabled",
                "Disabled"
            ]
        },
        "moduleName": {
            "description": "Name of the module",
            "type": "string"
        },
        "implementationReference": {
            "description": "For Programmatic rules ImplementationReference reflects the approach to call particular validation implementation whether it REST endpoint or local service",
            "type": "string"
        },
        "expression": {
            "description": "For RegExp type contains the actual expression",
            "type": "string"
        },
        "description": {
            "description": "Validation rule description",
            "type": "string"
        },
        "orderNo": {
            "description": "Defines the order of rule processing",
            "type": "integer"
        },
        "errMessageId": {
            "description": "message identifier which should be returned to UI in case the rule validation fails",
            "type": "string"
        },
        "metadata": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "type": "object",
            "properties": {
                "createdDate": {
                    "description": "Date and time when the record was created",
                    "type": "string",
                    "format": "date-time"
                },
                "createdByUserId": {
                    "description": "ID of the user who created the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "createdByUsername": {
                    "description": "Username of the user who created the record (when available)",
                    "type": "string"
                },
                "updatedDate": {
                    "description": "Date and time when the record was last updated",
                    "type": "string",
                    "format": "date-time"
                },
                "updatedByUserId": {
                    "description": "ID of the user who last updated the record (when available)",
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                },
                "updatedByUsername": {
                    "description": "Username of the user who last updated the record (when available)",
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "createdDate"
            ]
        }
    },
    "additionalProperties": false,
    "required": [
        "name",
        "type",
        "validationType",
        "state",
        "moduleName",
        "orderNo"
    ]
}