diff --git a/CHANGELOG.md b/CHANGELOG.md index 2844a9035..4ad9b7f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,13 @@ - new model classes `RunnerLabel` and `ListRunnerLabels` - [v0.5.1](services/git/CHANGELOG.md#v051) - **Bugfix:** Prevent year 0 timestamp issue -- `intake`: [v0.2.1](services/intake/CHANGELOG.md#v021) - - **Bugfix:** Prevent year 0 timestamp issue +- `intake`: + - [v0.3.0](services/intake/CHANGELOG.md#v030) + - Validate `display_name` attribute regular expression using a field validator in model classes `CreateIntakePayload`, `CreateIntakeRunnerPayload` and `CreateIntakeUserPayload` + - Set minimum length (`12`) for `password` attribute in model class `CreateIntakeUserPayload` + - Set maximum length from `32` to `1024` for `table_name` attribute in `IntakeCatalog` and `IntakeCatalogPatch` model classes + - [v0.2.1](services/intake/CHANGELOG.md#v021) + - **Bugfix:** Prevent year 0 timestamp issue - `kms`: [v0.4.1](services/kms/CHANGELOG.md#v041) - **Bugfix:** Prevent year 0 timestamp issue - `modelserving`: [v0.2.2](services/modelserving/CHANGELOG.md#v022) diff --git a/services/intake/CHANGELOG.md b/services/intake/CHANGELOG.md index f26501e68..a9aa05558 100644 --- a/services/intake/CHANGELOG.md +++ b/services/intake/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.3.0 +- Validate `display_name` attribute regular expression using a field validator in model classes `CreateIntakePayload`, `CreateIntakeRunnerPayload` and `CreateIntakeUserPayload` +- Set minimum length (`12`) for `password` attribute in model class `CreateIntakeUserPayload` +- Set maximum length from `32` to `1024` for `table_name` attribute in `IntakeCatalog` and `IntakeCatalogPatch` model classes + ## v0.2.1 - **Bugfix:** Prevent year 0 timestamp issue diff --git a/services/intake/pyproject.toml b/services/intake/pyproject.toml index a197783de..0e078be25 100644 --- a/services/intake/pyproject.toml +++ b/services/intake/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-intake" [tool.poetry] name = "stackit-intake" -version = "v0.2.1" +version = "v0.3.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/intake/src/stackit/intake/__init__.py b/services/intake/src/stackit/intake/__init__.py index 8071b90db..0a853325b 100644 --- a/services/intake/src/stackit/intake/__init__.py +++ b/services/intake/src/stackit/intake/__init__.py @@ -7,7 +7,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/api/default_api.py b/services/intake/src/stackit/intake/api/default_api.py index c390081f8..af6580265 100644 --- a/services/intake/src/stackit/intake/api/default_api.py +++ b/services/intake/src/stackit/intake/api/default_api.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/api_client.py b/services/intake/src/stackit/intake/api_client.py index c834617a8..03d77a9cf 100644 --- a/services/intake/src/stackit/intake/api_client.py +++ b/services/intake/src/stackit/intake/api_client.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/configuration.py b/services/intake/src/stackit/intake/configuration.py index 29f5ea7bc..096010a74 100644 --- a/services/intake/src/stackit/intake/configuration.py +++ b/services/intake/src/stackit/intake/configuration.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/exceptions.py b/services/intake/src/stackit/intake/exceptions.py index fda8f07ec..4ee368e33 100644 --- a/services/intake/src/stackit/intake/exceptions.py +++ b/services/intake/src/stackit/intake/exceptions.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/__init__.py b/services/intake/src/stackit/intake/models/__init__.py index 738ca21fd..03e270cfe 100644 --- a/services/intake/src/stackit/intake/models/__init__.py +++ b/services/intake/src/stackit/intake/models/__init__.py @@ -6,7 +6,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/catalog_auth.py b/services/intake/src/stackit/intake/models/catalog_auth.py index a95ae8661..f36b4932f 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth.py +++ b/services/intake/src/stackit/intake/models/catalog_auth.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/catalog_auth_patch.py b/services/intake/src/stackit/intake/models/catalog_auth_patch.py index 7d4bfb5d6..62fad4bed 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth_patch.py +++ b/services/intake/src/stackit/intake/models/catalog_auth_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/catalog_auth_type.py b/services/intake/src/stackit/intake/models/catalog_auth_type.py index 405b4c038..fe6800ae4 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth_type.py +++ b/services/intake/src/stackit/intake/models/catalog_auth_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/client_config.py b/services/intake/src/stackit/intake/models/client_config.py index 4ae42a219..2d869633f 100644 --- a/services/intake/src/stackit/intake/models/client_config.py +++ b/services/intake/src/stackit/intake/models/client_config.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/create_intake_payload.py b/services/intake/src/stackit/intake/models/create_intake_payload.py index 3cb335b11..07c102d82 100644 --- a/services/intake/src/stackit/intake/models/create_intake_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,9 +15,10 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self from stackit.intake.models.intake_catalog import IntakeCatalog @@ -44,6 +45,13 @@ class CreateIntakePayload(BaseModel): ) __properties: ClassVar[List[str]] = ["catalog", "description", "displayName", "intakeRunnerId", "labels"] + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N} -]{1,32}$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N} -]{1,32}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/services/intake/src/stackit/intake/models/create_intake_runner_payload.py b/services/intake/src/stackit/intake/models/create_intake_runner_payload.py index 2a52855f8..93ca1eebf 100644 --- a/services/intake/src/stackit/intake/models/create_intake_runner_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_runner_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,9 +15,10 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing_extensions import Annotated, Self @@ -50,6 +51,13 @@ class CreateIntakeRunnerPayload(BaseModel): "maxMessagesPerHour", ] + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N} -]{1,32}$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N} -]{1,32}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/services/intake/src/stackit/intake/models/create_intake_user_payload.py b/services/intake/src/stackit/intake/models/create_intake_user_payload.py index a62d9c2ab..ea9919d5b 100644 --- a/services/intake/src/stackit/intake/models/create_intake_user_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_user_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,9 +15,10 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self from stackit.intake.models.user_type import UserType @@ -38,10 +39,19 @@ class CreateIntakeUserPayload(BaseModel): labels: Optional[Dict[str, StrictStr]] = Field( default=None, description="Labels are key-value pairs associated with the resource." ) - password: Annotated[str, Field(strict=True, max_length=128)] = Field(description="A password chosen by the user.") + password: Annotated[str, Field(min_length=12, strict=True, max_length=128)] = Field( + description="A password chosen by the user. The password must consist of at least of each of these categories: * lower case letter * upper case letter * number * other character " + ) type: Optional[UserType] = UserType.INTAKE __properties: ClassVar[List[str]] = ["description", "displayName", "labels", "password", "type"] + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N} -]{1,32}$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N} -]{1,32}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/services/intake/src/stackit/intake/models/dremio_auth.py b/services/intake/src/stackit/intake/models/dremio_auth.py index ba49e57fc..0a3cd94bc 100644 --- a/services/intake/src/stackit/intake/models/dremio_auth.py +++ b/services/intake/src/stackit/intake/models/dremio_auth.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/dremio_auth_patch.py b/services/intake/src/stackit/intake/models/dremio_auth_patch.py index 89a8853e5..b47fb53c5 100644 --- a/services/intake/src/stackit/intake/models/dremio_auth_patch.py +++ b/services/intake/src/stackit/intake/models/dremio_auth_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_catalog.py b/services/intake/src/stackit/intake/models/intake_catalog.py index 4bbacdce2..a797dac4c 100644 --- a/services/intake/src/stackit/intake/models/intake_catalog.py +++ b/services/intake/src/stackit/intake/models/intake_catalog.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -40,7 +40,7 @@ class IntakeCatalog(BaseModel): alias="partitionBy", ) partitioning: Optional[PartitioningType] = PartitioningType.NONE - table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field( + table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field( default=None, description="The table name is a short name chosen by the user to identify the table in Iceberg.", alias="tableName", diff --git a/services/intake/src/stackit/intake/models/intake_catalog_patch.py b/services/intake/src/stackit/intake/models/intake_catalog_patch.py index 3d32b8336..988cb4684 100644 --- a/services/intake/src/stackit/intake/models/intake_catalog_patch.py +++ b/services/intake/src/stackit/intake/models/intake_catalog_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -33,7 +33,7 @@ class IntakeCatalogPatch(BaseModel): default="intake", description="The namespace to which data shall be written. It will be automatically created, if it does not exist.", ) - table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field( + table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field( default=None, description="The table name is a short name chosen by the user to identify the table in Iceberg.", alias="tableName", diff --git a/services/intake/src/stackit/intake/models/intake_response.py b/services/intake/src/stackit/intake/models/intake_response.py index b560a81f9..8b0a8bf28 100644 --- a/services/intake/src/stackit/intake/models/intake_response.py +++ b/services/intake/src/stackit/intake/models/intake_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_runner_response.py b/services/intake/src/stackit/intake/models/intake_runner_response.py index 1a6d06583..88d530e95 100644 --- a/services/intake/src/stackit/intake/models/intake_runner_response.py +++ b/services/intake/src/stackit/intake/models/intake_runner_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_user_response.py b/services/intake/src/stackit/intake/models/intake_user_response.py index 53587f9f0..22c54361f 100644 --- a/services/intake/src/stackit/intake/models/intake_user_response.py +++ b/services/intake/src/stackit/intake/models/intake_user_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intake_runners_response.py b/services/intake/src/stackit/intake/models/list_intake_runners_response.py index e8ffd7ff2..3f2db8dc2 100644 --- a/services/intake/src/stackit/intake/models/list_intake_runners_response.py +++ b/services/intake/src/stackit/intake/models/list_intake_runners_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intake_users_response.py b/services/intake/src/stackit/intake/models/list_intake_users_response.py index d77b6c673..658f26aea 100644 --- a/services/intake/src/stackit/intake/models/list_intake_users_response.py +++ b/services/intake/src/stackit/intake/models/list_intake_users_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intakes_response.py b/services/intake/src/stackit/intake/models/list_intakes_response.py index 09dd42fda..4a1c5e5d0 100644 --- a/services/intake/src/stackit/intake/models/list_intakes_response.py +++ b/services/intake/src/stackit/intake/models/list_intakes_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/partitioning_type.py b/services/intake/src/stackit/intake/models/partitioning_type.py index 32d393524..59aaa63df 100644 --- a/services/intake/src/stackit/intake/models/partitioning_type.py +++ b/services/intake/src/stackit/intake/models/partitioning_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/update_intake_payload.py b/services/intake/src/stackit/intake/models/update_intake_payload.py index cc369217d..f9a150b2a 100644 --- a/services/intake/src/stackit/intake/models/update_intake_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/update_intake_runner_payload.py b/services/intake/src/stackit/intake/models/update_intake_runner_payload.py index 8bb9b249e..02b488bb4 100644 --- a/services/intake/src/stackit/intake/models/update_intake_runner_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_runner_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/update_intake_user_payload.py b/services/intake/src/stackit/intake/models/update_intake_user_payload.py index 1eda5b4d5..93f0fcf02 100644 --- a/services/intake/src/stackit/intake/models/update_intake_user_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_user_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/user_type.py b/services/intake/src/stackit/intake/models/user_type.py index 5a2affa00..03507e7cc 100644 --- a/services/intake/src/stackit/intake/models/user_type.py +++ b/services/intake/src/stackit/intake/models/user_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/rest.py b/services/intake/src/stackit/intake/rest.py index b84df6657..04cfe8640 100644 --- a/services/intake/src/stackit/intake/rest.py +++ b/services/intake/src/stackit/intake/rest.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.2 + The version of the OpenAPI document: 1beta.3.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.