mesh-sandbox 1.0.11__py3-none-any.whl → 1.0.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mesh_sandbox/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.0.11"
1
+ __version__ = "1.0.12"
@@ -35,8 +35,8 @@ router = APIRouter(
35
35
  responses={
36
36
  status.HTTP_200_OK: {
37
37
  "content": {
38
- MESH_MEDIA_TYPES[2]: {"schema": InboxV2.schema()},
39
- MESH_MEDIA_TYPES[1]: {"schema": InboxV1.schema()},
38
+ MESH_MEDIA_TYPES[2]: {"schema": InboxV2.model_json_schema()},
39
+ MESH_MEDIA_TYPES[1]: {"schema": InboxV1.model_json_schema()},
40
40
  }
41
41
  },
42
42
  status.HTTP_403_FORBIDDEN: {"description": "Authentication failed", "content": None},
@@ -149,7 +149,7 @@ async def head_message(
149
149
  status.HTTP_200_OK: {
150
150
  "content": {
151
151
  MESH_MEDIA_TYPES[2]: {
152
- "schema": RichInboxView.schema(),
152
+ "schema": RichInboxView.model_json_schema(),
153
153
  }
154
154
  },
155
155
  }
@@ -24,10 +24,10 @@ router = APIRouter(
24
24
  200: {
25
25
  "content": {
26
26
  MESH_MEDIA_TYPES[2]: {
27
- "schema": InboxCountV2.schema(),
27
+ "schema": InboxCountV2.model_json_schema(),
28
28
  },
29
29
  MESH_MEDIA_TYPES[1]: {
30
- "schema": InboxCountV1.schema(),
30
+ "schema": InboxCountV1.model_json_schema(),
31
31
  },
32
32
  }
33
33
  }
@@ -19,10 +19,10 @@ router = APIRouter(
19
19
  status.HTTP_200_OK: {
20
20
  "content": {
21
21
  MESH_MEDIA_TYPES[2]: {
22
- "schema": MailboxLookupV2.schema(),
22
+ "schema": MailboxLookupV2.model_json_schema(),
23
23
  },
24
24
  MESH_MEDIA_TYPES[1]: {
25
- "schema": EndpointLookupV1.schema(),
25
+ "schema": EndpointLookupV1.model_json_schema(),
26
26
  },
27
27
  }
28
28
  }
@@ -45,7 +45,7 @@ async def lookup_by_ods_code_and_workflow_id(
45
45
  status.HTTP_200_OK: {
46
46
  "content": {
47
47
  MESH_MEDIA_TYPES[2]: {
48
- "schema": MailboxLookupV2.schema(),
48
+ "schema": MailboxLookupV2.model_json_schema(),
49
49
  }
50
50
  }
51
51
  }
@@ -40,10 +40,10 @@ router = APIRouter(
40
40
  status.HTTP_202_ACCEPTED: {
41
41
  "content": {
42
42
  MESH_MEDIA_TYPES[2]: {
43
- "schema": SendMessageV2.schema(),
43
+ "schema": SendMessageV2.model_json_schema(),
44
44
  },
45
45
  MESH_MEDIA_TYPES[1]: {
46
- "schema": SendMessageV1.schema(),
46
+ "schema": SendMessageV1.model_json_schema(),
47
47
  },
48
48
  }
49
49
  },
@@ -111,7 +111,7 @@ async def send_chunk(
111
111
  200: {
112
112
  "content": {
113
113
  MESH_MEDIA_TYPES[2]: {
114
- "schema": RichOutboxView.schema(),
114
+ "schema": RichOutboxView.model_json_schema(),
115
115
  }
116
116
  }
117
117
  }
@@ -27,10 +27,10 @@ router = APIRouter(
27
27
  200: {
28
28
  "content": {
29
29
  MESH_MEDIA_TYPES[2]: {
30
- "schema": TrackingV2.schema(),
30
+ "schema": TrackingV2.model_json_schema(),
31
31
  },
32
32
  MESH_MEDIA_TYPES[1]: {
33
- "schema": TrackingV1.schema(),
33
+ "schema": TrackingV1.model_json_schema(),
34
34
  },
35
35
  }
36
36
  }
@@ -41,7 +41,7 @@ def _mesh_client_track_message_by_message_id(base_uri: str, sender_mailbox_id: s
41
41
  with MeshClient(
42
42
  url=base_uri, mailbox=sender_mailbox_id, password=_PASSWORD, shared_key=_SHARED_KEY, max_chunk_size=100
43
43
  ) as sender:
44
- tracking = sender.track_by_message_id(message_id)
44
+ tracking = sender.track_message(message_id)
45
45
  assert tracking
46
46
  return tracking
47
47
 
@@ -62,6 +62,7 @@ def test_handshake_bad_password(base_uri: str):
62
62
  with MeshClient(url=base_uri, mailbox=_CANNED_MAILBOX1, password="BAD", shared_key=_SHARED_KEY) as client:
63
63
  with pytest.raises(HTTPError) as err:
64
64
  client.handshake()
65
+ assert err.value.response is not None
65
66
  assert err.value.response.status_code == status.HTTP_403_FORBIDDEN
66
67
 
67
68
 
@@ -91,9 +92,9 @@ def test_track_message_by_message_id(base_uri: str):
91
92
  assert _mesh_client_get_inbox_count(base_uri, _CANNED_MAILBOX2) == 1
92
93
 
93
94
  tracking = _mesh_client_track_message_by_message_id(base_uri, _CANNED_MAILBOX1, message_id)
94
- assert tracking["messageId"] == message_id
95
- assert tracking["status"] == "Accepted"
96
- assert tracking["sender"] == _CANNED_MAILBOX1
95
+ assert tracking["message_id"] == message_id
96
+ assert tracking["status"] == "accepted"
97
+ # assert tracking["sender"] == _CANNED_MAILBOX1
97
98
  assert tracking["recipient"] == _CANNED_MAILBOX2
98
99
 
99
100
  with MeshClient(url=base_uri, mailbox=_CANNED_MAILBOX2, password=_PASSWORD, shared_key=_SHARED_KEY) as recipient:
@@ -101,5 +102,5 @@ def test_track_message_by_message_id(base_uri: str):
101
102
  message.acknowledge()
102
103
 
103
104
  tracking = _mesh_client_track_message_by_message_id(base_uri, _CANNED_MAILBOX1, message_id)
104
- assert tracking["messageId"] == message_id
105
- assert tracking["status"] == "Acknowledged"
105
+ assert tracking["message_id"] == message_id
106
+ assert tracking["status"] == "acknowledged"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mesh-sandbox
3
- Version: 1.0.11
3
+ Version: 1.0.12
4
4
  Summary: NHSDigital mesh sandbox, a locally testable version of the MESH api
5
5
  License: MIT
6
6
  Author: spinecore
@@ -51,22 +51,28 @@ services:
51
51
  build:
52
52
  context: https://github.com/NHSDigital/mesh-sandbox.git#refs/tags/v1.0.4
53
53
  ports:
54
- - "8700:80"
54
+ - "8700:443"
55
55
  deploy:
56
56
  restart_policy:
57
57
  condition: on-failure
58
58
  max_attempts: 3
59
59
  healthcheck:
60
- test: curl -sf http://localhost:80/health || exit 1
60
+ test: curl -ksf https://localhost/health || exit 1
61
61
  interval: 3s
62
62
  timeout: 10s
63
63
  environment:
64
64
  - SHARED_KEY=TestKey
65
+ - SSL=yes
66
+ # - STORE_MODE=file # store mode file will persist data to disk
65
67
  volumes:
66
68
  # mount a different mailboxes.jsonl to pre created mailboxes
67
69
  - ./src/mesh_sandbox/store/data/mailboxes.jsonl:/app/mesh_sandbox/store/data/mailboxes.jsonl:ro
68
- # the mesh sandbox supports injecting a plugin to support test hooks
69
- # - ./my_test_plugin.py:/app/mesh_sandbox/plugin/my_test_plygin.py:ro
70
+ - ./src/mesh_sandbox/test_plugin:/app/mesh_sandbox/plugins:ro
71
+ # you can mount a directory if you want access the stored messages
72
+ # - ./messages:/tmp/mesh_store
73
+ # you can also mount different server cert and key if using ssl and you need a trusted certificate
74
+ # - ./mycert.pem:/tmp/server-cert.pem:ro
75
+ # - ./mycert.key:/tmp/server-cert.key:ro
70
76
 
71
77
  ```
72
78
 
@@ -1,4 +1,4 @@
1
- mesh_sandbox/__init__.py,sha256=wygrEW3brUgbks4JvwNjcujOADEl2PWkdIF9d8vyM3c,23
1
+ mesh_sandbox/__init__.py,sha256=bQ8TKIXU3qSGr-K-gVtWDgjDfBlCgBju76OGKtY9tS8,23
2
2
  mesh_sandbox/api.py,sha256=N6k5RH6C9nXkVU4VqK9Cb4Zm0y0btCkzY7vgf4aM-Vg,3924
3
3
  mesh_sandbox/common/__init__.py,sha256=r_QcbsmkiCFrE04QVputqAF2TPIlixiXBcGKgWR4SvE,3430
4
4
  mesh_sandbox/common/constants.py,sha256=dakVgzHaYnUDCQmmssIUqdzIqIbpua2-Zh2qAJiojm4,6558
@@ -24,12 +24,12 @@ mesh_sandbox/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
24
24
  mesh_sandbox/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  mesh_sandbox/routers/admin.py,sha256=ZMa6LfdUidHXkNMTtHsWnRvGYAoJ-ac0BKWYbA1AeFY,4560
26
26
  mesh_sandbox/routers/handshake.py,sha256=5TVyQ5OrHIe6W3UVpbap-hc5ia669Of6w6F1vgcYjm4,2693
27
- mesh_sandbox/routers/inbox.py,sha256=qg79kdpYaHfZqV8bUqezUfkMu7lib8Fa1GPEW3fKJGs,8943
28
- mesh_sandbox/routers/inbox_count.py,sha256=hY88h7dBa6asnvYEP9mmx6CEBw5ZyRO7gz6lHg4Yj3c,1521
29
- mesh_sandbox/routers/lookup.py,sha256=eI064yFdZxr4gpgoLbqRiDvsrLHurZcRZOUvVbSxDXY,2114
30
- mesh_sandbox/routers/outbox.py,sha256=TtPiPR1zlc3ydnAPTBrTpN_-BIkyr04Km6qkTbwyhsI,4956
27
+ mesh_sandbox/routers/inbox.py,sha256=LEyNfXR41vFdIGMPmi9uVrQtQG0U-v0-YC3-so_Oh_M,8976
28
+ mesh_sandbox/routers/inbox_count.py,sha256=OSIr3BbwDbTVt0nDpyUGCh1CD_1v9YQ-bBFGNuZr7jg,1543
29
+ mesh_sandbox/routers/lookup.py,sha256=QnA5Tv5Ig6PGdywsccNhGpgdHw8djBDauZ0mulwuIFM,2147
30
+ mesh_sandbox/routers/outbox.py,sha256=Vr8IIYMGtwrvZjZjCKnS1tkqZu_CznlAHdaxXQhuqew,4989
31
31
  mesh_sandbox/routers/request_logging.py,sha256=gZaOJ_Mp3QPsmrpxXQ0pOzVGNPKd_RAEjpT3Iz1ImVM,1439
32
- mesh_sandbox/routers/tracking.py,sha256=UVIRkMBGD5pI7vgp8l6cnP5VX8OFRDPNb2JHs9q5w58,2210
32
+ mesh_sandbox/routers/tracking.py,sha256=xoqMUcKXMZ7KxsQb3JzFQzsDaogh-nTNDzbMzgGOfL8,2232
33
33
  mesh_sandbox/routers/update.py,sha256=a9ttmk3levdDcu-ZF7a5EniR35zRMhty8pG2EyzB1po,409
34
34
  mesh_sandbox/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  mesh_sandbox/store/base.py,sha256=JvATpCJREAvsfLV5_lQBUK-th89M8YeeC08vm0YdUbM,1982
@@ -59,7 +59,7 @@ mesh_sandbox/tests/inbox.py,sha256=lK-T-XRACWUz073osdoJWrf-f4bHe5DSdMh4H7WXP5s,1
59
59
  mesh_sandbox/tests/java_client_tests.py,sha256=hpcZ4gaSS7wSmz2DVxCT5KVRqy-pPVhh-NbdVoqHlcg,6526
60
60
  mesh_sandbox/tests/lookup.py,sha256=rXNhnLDukZ5woxVB2Uu281hRaS2X1Hx6h0_d7cw_lxs,2780
61
61
  mesh_sandbox/tests/mesh_api_helpers.py,sha256=T2tvUJW5WaBytJXslJEek-rWFua3yKLz2_O3xh2ulx4,3887
62
- mesh_sandbox/tests/mesh_client_tests.py,sha256=KVu2QeF-6PlWH_i355fdnNt6Znwo2xrHBX4MbHRsSG4,3941
62
+ mesh_sandbox/tests/mesh_client_tests.py,sha256=VoCZ21e2xiBH_IyEjnbwZvUXtjSC0HaL2EJoU7Y7wkk,3985
63
63
  mesh_sandbox/tests/messaging_tests.py,sha256=odEat8Zk_1imL3_l7YYuNOJKK_pCNVuNIBmjrNXoyrQ,5069
64
64
  mesh_sandbox/tests/outbox.py,sha256=TISvClWp8zHBnYNrc04_6dmLq8mNBdXdZzA-TXTS2Lk,21319
65
65
  mesh_sandbox/tests/serialisation.py,sha256=HplGgNvjzSYjm9ABMwu3GeiBOSJIchawb2OXKsfKnE4,662
@@ -70,7 +70,7 @@ mesh_sandbox/views/inbox.py,sha256=zdKB2ulJaDRVnhnagyBYF2nFmN88wslAx3bq7d7feLo,5
70
70
  mesh_sandbox/views/lookup.py,sha256=c_UtaJMCfBacsV692FQs4_AyDKjPNxIQKu2wgluDSGw,2815
71
71
  mesh_sandbox/views/outbox.py,sha256=JrJk-R3fTjjcfVFW5Q_Fvxj8oasNRuH7HNJiMiTiD80,4907
72
72
  mesh_sandbox/views/tracking.py,sha256=WEswJT_wLJPieN5CgJ-CGXjDSRF5BdUzVy5XHqzGHAE,8914
73
- mesh_sandbox-1.0.11.dist-info/LICENSE,sha256=usgzIvDUpVX5pYZepJTRXQJqIaz0mdd32GuS5a3PFlY,1051
74
- mesh_sandbox-1.0.11.dist-info/METADATA,sha256=6RBnBYPBF-Jdx0gPDzNWo3AXrZwixp27w2lgDbqtEi8,2059
75
- mesh_sandbox-1.0.11.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
76
- mesh_sandbox-1.0.11.dist-info/RECORD,,
73
+ mesh_sandbox-1.0.12.dist-info/LICENSE,sha256=usgzIvDUpVX5pYZepJTRXQJqIaz0mdd32GuS5a3PFlY,1051
74
+ mesh_sandbox-1.0.12.dist-info/METADATA,sha256=qBE-S78StjVdNScsE04pSwrj4dWus192qHIsOdGJh7k,2373
75
+ mesh_sandbox-1.0.12.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
76
+ mesh_sandbox-1.0.12.dist-info/RECORD,,