Skip to content

Commit 9381a6e

Browse files
Initial implementation (GSI-1817) (#1)
* Adapt to actual package * Commit in case computer spontaneously combusts * Complete the outbox sub class * Rename orchestrator methods for clarity * Make UCSClient responsible for WOT generation * Clean up the routes a little * Update core, rest api, and UCS client code * Implement Access API client * Add event sub injection and realize main module * Add UCS client unit tests + general test files * Add access api client unit tests * Add unit tests for core * Add unit tests for the auditor * Add unit tests for the rest api * Add typical journey test and fix some minor problems * Cover audit logging in integration test * Remove audit recorder from unit test * Add claim validity to grant access endpoint * Log access granting * Resolve mypy errors * Set version to 1.0.0 * Add e2e ability to list and revoke upload access grants * Add tests for the revoke and list endpoints * Don't encrypt tokens for UCS * Use outbox dao for research boxes * Update config docs * Add final missing endpoint to list all RDUBoxes with pagination * Remove sort order, rename ucs stuff to be generic, various doc string and comment fixes * Remove unused functions copied from the wps * Prepend title and description with box_ for grants * Remove unused module copied from wps * Use StewardAuthContext on certain endpoints * Return 404 in GET box endpoint if not authorized * Fix straggler name referencing claims * Further fix orchestrator doc strings * Flatten validity * Enable filtering boxes by locked status * Don't call access API for single box retrieval if user is a steward * Retrieve fewer results for fixed user in multi-box retrieval * Make central 'is_data_steward' function * Fix the way we check box access in get_upload_box_files * Rename test module that references UCS and move silly import * Add response metadata to endpoints and fix tags * Remove extraneous 'default=...' kwarg * Add 'state' field to FileUpload and fix test that was broken by recent change * Switch config name back to ucs_url * Apply mock dao changes from UCS to here * Account for the fact that the access api returns dict of box IDs with expiration date * Add an unhappy test case for box updates * Rename user_id param to data_steward_id for clarity * Sort boxes by locked, last changed, id * Use populated boxes fixture in other orchestrator tests * Remove unnecessary test user id and context * Sort grants by validity, user id, iva id, box id, and grant id * Grab new ghga event schemas version * Remove certain local model definitions and import from lib instead * Remove unused ignores to make mypy happy * Update template files * Apply fixes according to ruff
1 parent 90644c3 commit 9381a6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+8146
-809
lines changed

.devcontainer/.dev_config.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
# Please only mention the non-default settings here:
2-
3-
language: Greek
41
service_instance_id: "1"
2+
kafka_servers: ["kafka:9092"]
3+
mongo_dsn: mongodb://localhost:27017
4+
db_name: uos
5+
mongo_timeout: 300
6+
auth_key: "{}"
7+
ucs_url: http://127.0.0.1/upload
8+
access_url: http://127.0.0.1/access
9+
audit_record_topic: audit-records
10+
audit_record_type: audit_record_logged
11+
work_order_signing_key: "{}"
12+
file_upload_box_topic: file-upload-boxes
13+
research_data_upload_box_topic: research-data-upload-boxes

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
1+
FROM mcr.microsoft.com/devcontainers/python:2.0.2-3.13-trixie
22

3-
ENV PYTHONUNBUFFERED 1
3+
ENV PYTHONUNBUFFERED=1
44

55
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
66
ARG USER_UID=1000

.devcontainer/dev_launcher

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash
22

3-
# adapt to package name
4-
my-microservice
3+
uos run-rest

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@
7070
},
7171
"features": {
7272
// details can be found here: https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker
73-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
73+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {"moby": false}
7474
}
7575
}

.devcontainer/docker-compose.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ services:
77
# [Choice] Install Node.js
88
INSTALL_NODE: "false"
99
NODE_VERSION: "lts/*"
10-
# Please adapt to package name:
11-
PACKAGE_NAME: "my_microservice"
10+
PACKAGE_NAME: "uos"
1211
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
1312
USER_UID: 1000
1413
USER_GID: 1000
@@ -30,8 +29,7 @@ services:
3029

3130
# define environment variables
3231
environment:
33-
# Please adapt to package name:
34-
MY_MICROSERVICE_CONFIG_YAML: /workspace/.devcontainer/.dev_config.yaml
32+
UOS_CONFIG_YAML: /workspace/.devcontainer/.dev_config.yaml
3533
# Used by db migration:
3634
DB_URL: postgresql://postgres:postgres@postgresql/postgres
3735
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
@@ -45,25 +43,5 @@ services:
4543
volumes:
4644
- mongo_fs:/data/db
4745

48-
localstack:
49-
image: localstack/localstack
50-
environment:
51-
SERVICES: s3
52-
DEFAULT_REGION: eu-west-1
53-
AWS_DEFAULT_REGION: eu-west-1
54-
# accessible at localhost
55-
HOSTNAME_EXTERNAL: localhost
56-
USE_SSL: "false"
57-
DATA_DIR: /var/lib/localstack/data
58-
DEBUG: 1
59-
volumes:
60-
- type: volume
61-
source: s3_fs
62-
target: /var/lib/localstack
63-
volume:
64-
nocopy: true
65-
# useful ports: 4566 - AWS API
66-
6746
volumes:
68-
s3_fs: {}
6947
mongo_fs: {}

.github/workflows/check_config_docs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check config docs
2123
id: check-config-docs

.github/workflows/check_openapi_spec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
steps:
1313
- name: Checkout repository
1414
id: checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v5
1616

1717
- name: Common steps
1818
id: common
1919
uses: ghga-de/gh-action-common@v6
20+
with:
21+
python-version: '3.13'
2022

2123
- name: Check openapi.yaml
2224
id: check-openapi-docs

.github/workflows/check_pyproject.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check pyproject.toml
2123
id: check-pyproject

.github/workflows/check_readme.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Common steps
1717
id: common
1818
uses: ghga-de/gh-action-common@v6
19+
with:
20+
python-version: '3.13'
1921

2022
- name: Check README
2123
id: check-readme

.github/workflows/check_template_files.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
id: checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

16-
- name: Set up Python 3.12
16+
- name: Set up Python 3.13
1717
id: setup-python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
20-
python-version: '3.12'
20+
python-version: '3.13'
2121

2222
- name: Check template files
2323
id: check-template-files

0 commit comments

Comments
 (0)