File tree Expand file tree Collapse file tree
src/gateway_api/clinical_jwt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,8 +388,7 @@ jobs:
388388 MTLS_CERT : /tmp/client1-cert.pem
389389 MTLS_KEY : /tmp/client1-key.pem
390390 run : |
391- touch .env.remote
392- make test-remote
391+ make test-integration
393392
394393 - name : Upload integration test results
395394 if : always()
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ build-gateway-api: dependencies
3636 @poetry run mypy --no-namespace-packages .
3737 @echo " Packaging dependencies..."
3838 @poetry build --format=wheel
39- @poetry run pip install " dist/gateway_api-0.1.0-py3-none-any.whl" --target " ./target/gateway-api" --platform musllinux_1_2_x86_64 --only-binary=:all: # Copy main file separately as it is not included within the package.
39+ @pip install " dist/gateway_api-0.1.0-py3-none-any.whl" --target " ./target/gateway-api" --platform musllinux_1_2_x86_64 --only-binary=:all:
40+ # Copy main file separately as it is not included within the package.
4041 @rm -rf ../infrastructure/images/gateway-api/resources/build/
4142 @mkdir ../infrastructure/images/gateway-api/resources/build/
4243 @cp -r ./target/gateway-api ../infrastructure/images/gateway-api/resources/build/
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class JWT:
2020 expiration : int = field (default_factory = lambda : int (time ()) + 300 )
2121
2222 # These are here for future proofing but are not expected ever to be changed
23- algorithm : str | None = None
23+ algorithm : str = "none"
2424 type : str = "JWT"
2525 reason_for_request : str = "directcare"
2626 requested_scope : str = "patient/*.read"
@@ -36,7 +36,7 @@ def exp_time(self) -> str:
3636 def encode (self ) -> str :
3737 return pyjwt .encode (
3838 self .payload (),
39- key = None ,
39+ key = None , # type: ignore[arg-type]
4040 algorithm = self .algorithm ,
4141 headers = {"typ" : self .type },
4242 )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def test_jwt_creation_with_required_fields() -> None:
2929 assert token .requesting_device == '{"device": "info"}'
3030 assert token .requesting_organization == "ORG-123"
3131 assert token .requesting_practitioner == '{"practitioner": "info"}'
32- assert token .algorithm is None
32+ assert token .algorithm == "none"
3333 assert token .type == "JWT"
3434 assert token .reason_for_request == "directcare"
3535 assert token .requested_scope == "patient/*.read"
Original file line number Diff line number Diff line change 22
33import os
44from datetime import timedelta
5- from typing import Protocol , cast
5+ from typing import Any , Protocol , cast
66
77import pytest
88import requests
@@ -144,19 +144,14 @@ def simple_request_payload() -> Parameters:
144144
145145
146146@pytest .fixture
147- def get_headers (request : pytest .FixtureRequest ) -> dict [ str , str ] :
147+ def get_headers (request : pytest .FixtureRequest ) -> Any :
148148 """Return merged auth headers for remote tests, or empty dict for local."""
149- env = os . getenv ( "ENV" ) or request .config .getoption ("--env" )
149+ env = request .config .getoption ("--env" )
150150 if env == "remote" :
151151 apikey_headers = request .getfixturevalue ("status_endpoint_auth_headers" )
152- token = os .getenv ("APIGEE_ACCESS_TOKEN" )
153-
154- if token :
155- return {"Authorization" : f"Bearer { token } " , ** apikey_headers }
156-
157152 nhsd_headers = request .getfixturevalue ("nhsd_apim_auth_headers" )
158153 headers = nhsd_headers | apikey_headers
159- return cast ( "dict[str, str]" , headers )
154+ return headers
160155
161156 return {}
162157
Original file line number Diff line number Diff line change 66
77from typing import Any
88
9+ import pytest
910from pact import Verifier
1011
1112
13+ @pytest .mark .remote_only
1214def test_provider_honors_consumer_contract (mtls_proxy : str , get_headers : Any ) -> None :
1315 verifier = Verifier (
1416 name = "GatewayAPIProvider" ,
You can’t perform that action at this time.
0 commit comments