Skip to content

Commit 85cc4a5

Browse files
committed
Grab new ghga event schemas version
1 parent 3b2127a commit 85cc4a5

File tree

8 files changed

+12
-60
lines changed

8 files changed

+12
-60
lines changed

.pyproject_generation/pyproject_custom.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Upload Orchestration Service - A service providing a web-accessib
55
dependencies = [
66
"typer >= 0.15",
77
"ghga-service-commons[api,auth,crypt] >= 4.2",
8-
"ghga-event-schemas ~= 10.0",
8+
"ghga-event-schemas ~= 10.1",
99
"hexkit[akafka,mongodb,opentelemetry] >= 7.0",
1010
]
1111

lock/requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,9 @@ filelock==3.18.0 \
581581
--hash=sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2 \
582582
--hash=sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de
583583
# via virtualenv
584-
ghga-event-schemas==10.0.0 \
585-
--hash=sha256:997feaa5ed672b3eb85d82eb3fe4d37b31cd6f810d26efa65a6db53b33d6ce26 \
586-
--hash=sha256:deb5260a902701cf53074e77d0ee78046d47b2f14fe8d4dae43c917ec5c6182f
584+
ghga-event-schemas==10.1.0 \
585+
--hash=sha256:2b2ca89897b8edd85d949d02cf9615cc450441018891197b9fbf719c6c9628c1 \
586+
--hash=sha256:6cf50c7228a4b960a9fa9e9c8f53da75f96062876e06f364aa8d18547920564d
587587
# via uos (pyproject.toml)
588588
ghga-service-commons==5.0.0 \
589589
--hash=sha256:9c772d7b7fb47d95e0a8c4522f2c79fc11bc3b8125090fe6b7cee86b1685f226 \

lock/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,9 @@ fastapi==0.115.12 \
527527
# via
528528
# -c lock/requirements-dev.txt
529529
# ghga-service-commons
530-
ghga-event-schemas==10.0.0 \
531-
--hash=sha256:997feaa5ed672b3eb85d82eb3fe4d37b31cd6f810d26efa65a6db53b33d6ce26 \
532-
--hash=sha256:deb5260a902701cf53074e77d0ee78046d47b2f14fe8d4dae43c917ec5c6182f
530+
ghga-event-schemas==10.1.0 \
531+
--hash=sha256:2b2ca89897b8edd85d949d02cf9615cc450441018891197b9fbf719c6c9628c1 \
532+
--hash=sha256:6cf50c7228a4b960a9fa9e9c8f53da75f96062876e06f364aa8d18547920564d
533533
# via
534534
# -c lock/requirements-dev.txt
535535
# uos (pyproject.toml)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ description = "Upload Orchestration Service - A service providing a web-accessib
2626
dependencies = [
2727
"typer >= 0.15",
2828
"ghga-service-commons[api,auth,crypt] >= 4.2",
29-
"ghga-event-schemas ~= 10.0",
29+
"ghga-event-schemas ~= 10.1",
3030
"hexkit[akafka,mongodb,opentelemetry] >= 7.0",
3131
]
3232

src/uos/adapters/inbound/event_sub.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,16 @@
1717

1818
import logging
1919

20+
from ghga_event_schemas.configs import FileUploadBoxEventsConfig
2021
from hexkit.protocols.daosub import DaoSubscriberProtocol
21-
from pydantic import Field
22-
from pydantic_settings import BaseSettings
2322

2423
from uos.core.models import FileUploadBox
2524
from uos.ports.inbound.orchestrator import UploadOrchestratorPort
2625

2726
log = logging.getLogger(__name__)
2827

2928

30-
# TODO: Move this config to ghga-event-schemas
31-
class FileUploadBoxConfig(BaseSettings):
32-
"""Config for events communicating changes in FileUploadBoxes
33-
34-
The event types are hardcoded by `hexkit`.
35-
"""
36-
37-
file_upload_box_topic: str = Field(
38-
...,
39-
description="Topic containing published FileUploadBox outbox events",
40-
examples=["file-upload-boxes", "file-upload-box-topic"],
41-
)
42-
43-
44-
class OutboxSubConfig(FileUploadBoxConfig):
29+
class OutboxSubConfig(FileUploadBoxEventsConfig):
4530
"""Configuration for subscribing to outbox events"""
4631

4732

src/uos/adapters/inbound/fastapi_/routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
router = APIRouter()
4848

4949
TAGS: list[str | Enum] = ["ResearchDataUploadBoxes"]
50-
# TODO: fill in possible response codes
5150

5251

5352
@router.get(

src/uos/adapters/outbound/dao.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
# limitations under the License.
1515
"""DAO implementation"""
1616

17+
from ghga_event_schemas.configs import ResearchDataUploadBoxEventsConfig
1718
from hexkit.protocols.daopub import DaoPublisherFactoryProtocol
18-
from pydantic import Field
19-
from pydantic_settings import BaseSettings
2019

2120
from uos.constants import BOX_COLLECTION
2221
from uos.core.models import ResearchDataUploadBox
@@ -25,19 +24,6 @@
2524
__all__ = ["OutboxPubConfig", "get_box_dao"]
2625

2726

28-
# TODO: Replace this config with the centrally defined one when ready
29-
class ResearchDataUploadBoxEventsConfig(BaseSettings):
30-
"""Config for events communicating changes in ResearchDataUploadBoxes.
31-
The event types are hardcoded by `hexkit`.
32-
"""
33-
34-
research_data_upload_box_topic: str = Field(
35-
...,
36-
description="Name of the event topic containing research data upload box events",
37-
examples=["research-data-upload-boxes"],
38-
)
39-
40-
4127
class OutboxPubConfig(ResearchDataUploadBoxEventsConfig):
4228
"""Config needed to publish outbox events"""
4329

src/uos/adapters/outbound/event_pub.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,13 @@
1515

1616
"""Event publisher code"""
1717

18+
from ghga_event_schemas.configs import AuditEventsConfig
1819
from hexkit.protocols.eventpub import EventPublisherProtocol
19-
from pydantic import Field
20-
from pydantic_settings import BaseSettings
2120

2221
from uos.core.models import AuditRecord
2322
from uos.ports.outbound.event_pub import EventPublisherPort
2423

2524

26-
# TODO: Move this class into ghga-event-schemas
27-
class AuditEventsConfig(BaseSettings):
28-
"""For events conveying audit record information"""
29-
30-
audit_record_topic: str = Field(
31-
default=...,
32-
description="Name of the topic used for events conveying audit record information.",
33-
examples=["audit-records"],
34-
)
35-
36-
audit_record_type: str = Field(
37-
default=...,
38-
description="The type used for events conveying audit record information.",
39-
examples=["audit_record_logged"],
40-
)
41-
42-
4325
class EventPubConfig(AuditEventsConfig):
4426
"""Config for publishing events"""
4527

0 commit comments

Comments
 (0)