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

New events for Access Requests and IVA actions (GSI-668) #48

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ghga_event_schemas"
version = "3.0.1"
version = "3.1.0"
description = "GHGA Event Schemas: A package that collects schemas used for events exchanged between GHGA service."
dependencies = [
"jsonschema>=4.17.3,<5.0.0",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ We recommend using the provided Docker container.

A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/ghga-event-schemas):
```bash
docker pull ghga/ghga-event-schemas:3.0.1
docker pull ghga/ghga-event-schemas:3.1.0
```

Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile):
```bash
# Execute in the repo's root dir:
docker build -t ghga/ghga-event-schemas:3.0.1 .
docker build -t ghga/ghga-event-schemas:3.1.0 .
```

For production-ready deployment, we recommend using Kubernetes, however,
for simple use cases, you could execute the service using docker
on a single server:
```bash
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/ghga-event-schemas:3.0.1 --help
docker run -p 8080:8080 ghga/ghga-event-schemas:3.1.0 --help
```

If you prefer not to use containers, you may install the service from source:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Intended Audience :: Developers",
]
name = "ghga_event_schemas"
version = "3.0.1"
version = "3.1.0"
description = "GHGA Event Schemas: A package that collects schemas used for events exchanged between GHGA service."
dependencies = [
"jsonschema>=4.17.3,<5.0.0",
Expand Down
14 changes: 14 additions & 0 deletions src/ghga_event_schemas/pydantic_.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,18 @@ class FileDeletionSuccess(FileDeletionRequested):
model_config = ConfigDict(title="file_deletion_success")


class UserID(BaseModel):
"""Generic event payload to relay a user ID."""

user_id: str


class AccessRequestDetails(UserID):
"""Event used to convey the user ID and dataset ID of an access request."""

dataset_id: str


# Lists event schemas (values) by event types (key):
schema_registry: dict[str, type[BaseModel]] = {
"metadata_dataset_deleted": MetadataDatasetID,
Expand All @@ -408,4 +420,6 @@ class FileDeletionSuccess(FileDeletionRequested):
"notification": Notification,
"searchable_resource_deleted": SearchableResourceInfo,
"searchable_resource_upserted": SearchableResource,
"user_id": UserID,
"access_request_details": AccessRequestDetails,
}
Loading