-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Fixes catalog giving access rights to everyone (group 1) to new services 🚨 #7992
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
Merged
pcrespov
merged 14 commits into
ITISFoundation:master
from
pcrespov:is34/fix-catalog-service-inherit-group-1
Jul 1, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cfdf50e
fixes
pcrespov e27bc46
refactors
pcrespov cf5f013
drafts tests
pcrespov 9ff7bdf
test
pcrespov 182d0f4
no strict
pcrespov 348f42a
fixes tests
pcrespov fcf47a2
Merge branch 'master' into is34/fix-catalog-service-inherit-group-1
pcrespov bf4881f
adds exceptions in directorv2
pcrespov ed32abc
♻️ Refactor HTTP error handler to improve logging and response structure
pcrespov 0f25092
warning note
pcrespov 97be3f5
✨ Add fixture to grant service access rights for integration tests
pcrespov 4400af2
Merge branch 'master' into is34/fix-catalog-service-inherit-group-1
pcrespov 6db2504
Merge branch 'master' into is34/fix-catalog-service-inherit-group-1
pcrespov 660e4c7
fixes fixture
pcrespov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,9 +21,13 @@ | |
| from faker import Faker | ||
| from fastapi import FastAPI, status | ||
| from fastapi.testclient import TestClient | ||
| from models_library.api_schemas_directorv2.services import ServiceExtras | ||
| from models_library.api_schemas_directorv2.services import ( | ||
| NodeRequirements, | ||
| ServiceBuildDetails, | ||
| ServiceExtras, | ||
| ) | ||
| from packaging.version import Version | ||
| from pydantic import EmailStr, TypeAdapter | ||
| from pydantic import EmailStr | ||
| from pytest_mock import MockerFixture, MockType | ||
| from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict | ||
| from pytest_simcore.helpers.typing_env import EnvVarsDict | ||
|
|
@@ -407,8 +411,10 @@ def mocked_director_rest_api_base( | |
|
|
||
| @pytest.fixture | ||
| def get_mocked_service_labels() -> Callable[[str, str], dict]: | ||
| def _(service_key: str, service_version: str) -> dict: | ||
| return { | ||
| def _( | ||
| service_key: str, service_version: str, *, include_org_labels: bool = True | ||
| ) -> dict: | ||
| base_labels = { | ||
| "io.simcore.authors": '{"authors": [{"name": "John Smith", "email": "[email protected]", "affiliation": "ACME\'IS Foundation"}]}', | ||
| "io.simcore.contact": '{"contact": "[email protected]"}', | ||
| "io.simcore.description": '{"description": "Autonomous Nervous System Network model"}', | ||
|
|
@@ -423,21 +429,35 @@ def _(service_key: str, service_version: str) -> dict: | |
| "xxxxx", service_version | ||
| ), | ||
| "maintainer": "johnsmith", | ||
| "org.label-schema.build-date": "2023-04-17T08:04:15Z", | ||
| "org.label-schema.schema-version": "1.0", | ||
| "org.label-schema.vcs-ref": "4d79449a2e79f8a3b3b2e1dd0290af9f3d1a8792", | ||
| "org.label-schema.vcs-url": "https://github.com/ITISFoundation/jupyter-math.git", | ||
| "simcore.service.restart-policy": "no-restart", | ||
| "simcore.service.settings": '[{"name": "Resources", "type": "Resources", "value": {"Limits": {"NanoCPUs": 1000000000, "MemoryBytes": 4194304}, "Reservations": {"NanoCPUs": 4000000000, "MemoryBytes": 2147483648}}}]', | ||
| } | ||
|
|
||
| if include_org_labels: | ||
| base_labels.update( | ||
| { | ||
| "org.label-schema.build-date": "2023-04-17T08:04:15Z", | ||
| "org.label-schema.schema-version": "1.0", | ||
| "org.label-schema.vcs-ref": "4d79449a2e79f8a3b3b2e1dd0290af9f3d1a8792", | ||
| "org.label-schema.vcs-url": "https://github.com/ITISFoundation/jupyter-math.git", | ||
| } | ||
| ) | ||
|
|
||
| return base_labels | ||
|
|
||
| return _ | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def mock_service_extras() -> ServiceExtras: | ||
| return TypeAdapter(ServiceExtras).validate_python( | ||
| ServiceExtras.model_json_schema()["examples"][0] | ||
| return ServiceExtras( | ||
| node_requirements=NodeRequirements(CPU=1.0, GPU=None, RAM=4194304, VRAM=None), | ||
| service_build_details=ServiceBuildDetails( | ||
| build_date="2023-04-17T08:04:15Z", | ||
| vcs_ref="4d79449a2e79f8a3b3b2e1dd0290af9f3d1a8792", | ||
| vcs_url="https://github.com/ITISFoundation/jupyter-math.git", | ||
| ), | ||
| container_spec=None, | ||
| ) | ||
|
|
||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.