Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation missing from template registration API endpoints #4310

Closed
wants to merge 1 commit into from

Conversation

marrobi
Copy link
Member

@marrobi marrobi commented Feb 4, 2025

Add validation for resourceType property in template registration API endpoints.

  • Helpers:

    • Add validate_resource_type function in api_app/api/helpers.py to validate the resourceType property.
    • Add missing import for ResourceType in api_app/api/helpers.py.
  • Workspace Templates:

    • Use validate_resource_type in register_workspace_template function in api_app/api/routes/workspace_templates.py.
    • Add test cases in api_app/tests_ma/test_api/test_routes/test_workspace_templates.py to validate resourceType property in register_workspace_template function.
  • Workspace Service Templates:

    • Use validate_resource_type in register_workspace_service_template function in api_app/api/routes/workspace_service_templates.py.
    • Add test cases in api_app/tests_ma/test_api/test_routes/test_workspace_service_templates.py to validate resourceType property in register_workspace_service_template function.
  • Shared Service Templates:

    • Use validate_resource_type in register_shared_service_template function in api_app/api/routes/shared_service_templates.py.
    • Add test cases in api_app/tests_ma/test_api/test_routes/test_shared_service_templates.py to validate resourceType property in register_shared_service_template function.

Add validation for `resourceType` property in template registration API endpoints.

* **Helpers**:
  - Add `validate_resource_type` function in `api_app/api/helpers.py` to validate the `resourceType` property.
  - Add missing import for `ResourceType` in `api_app/api/helpers.py`.

* **Workspace Templates**:
  - Use `validate_resource_type` in `register_workspace_template` function in `api_app/api/routes/workspace_templates.py`.
  - Add test cases in `api_app/tests_ma/test_api/test_routes/test_workspace_templates.py` to validate `resourceType` property in `register_workspace_template` function.

* **Workspace Service Templates**:
  - Use `validate_resource_type` in `register_workspace_service_template` function in `api_app/api/routes/workspace_service_templates.py`.
  - Add test cases in `api_app/tests_ma/test_api/test_routes/test_workspace_service_templates.py` to validate `resourceType` property in `register_workspace_service_template` function.

* **Shared Service Templates**:
  - Use `validate_resource_type` in `register_shared_service_template` function in `api_app/api/routes/shared_service_templates.py`.
  - Add test cases in `api_app/tests_ma/test_api/test_routes/test_shared_service_templates.py` to validate `resourceType` property in `register_shared_service_template` function.
Copy link

github-actions bot commented Feb 4, 2025

Unit Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit d60e71f.

@marrobi marrobi closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant