Prepare jsonschema replacement for identity.{group,user}

Change-Id: I2569fe4e6685f14d57699e51ccaf9d4ef8cefd43
This commit is contained in:
Artem Goncharov 2025-01-09 12:16:36 +01:00
parent f4fe3bd80a
commit 9cbf8d9c2b

View File

@ -19,43 +19,43 @@ from codegenerator.common.schema import TypeSchema
USER_LIST_PARAMETERS: dict[str, Any] = {
"domain_id": {
"users_domain_id": {
"in": "query",
"name": "domain_id",
"description": "Filters the response by a domain ID.",
"schema": {"type": "string", "format": "uuid"},
},
"enabled": {
"users_enabled": {
"in": "query",
"name": "enabled",
"description": "If set to true, then only enabled projects will be returned. Any value other than 0 (including no value) will be interpreted as true.",
"schema": {"type": "boolean"},
},
"idp_id": {
"users_idp_id": {
"in": "query",
"name": "idp_id",
"description": "Filters the response by IDP ID.",
"schema": {"type": "string", "format": "uuid"},
},
"name": {
"users_name": {
"in": "query",
"name": "name",
"description": "Filters the response by a resource name.",
"schema": {"type": "string"},
},
"password_expires_at": {
"users_password_expires_at": {
"in": "query",
"name": "password_expires_at",
"description": "Filter results based on which user passwords have expired. The query should include an operator and a timestamp with a colon (:) separating the two, for example: `password_expires_at={operator}:{timestamp}`.\nValid operators are: `lt`, `lte`, `gt`, `gte`, `eq`, and `neq`.\nValid timestamps are of the form: YYYY-MM-DDTHH:mm:ssZ.",
"schema": {"type": "string", "format": "date-time"},
},
"protocol_id": {
"users_protocol_id": {
"in": "query",
"name": "protocol_id",
"description": "Filters the response by a protocol ID.",
"schema": {"type": "string", "format": "uuid"},
},
"unique_id": {
"users_unique_id": {
"in": "query",
"name": "unique_id",
"description": "Filters the response by a unique ID.",
@ -74,12 +74,36 @@ USER_SCHEMA: dict[str, Any] = {
USER_CREATE_SCHEMA: dict[str, Any] = {
"type": "object",
"properties": {"user": identity_schema.user_create},
"properties": {
"user": {
"type": "object",
"properties": {
"password": {"type": ["string", "null"]},
**identity_schema._user_properties,
},
"required": ["name"],
"additionalProperties": True,
}
},
"required": ["user"],
"additionalProperties": False,
}
USER_PATCH_SCHEMA: dict[str, Any] = {
"type": "object",
"properties": {"user": identity_schema.user_update},
"properties": {
"user": {
"type": "object",
"properties": {
"password": {"type": ["string", "null"]},
**identity_schema._user_properties,
},
"minProperties": 1,
"additionalProperties": True,
}
},
"required": ["user"],
"additionalProperties": False,
}