Skip to content

Commit

Permalink
New events for Access Requests and IVA actions (GSI-668) (#48)
Browse files Browse the repository at this point in the history
* Add events

* Bump version from 3.0.1 -> 3.1.0

---------

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>
  • Loading branch information
TheByronHimes and TheByronHimes committed Mar 12, 2024
1 parent 618f647 commit cfcae95
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
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,
}

0 comments on commit cfcae95

Please sign in to comment.