pytest-nhsd-apim 4.0.0__py3-none-any.whl → 4.0.1__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.

Potentially problematic release.


This version of pytest-nhsd-apim might be problematic. Click here for more details.

@@ -7,18 +7,18 @@ maybe move this file to its own library.
7
7
  """
8
8
 
9
9
  import uuid
10
- from time import time
11
- from typing import Literal
12
-
13
- import jwt
14
- from pydantic import BaseModel, HttpUrl, validator
15
10
  from abc import ABC, abstractmethod
11
+ from time import time
16
12
  from typing import Literal
17
13
  from urllib.parse import parse_qs, urlparse
18
14
 
15
+ import jwt
19
16
  import requests
20
17
  from lxml import html
18
+ from pydantic import BaseModel, HttpUrl, validator, AfterValidator
19
+ from typing_extensions import Annotated
21
20
 
21
+ HttpUrlString = Annotated[HttpUrl, AfterValidator(lambda v: str(v))]
22
22
 
23
23
  #### Config models
24
24
  class KeycloakConfig(BaseModel):
@@ -55,7 +55,7 @@ class KeycloakConfig(BaseModel):
55
55
  class KeycloakUserConfig(KeycloakConfig):
56
56
  client_id: str
57
57
  client_secret: str
58
- redirect_uri: HttpUrl = "https://example.org"
58
+ redirect_uri: HttpUrlString = "https://example.org"
59
59
  login_form: dict
60
60
 
61
61
 
@@ -82,8 +82,8 @@ class AuthorizationCodeConfig(BaseModel):
82
82
  "prod",
83
83
  ] = "internal-dev"
84
84
  org: Literal["nhsd-nonprod", "nhsd-prod"] = "nhsd-nonprod"
85
- callback_url: HttpUrl
86
- identity_service_base_url: HttpUrl = _identity_service_base_url(environment)
85
+ callback_url: HttpUrlString
86
+ identity_service_base_url: HttpUrlString = _identity_service_base_url(environment)
87
87
  client_id: str
88
88
  client_secret: str
89
89
  scope: Literal["nhs-login", "nhs-cis2"]
@@ -124,7 +124,7 @@ class ClientCredentialsConfig(BaseModel):
124
124
  client_id: str
125
125
  jwt_private_key: str
126
126
  jwt_kid: str
127
- identity_service_base_url: HttpUrl = _identity_service_base_url(environment)
127
+ identity_service_base_url: HttpUrlString = _identity_service_base_url(environment)
128
128
 
129
129
  def encode_jwt(self):
130
130
  url = f"{self.identity_service_base_url}/token"
@@ -165,8 +165,8 @@ class NHSLoginConfig(BaseModel):
165
165
 
166
166
  super().__init__(**kwargs)
167
167
 
168
- callback_url: HttpUrl = "https://nhsd-apim-testing-int-ns.herokuapp.com/nhslogin/callback"
169
- nhs_login_base_url: HttpUrl
168
+ callback_url: HttpUrlString = "https://nhsd-apim-testing-int-ns.herokuapp.com/nhslogin/callback"
169
+ nhs_login_base_url: HttpUrlString
170
170
  client_id: str = "APIM-1"
171
171
  jwt_private_key: str
172
172
  jwt_kid: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest-nhsd-apim
3
- Version: 4.0.0
3
+ Version: 4.0.1
4
4
  Summary: Pytest plugin accessing NHSDigital's APIM proxies
5
5
  Home-page: https://github.com/NHSDigital/pytest-nhsd-apim
6
6
  Author: Adrian Ciobanita
@@ -18,7 +18,7 @@ Requires-Dist: pycryptodome (==3.20.0)
18
18
  Requires-Dist: PyJWT (==2.8.0)
19
19
  Requires-Dist: pyotp (==2.9.0)
20
20
  Requires-Dist: pytest (==8.2.0)
21
- Requires-Dist: requests (==2.31.0)
21
+ Requires-Dist: requests (==2.32.0)
22
22
  Requires-Dist: toml (==0.10.2)
23
23
  Requires-Dist: typing-extensions (==4.11.0)
24
24
  Requires-Dist: pydantic (==2.9.2)
@@ -3,14 +3,14 @@ pytest_nhsd_apim/apigee_apis.py,sha256=u_sHjISj4XKgidVje1Uzq4LblMGnX4lrrrMWZM-SE
3
3
  pytest_nhsd_apim/apigee_edge.py,sha256=NQrW8PeA_-X4zt2torTmBOaFIzRKjh6pT1ksolNjpmA,19065
4
4
  pytest_nhsd_apim/auth_journey.py,sha256=UovbLXhokUnikrMOaXIhjV8t5aRrcxinAbS96nfZWcY,5154
5
5
  pytest_nhsd_apim/config.py,sha256=ScKfV8iURqDXX2ajgGsRDcVn9RZy2DxLoEU2QQt9lmA,4246
6
- pytest_nhsd_apim/identity_service.py,sha256=HrXfSm0dIFg51LBng_nf2iIGlOcwzV_J1vA4agm_Ne4,19766
6
+ pytest_nhsd_apim/identity_service.py,sha256=0ymDSEsTuBYcMU15zFNuqEV6PMvC7Z0Vde0PkN8NQ2E,19899
7
7
  pytest_nhsd_apim/log.py,sha256=8gYHqzlQM546FB2XvFmLTk1YfZRNeNhIwLmOy0GScr8,2685
8
8
  pytest_nhsd_apim/nhsd_apim_authorization.py,sha256=GR8GfbIZyqBC4jsSZMYNifDH52E3VWoIa7lrpuvIbaM,3513
9
9
  pytest_nhsd_apim/pytest_nhsd_apim.py,sha256=ZCItUqcM23CCmcRyGU8bEwI3vJnNcGdoOlbSfvYILR8,5242
10
10
  pytest_nhsd_apim/secrets.py,sha256=yIYwOZwpliIomtqSJGIYRbAE2HYvLvQU4W2kOa9TnXo,2354
11
11
  pytest_nhsd_apim/token_cache.py,sha256=6L08taTlSyRsx2NCb0LSGsHdWx_wmqwlFtcF7pZMhUg,3540
12
- pytest_nhsd_apim-4.0.0.dist-info/METADATA,sha256=Qr5aO2T1v73p92PMAk0NXrrL9Mgy3tI_mucb7PX0HMY,4704
13
- pytest_nhsd_apim-4.0.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
14
- pytest_nhsd_apim-4.0.0.dist-info/entry_points.txt,sha256=XWicT3meTpqLXnZcXNoAd2IfXspFPlNgMgLBMy4nqwQ,57
15
- pytest_nhsd_apim-4.0.0.dist-info/top_level.txt,sha256=ZK5GZP-g_K8gNfm4a58T9JCRb0i1X267ngvNelCGgfQ,17
16
- pytest_nhsd_apim-4.0.0.dist-info/RECORD,,
12
+ pytest_nhsd_apim-4.0.1.dist-info/METADATA,sha256=MLPfh4yptnSrL2gQmgT8lmMgCMze8nLbEnKhmatWHLI,4704
13
+ pytest_nhsd_apim-4.0.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
14
+ pytest_nhsd_apim-4.0.1.dist-info/entry_points.txt,sha256=XWicT3meTpqLXnZcXNoAd2IfXspFPlNgMgLBMy4nqwQ,57
15
+ pytest_nhsd_apim-4.0.1.dist-info/top_level.txt,sha256=ZK5GZP-g_K8gNfm4a58T9JCRb0i1X267ngvNelCGgfQ,17
16
+ pytest_nhsd_apim-4.0.1.dist-info/RECORD,,