X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fvalidation.py;h=620272f5ec3eeed4dddc9754490452d22ae68888;hp=e5c2a0328fe2addfbad187fd8aef8325b7f3fe15;hb=HEAD;hpb=e88401b595fe816b34308f1960aa7b545590f5dc diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index e5c2a03..620272f 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -35,6 +35,10 @@ shortname_schema = { "pattern": "^[^,;()\\.\\$'\"]+$", } passwd_schema = {"type": "string", "minLength": 1, "maxLength": 60} +user_passwd_schema = { + "type": "string", + "pattern": "^.*(?=.{8,})((?=.*[!@#$%^&*()\\-_=+{};:,<.>]){1})(?=.*\\d)((?=.*[a-z]){1})((?=.*[A-Z]){1}).*$", +} name_schema = { "type": "string", "minLength": 1, @@ -637,6 +641,23 @@ ns_verticalscale = { "additionalProperties": False, } +nslcmop_cancel = { + "title": "Cancel nslcmop input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "nsLcmOpOccId": id_schema, + "cancelMode": { + "enum": [ + "GRACEFUL", + "FORCEFUL", + ] + }, + }, + "required": ["cancelMode"], + "additionalProperties": False, +} + schema_version = {"type": "string", "enum": ["1.0"]} schema_type = {"type": "string"} vim_type = shortname_schema # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]} @@ -811,12 +832,11 @@ k8scluster_deploy_method_schema = { "title": "Deployment methods for K8s cluster", "type": "object", "properties": { - "helm-chart": {"type": "boolean"}, "juju-bundle": {"type": "boolean"}, "helm-chart-v3": {"type": "boolean"}, }, "additionalProperties": False, - "minProperties": 3, + "minProperties": 2, } k8scluster_nets_schema = { "title": "k8scluster nets input schema", @@ -926,6 +946,10 @@ k8srepo_properties = { "description": description_schema, "type": k8srepo_types, "url": description_schema, + "cacert": long_description_schema, + "user": string_schema, + "password": passwd_schema, + "oci": bool_schema, } k8srepo_new_schema = { "title": "k8scluster creation input schema", @@ -1082,7 +1106,7 @@ user_new_schema = { "properties": { "username": string_schema, "domain_name": shortname_schema, - "password": passwd_schema, + "password": user_passwd_schema, "projects": nameshort_list_schema, "project_role_mappings": project_role_mappings, }, @@ -1094,13 +1118,16 @@ user_edit_schema = { "title": "User edit schema for administrators", "type": "object", "properties": { - "password": passwd_schema, + "password": user_passwd_schema, "old_password": passwd_schema, "username": string_schema, # To allow User Name modification "projects": {"oneOf": [nameshort_list_schema, array_edition_schema]}, "project_role_mappings": project_role_mappings, "add_project_role_mappings": project_role_mappings, "remove_project_role_mappings": project_role_mappings_optional, + "system_admin_id": id_schema, + "unlock": bool_schema, + "renew": bool_schema, }, "minProperties": 1, "additionalProperties": False,