Skip to content

Commit 70c2c4b

Browse files
authored
Merge pull request #71 from NHSDigital/mm-mesh-967-typos
mesh-967: fix a some small typographic errors
2 parents f298da1 + 46185eb commit 70c2c4b

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @alisonkinloch-nhs @mattmercer-nhs @nhsdigital/mesh-to-cloud-admins
1+
* @alisonkinloch-nhs @matt-mercer @nhsdigital/mesh-to-cloud-admins

specification/mesh-api.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ info:
104104
105105
In the Digital Onboarding Service there are specific sections to be completed to show your solution meets our non-functional requirements and technical conformance.
106106
107-
You would need to organise a date with the assurance team for the witness testing to take place. The witness testing should take half a day. In some cases you will be asked to prepare test data a few days before the day of the witness testing.
107+
You will need to organise a date with the assurance team for the witness testing to take place. The witness testing should take half a day. In some cases you will be asked to prepare test data a few days before the day of the witness testing.
108108
109109
Once the witness test is complete, you will be issued with a technical conformance certificate.
110110
@@ -114,7 +114,7 @@ info:
114114
115115
Now that we know that your software is safe and secure, you will need to sign a connection agreement.
116116
117-
We will send you a customised connection agreemen to sign.
117+
We will send you a customised connection agreement to sign.
118118
119119
Once you’ve signed the connection agreement, you need to upload it to your developer account in the ‘Legal agreement’ section.
120120
@@ -212,7 +212,7 @@ info:
212212
213213
**Notes**
214214
- the API rejects the request if the `timestamp` supplied is not within 2 hours of the server time
215-
- in the example below `HMACSECRETKEY` has been `[REDACTED]`, this is the 'environment shared secret' which you received as part of creating your mailbox
215+
- in the example below `SHARED_KEY` has been `[REDACTED]`, this is the 'environment shared secret' which you received as part of creating your mailbox
216216
217217
### Example implementation
218218
Here is an implementation of the above in `python3`.
@@ -222,11 +222,11 @@ info:
222222
import uuid
223223
import datetime from hashlib
224224
import sha256
225-
225+
226226
AUTHSCHEMANAME = "NHSMESH " # Note: Space at the end of the schema.
227-
HMACSECRETKEY = "[REDACTED]" # Note: Don't hard code your passwords in a real implementation.
228-
229-
def buildmeshauthorizationheader(mailboxid: str, password: str = "password", nonce: str = None, noncecount: int = 0):
227+
SHARED_KEY = "[REDACTED]" # Note: Don't hard code your passwords in a real implementation.
228+
229+
def build_auth_header(mailbox_id: str, password: str = "password", nonce: str = None, noncecount: int = 0):
230230
""" Generate MESH Authorization header for mailboxid. """
231231
#Generate a GUID if required.
232232
if not nonce:
@@ -239,15 +239,15 @@ info:
239239
hmac_msg = mailbox_id + ":" + nonce + ":" + str(nonce_count) + ":" + password + ":" + timestamp
240240
241241
#HMAC is a standard crypto hash method built in the python standard library.
242-
hash_code = hmac.HMAC(HMAC_SECRET_KEY.encode(), hmac_msg.encode(), sha256).hexdigest()
242+
hash_code = hmac.HMAC(SHARED_KEY.encode(), hmac_msg.encode(), sha256).hexdigest()
243243
return (
244244
AUTH_SCHEMA_NAME # Note: No colon between 1st and 2nd elements.
245245
+ mailbox_id + ":"
246246
+ nonce + ":"
247247
+ str(nonce_count) + ":"
248248
+ timestamp+ ":"
249249
+ hash_code
250-
)
250+
)
251251
```
252252
253253
## MESH API pseudocode

0 commit comments

Comments
 (0)