File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,30 +65,4 @@ def bearer_token(authentication_cache):
6565
6666@pytest .fixture (scope = 'session' )
6767def status_endpoint_api_key ():
68- """
69- Fetch the API key used to authenticate against the /_status endpoint.
70- Checks STATUS_ENDPOINT_API_KEY env var first, then falls back to
71- retrieving it from the mock-jwks proxy using NON_PROD_API_KEY.
72- """
73- import requests
74-
75- key = os .environ .get ("STATUS_ENDPOINT_API_KEY" , "" )
76- if key :
77- return key
78-
79- environment = os .environ ["API_ENVIRONMENT" ]
80- non_prod_api_key = os .environ ["NON_PROD_API_KEY" ]
81-
82- if environment == "prod" :
83- mock_jwks_base = "https://api.service.nhs.uk"
84- elif environment == "ref" :
85- mock_jwks_base = "https://internal-dev.api.service.nhs.uk"
86- else :
87- mock_jwks_base = f"https://{ environment } .api.service.nhs.uk"
88-
89- resp = requests .get (
90- f"{ mock_jwks_base } /mock-jwks/status-endpoint-api-key" ,
91- headers = {"apikey" : non_prod_api_key },
92- )
93- resp .raise_for_status ()
94- return resp .text
68+ return os .environ ["STATUS_ENDPOINT_API_KEY" ]
You can’t perform that action at this time.
0 commit comments