proxygen-cli 2.1.5__tar.gz → 2.1.7__tar.gz
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.
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/PKG-INFO +10 -2
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/README.md +8 -1
- proxygen_cli-2.1.7/proxygen_cli/cli/command_pytest_nhsd_apim_token.py +33 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/proxygen_api.py +5 -0
- proxygen_cli-2.1.7/proxygen_cli/test/command_pytest_nhsd_apim_token_test.py +23 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/pyproject.toml +2 -2
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/__init__.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_credentials.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_docker.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_instance.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_main.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_secret.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_settings.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/cli/command_spec.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/auth.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/constants.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/credentials.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/dot_proxygen.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/output.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/settings.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/spec.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/spec_server.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/lib/version.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/__init__.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_credentials_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_instance_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_main_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_secret_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_settings_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/command_spec_test.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/conftest.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/fixtures/client.key +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/fixtures/client.pem +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/fixtures/secret.txt +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/mock_private_key.py +0 -0
- {proxygen_cli-2.1.5 → proxygen_cli-2.1.7}/proxygen_cli/test/validate_cli_version_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: proxygen-cli
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.7
|
|
4
4
|
Summary: CLI for interacting with NHSD APIM's proxygen service
|
|
5
5
|
Home-page: https://github.com/NHSDigital/proxygen-cli
|
|
6
6
|
Author: Ben Strutt
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
15
|
-
Requires-Dist: cryptography (>=
|
|
15
|
+
Requires-Dist: cryptography (>=42.0,<43.0)
|
|
16
16
|
Requires-Dist: lxml (>=4.7.1,<5.0.0)
|
|
17
17
|
Requires-Dist: pydantic (>=1.9.1,<2.0.0)
|
|
18
18
|
Requires-Dist: pyjwt (>=2.3.0,<3.0.0)
|
|
@@ -102,3 +102,11 @@ Use the following command to obtain a docker token:
|
|
|
102
102
|
```
|
|
103
103
|
$(proxygen docker get-login)
|
|
104
104
|
```
|
|
105
|
+
### Retrieving a token to use with the pytest-nhsd-apim python testing package
|
|
106
|
+
When testing using the pytest-nhsd-apim python testing package, an apigee management api token is needed. This endpoint provides this token for use in automated tests.
|
|
107
|
+
|
|
108
|
+
Use the following command to obtain the pytest-nhsd-apim token:
|
|
109
|
+
```
|
|
110
|
+
$(proxygen pytest_nhsd_apim get_token)
|
|
111
|
+
```
|
|
112
|
+
|
|
@@ -76,4 +76,11 @@ To enable the push and pull of images from the API Management ECR repository, yo
|
|
|
76
76
|
Use the following command to obtain a docker token:
|
|
77
77
|
```
|
|
78
78
|
$(proxygen docker get-login)
|
|
79
|
-
```
|
|
79
|
+
```
|
|
80
|
+
### Retrieving a token to use with the pytest-nhsd-apim python testing package
|
|
81
|
+
When testing using the pytest-nhsd-apim python testing package, an apigee management api token is needed. This endpoint provides this token for use in automated tests.
|
|
82
|
+
|
|
83
|
+
Use the following command to obtain the pytest-nhsd-apim token:
|
|
84
|
+
```
|
|
85
|
+
$(proxygen pytest_nhsd_apim get_token)
|
|
86
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from proxygen_cli.lib.settings import SETTINGS
|
|
4
|
+
from proxygen_cli.lib import proxygen_api, version, output
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@click.group()
|
|
8
|
+
@click.option(
|
|
9
|
+
"--api", default=SETTINGS.api, help="Override the default API", show_default=True
|
|
10
|
+
)
|
|
11
|
+
@click.pass_context
|
|
12
|
+
def pytest_nhsd_apim(ctx, api):
|
|
13
|
+
"""
|
|
14
|
+
Intract with your API's pytest_nhsd_apim assets
|
|
15
|
+
"""
|
|
16
|
+
version.validate_cli_version()
|
|
17
|
+
ctx.ensure_object(dict)
|
|
18
|
+
if api is None:
|
|
19
|
+
raise click.UsageError(
|
|
20
|
+
"You must set the API before using this command: see `proxygen settings`"
|
|
21
|
+
)
|
|
22
|
+
ctx.obj["api"] = api
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest_nhsd_apim.command()
|
|
26
|
+
@click.pass_context
|
|
27
|
+
def get_token(ctx):
|
|
28
|
+
"""
|
|
29
|
+
Get a token for use with pytest-nhsd-apim python testing package.
|
|
30
|
+
"""
|
|
31
|
+
api = ctx.obj["api"]
|
|
32
|
+
resp = proxygen_api.get_pytest_nhsd_apim_token(api)
|
|
33
|
+
output.print_json(resp)
|
|
@@ -84,6 +84,11 @@ def get_docker_login(api: str):
|
|
|
84
84
|
return _resp_json(resp)
|
|
85
85
|
|
|
86
86
|
|
|
87
|
+
def get_pytest_nhsd_apim_token(api: str):
|
|
88
|
+
resp = _session().get(f"/apis/{api}/pytest-nhsd-apim-token")
|
|
89
|
+
return _resp_json(resp)
|
|
90
|
+
|
|
91
|
+
|
|
87
92
|
def get_resources(
|
|
88
93
|
api: str,
|
|
89
94
|
_type: Optional[Literal["instance", "secret"]] = None,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests around the pytest_nhsd_apim_token CLI command.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
from click.testing import CliRunner
|
|
8
|
+
|
|
9
|
+
import proxygen_cli.cli.command_pytest_nhsd_apim_token as cmd_pytest_nhsd_apim
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_get_pytest_nhsd_apim_token(patch_request, patch_access_token):
|
|
13
|
+
"""
|
|
14
|
+
Ensure the get command supports UAT specs.
|
|
15
|
+
"""
|
|
16
|
+
expected_resp = {"pytest_nhsd_apim_token": "token123", "expires_in": "3600"}
|
|
17
|
+
|
|
18
|
+
runner = CliRunner()
|
|
19
|
+
with patch_access_token(), patch_request(200, expected_resp):
|
|
20
|
+
result = runner.invoke(cmd_pytest_nhsd_apim.get_token, obj={"api": "mock-api"})
|
|
21
|
+
|
|
22
|
+
result_to_dict = json.loads(result.output.strip())
|
|
23
|
+
assert result_to_dict == expected_resp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "proxygen-cli"
|
|
3
|
-
version = "2.1.
|
|
3
|
+
version = "2.1.7"
|
|
4
4
|
description = "CLI for interacting with NHSD APIM's proxygen service"
|
|
5
5
|
authors = ["Ben Strutt <ben.strutt1@nhs.net>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -17,7 +17,7 @@ click = "^8.1.3"
|
|
|
17
17
|
pyjwt = "^2.3.0"
|
|
18
18
|
requests = "^2.27.1"
|
|
19
19
|
lxml = "^4.7.1"
|
|
20
|
-
cryptography = "^
|
|
20
|
+
cryptography = "^42.0"
|
|
21
21
|
pyyaml = "^6.0"
|
|
22
22
|
yaspin = "^2.2.0"
|
|
23
23
|
tabulate = "^0.9.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|