Skip to content

Commit d7147c0

Browse files
committed
Switch config name back to ucs_url
1 parent ba5795b commit d7147c0

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

.devcontainer/.dev_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mongo_dsn: mongodb://localhost:27017
44
db_name: uos
55
mongo_timeout: 300
66
auth_key: "{}"
7-
file_box_service_url: http://127.0.0.1/upload
7+
ucs_url: http://127.0.0.1/upload
88
access_url: http://127.0.0.1/access
99
audit_record_topic: audit-records
1010
audit_record_type: audit_record_logged

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The service requires the following configuration parameters:
9494
```
9595

9696

97-
- <a id="properties/file_box_service_url"></a>**`file_box_service_url`** *(string, format: uri, required)*: URL pointing to the API of the service that owns FileUploadBoxes (currently the UCS). Length must be between 1 and 2083 (inclusive).
97+
- <a id="properties/ucs_url"></a>**`ucs_url`** *(string, format: uri, required)*: URL pointing to the API of the service that owns FileUploadBoxes (currently the UCS). Length must be between 1 and 2083 (inclusive).
9898

9999

100100
Examples:

config_schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"title": "Audit Record Type",
3636
"type": "string"
3737
},
38-
"file_box_service_url": {
38+
"ucs_url": {
3939
"description": "URL pointing to the API of the service that owns FileUploadBoxes (currently the UCS).",
4040
"examples": [
4141
"http://127.0.0.1/upload"
4242
],
4343
"format": "uri",
4444
"maxLength": 2083,
4545
"minLength": 1,
46-
"title": "File Box Service Url",
46+
"title": "Ucs Url",
4747
"type": "string"
4848
},
4949
"work_order_signing_key": {
@@ -500,7 +500,7 @@
500500
"file_upload_box_topic",
501501
"audit_record_topic",
502502
"audit_record_type",
503-
"file_box_service_url",
503+
"ucs_url",
504504
"work_order_signing_key",
505505
"access_url",
506506
"service_instance_id",

example_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ cors_exposed_headers: null
2121
db_name: uos
2222
docs_url: /docs
2323
enable_opentelemetry: false
24-
file_box_service_url: http://127.0.0.1/upload
2524
file_upload_box_topic: file-upload-boxes
2625
generate_correlation_id: true
2726
host: 127.0.0.1
@@ -49,5 +48,6 @@ port: 8080
4948
research_data_upload_box_topic: research-data-upload-boxes
5049
service_instance_id: '1'
5150
service_name: uos
51+
ucs_url: http://127.0.0.1/upload
5252
work_order_signing_key: '**********'
5353
workers: 1

src/uos/adapters/outbound/http.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AccessApiConfig(BaseSettings):
5353
class FileBoxClientConfig(BaseSettings):
5454
"""Config parameters for interacting with the service owning FileUploadBoxes."""
5555

56-
file_box_service_url: HttpUrl = Field(
56+
ucs_url: HttpUrl = Field(
5757
...,
5858
description="URL pointing to the API of the service that owns FileUploadBoxes"
5959
+ " (currently the UCS).",
@@ -255,7 +255,7 @@ class FileBoxClient(FileBoxClientPort):
255255
"""
256256

257257
def __init__(self, *, config: FileBoxClientConfig):
258-
self._file_box_service_url = config.file_box_service_url
258+
self._ucs_url = config.ucs_url
259259
self._signing_key = jwk.JWK.from_json(
260260
config.work_order_signing_key.get_secret_value()
261261
)
@@ -277,9 +277,7 @@ async def create_file_upload_box(self, *, storage_alias: str) -> UUID4:
277277
"""
278278
headers = self._auth_header(CreateFileBoxWorkOrder())
279279
body = {"storage_alias": storage_alias}
280-
response = httpx.post(
281-
f"{self._file_box_service_url}/boxes", headers=headers, json=body
282-
)
280+
response = httpx.post(f"{self._ucs_url}/boxes", headers=headers, json=body)
283281
if response.status_code != 201:
284282
log.error(
285283
"Error creating new FileUploadBox in external service with storage alias %s.",
@@ -308,7 +306,7 @@ async def lock_file_upload_box(self, *, box_id: UUID4) -> None:
308306
headers = self._auth_header(wot)
309307
body = {"lock": True}
310308
response = httpx.patch(
311-
f"{self._file_box_service_url}/boxes/{box_id}", headers=headers, json=body
309+
f"{self._ucs_url}/boxes/{box_id}", headers=headers, json=body
312310
)
313311
if response.status_code != 204:
314312
log.error(
@@ -332,7 +330,7 @@ async def unlock_file_upload_box(self, *, box_id: UUID4) -> None:
332330
headers = self._auth_header(wot)
333331
body = {"lock": False}
334332
response = httpx.patch(
335-
f"{self._file_box_service_url}/boxes/{box_id}", headers=headers, json=body
333+
f"{self._ucs_url}/boxes/{box_id}", headers=headers, json=body
336334
)
337335
if response.status_code != 204:
338336
log.error(
@@ -353,9 +351,7 @@ async def get_file_upload_list(self, *, box_id: UUID4) -> list[UUID4]:
353351
"""
354352
wot = ViewFileBoxWorkOrder(box_id=box_id)
355353
headers = self._auth_header(wot)
356-
response = httpx.get(
357-
f"{self._file_box_service_url}/boxes/{box_id}/uploads", headers=headers
358-
)
354+
response = httpx.get(f"{self._ucs_url}/boxes/{box_id}/uploads", headers=headers)
359355
if response.status_code != 200:
360356
log.error(
361357
"Error unlocking FileUploadBox ID %s in external service.",

tests/fixtures/test_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mongo_dsn: mongodb://localhost:27017
44
db_name: uos
55
mongo_timeout: 300
66
auth_key: "{}"
7-
file_box_service_url: http://127.0.0.1/upload
7+
ucs_url: http://127.0.0.1/upload
88
access_url: http://127.0.0.1/access
99
audit_record_topic: audit-records
1010
audit_record_type: audit_record_logged

tests/integration/test_typical_journey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def test_typical_journey(joint_fixture: JointFixture, httpx_mock: HTTPXMoc
4545
- Setting the state to LOCKED
4646
"""
4747
# Test data
48-
file_box_service_url = joint_fixture.config.file_box_service_url
48+
file_box_service_url = joint_fixture.config.ucs_url
4949
access_url = joint_fixture.config.access_url
5050
ds_user_id = uuid4()
5151
regular_user_id = uuid4()

0 commit comments

Comments
 (0)