proxygen-cli 4.0.0__tar.gz → 4.0.3__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-4.0.0 → proxygen_cli-4.0.3}/PKG-INFO +11 -8
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/README.md +8 -5
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_credentials_test.py +1 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/pyproject.toml +4 -4
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/__init__.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_credentials.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_docker.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_instance.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_main.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_pytest_nhsd_apim_token.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_secret.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_settings.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_spec.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/auth.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/constants.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/credentials.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/dot_proxygen.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/output.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/proxygen_api.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/settings.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/spec.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/spec_server.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/lib/version.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/__init__.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_instance_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_main_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_pytest_nhsd_apim_token_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_secret_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_settings_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_spec_test.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/conftest.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/fixtures/client.key +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/fixtures/client.pem +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/fixtures/secret.txt +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/mock_private_key.py +0 -0
- {proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/validate_cli_version_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: proxygen-cli
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.3
|
|
4
4
|
Summary: CLI for interacting with NHSD APIM's proxygen service
|
|
5
5
|
Author: Ben Strutt
|
|
6
6
|
Author-email: ben.strutt1@nhs.net
|
|
@@ -9,11 +9,11 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.13
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.14
|
|
11
11
|
Requires-Dist: click (>=8.1.2,<9.0.0)
|
|
12
|
-
Requires-Dist: cryptography (>=
|
|
12
|
+
Requires-Dist: cryptography (>=48.0.1,<49.0.0)
|
|
13
13
|
Requires-Dist: lxml (>=6.0.1,<7.0.0)
|
|
14
14
|
Requires-Dist: packaging (>=24.2,<25.0)
|
|
15
15
|
Requires-Dist: pydantic (>=1.9.1,<2.0.0)
|
|
16
|
-
Requires-Dist: pyjwt (>=2.
|
|
16
|
+
Requires-Dist: pyjwt (>=2.13.0,<3.0.0)
|
|
17
17
|
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
|
|
18
18
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
19
19
|
Requires-Dist: tabulate (>=0.9,<0.11)
|
|
@@ -38,9 +38,10 @@ After installation, the `proxygen` executable is available. Typing `proxygen` di
|
|
|
38
38
|
### Settings
|
|
39
39
|
To specify the API you are developing for, use:
|
|
40
40
|
```
|
|
41
|
-
proxygen settings set api <API-NAME>
|
|
41
|
+
proxygen settings set api <API-NAME> --env <ptl/prod>
|
|
42
42
|
```
|
|
43
43
|
Your user must have the appropriate permissions for managing instances, secrets, and specifications related to the specified API. If permissions are insufficient, commands will fail. Reach out to the `platforms-api-producer-support` channel for assistance with permissions.
|
|
44
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
### Credentials
|
|
@@ -54,9 +55,10 @@ If you are setting up user access for the first time you will first need to requ
|
|
|
54
55
|
|
|
55
56
|
To setup the Proxygen CLI credentials for the first time with user access enter the following command:
|
|
56
57
|
```
|
|
57
|
-
proxygen credentials set
|
|
58
|
+
proxygen credentials set --env <ptl/prod>
|
|
58
59
|
```
|
|
59
60
|
The CLI will ask you for your username, and password. These credentials will be securely stored on your local machine in the directory ~/.proxygen/credentials.yaml. The client_id and secret used for user access will be automatically added to this file after running the command.
|
|
61
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
60
62
|
|
|
61
63
|
Your user must have permissions to manipulate instances/secrets/specs for the API you set here. If you do not have sufficient permissions commands will fail. If you believe your permissions are incorrect, contact the API platform team via the [platforms-api-producer-support](https://nhsdigital-platforms.slack.com/archives/C016JRWN6AY) channel.
|
|
62
64
|
|
|
@@ -69,16 +71,17 @@ After having set up your API using the instructions at [Getting set up with prox
|
|
|
69
71
|
|
|
70
72
|
Using this information enter the following command:
|
|
71
73
|
```
|
|
72
|
-
proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID>
|
|
74
|
+
proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID> --env <ptl/prod>
|
|
73
75
|
```
|
|
74
76
|
The CLI will ask you for your username, and password. For machine authentication, the username and password must be left blank. The credentials will be securely stored in the directory ~/.proxygen/credentials.yaml.
|
|
77
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
75
78
|
|
|
76
79
|
> **_NOTE:_** If you are switching between using user access and machine-user access bare in mind:
|
|
77
80
|
> - proxygen-cli will favour user access if username and password credentials are set
|
|
78
81
|
> - User access uses proxygen-cli-user-client as a client_id. If you switch between access modes remember to switch the client_id
|
|
79
82
|
> - The value for client_secret should remain untouched as it is not used for machine-user access
|
|
80
83
|
> - If you lose the client_secret for then proxygen-cli-user-client then reach out to the platforms-api-producer-support channel for it
|
|
81
|
-
|
|
84
|
+
> - From version 4.0.0 CLI will prompt for client_id and client_secret instead of setting automatically.
|
|
82
85
|
|
|
83
86
|
## Commands
|
|
84
87
|
Commands are documented inside the CLI itself.
|
|
@@ -100,7 +103,7 @@ Use the following command to publish an API specification:
|
|
|
100
103
|
```
|
|
101
104
|
# Production
|
|
102
105
|
proxygen spec publish <path_to_spec>
|
|
103
|
-
|
|
106
|
+
|
|
104
107
|
# UAT
|
|
105
108
|
proxygen spec publish <path_to_spec> --uat
|
|
106
109
|
```
|
|
@@ -15,9 +15,10 @@ After installation, the `proxygen` executable is available. Typing `proxygen` di
|
|
|
15
15
|
### Settings
|
|
16
16
|
To specify the API you are developing for, use:
|
|
17
17
|
```
|
|
18
|
-
proxygen settings set api <API-NAME>
|
|
18
|
+
proxygen settings set api <API-NAME> --env <ptl/prod>
|
|
19
19
|
```
|
|
20
20
|
Your user must have the appropriate permissions for managing instances, secrets, and specifications related to the specified API. If permissions are insufficient, commands will fail. Reach out to the `platforms-api-producer-support` channel for assistance with permissions.
|
|
21
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
### Credentials
|
|
@@ -31,9 +32,10 @@ If you are setting up user access for the first time you will first need to requ
|
|
|
31
32
|
|
|
32
33
|
To setup the Proxygen CLI credentials for the first time with user access enter the following command:
|
|
33
34
|
```
|
|
34
|
-
proxygen credentials set
|
|
35
|
+
proxygen credentials set --env <ptl/prod>
|
|
35
36
|
```
|
|
36
37
|
The CLI will ask you for your username, and password. These credentials will be securely stored on your local machine in the directory ~/.proxygen/credentials.yaml. The client_id and secret used for user access will be automatically added to this file after running the command.
|
|
38
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
37
39
|
|
|
38
40
|
Your user must have permissions to manipulate instances/secrets/specs for the API you set here. If you do not have sufficient permissions commands will fail. If you believe your permissions are incorrect, contact the API platform team via the [platforms-api-producer-support](https://nhsdigital-platforms.slack.com/archives/C016JRWN6AY) channel.
|
|
39
41
|
|
|
@@ -46,16 +48,17 @@ After having set up your API using the instructions at [Getting set up with prox
|
|
|
46
48
|
|
|
47
49
|
Using this information enter the following command:
|
|
48
50
|
```
|
|
49
|
-
proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID>
|
|
51
|
+
proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID> --env <ptl/prod>
|
|
50
52
|
```
|
|
51
53
|
The CLI will ask you for your username, and password. For machine authentication, the username and password must be left blank. The credentials will be securely stored in the directory ~/.proxygen/credentials.yaml.
|
|
54
|
+
Parameter --env is optional, if the environment is not provided then CLI will default to Prod.
|
|
52
55
|
|
|
53
56
|
> **_NOTE:_** If you are switching between using user access and machine-user access bare in mind:
|
|
54
57
|
> - proxygen-cli will favour user access if username and password credentials are set
|
|
55
58
|
> - User access uses proxygen-cli-user-client as a client_id. If you switch between access modes remember to switch the client_id
|
|
56
59
|
> - The value for client_secret should remain untouched as it is not used for machine-user access
|
|
57
60
|
> - If you lose the client_secret for then proxygen-cli-user-client then reach out to the platforms-api-producer-support channel for it
|
|
58
|
-
|
|
61
|
+
> - From version 4.0.0 CLI will prompt for client_id and client_secret instead of setting automatically.
|
|
59
62
|
|
|
60
63
|
## Commands
|
|
61
64
|
Commands are documented inside the CLI itself.
|
|
@@ -77,7 +80,7 @@ Use the following command to publish an API specification:
|
|
|
77
80
|
```
|
|
78
81
|
# Production
|
|
79
82
|
proxygen spec publish <path_to_spec>
|
|
80
|
-
|
|
83
|
+
|
|
81
84
|
# UAT
|
|
82
85
|
proxygen spec publish <path_to_spec> --uat
|
|
83
86
|
```
|
|
@@ -10,6 +10,7 @@ import proxygen_cli.cli.command_credentials as cmd_credentials
|
|
|
10
10
|
from proxygen_cli.lib.credentials import Credentials
|
|
11
11
|
CLIENT_ID = os.environ["PROXYGEN_CLIENT_ID"]
|
|
12
12
|
CLIENT_SECRET = os.environ["PROXYGEN_CLIENT_SECRET"]
|
|
13
|
+
# added below urls to resolve sonar cloud issues.
|
|
13
14
|
KEYCLOAK_URL = "https://identity.prod.api.platform.nhs.uk/realms/api-producers"
|
|
14
15
|
MOCK_KEYCLOAK_URL = "https://mock-keycloak-url.nhs.uk"
|
|
15
16
|
BASE_URL_LABEL = "base_url: "
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "proxygen-cli"
|
|
3
|
-
version = "4.0.
|
|
3
|
+
version = "4.0.3"
|
|
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"
|
|
@@ -14,17 +14,17 @@ proxygen = 'proxygen_cli.cli.command_main:main'
|
|
|
14
14
|
python = "^3.13"
|
|
15
15
|
pydantic = "^1.9.1"
|
|
16
16
|
click="^8.1.2"
|
|
17
|
-
pyjwt = "^2.
|
|
17
|
+
pyjwt = "^2.13.0"
|
|
18
18
|
requests = "^2.32.3"
|
|
19
19
|
lxml = "^6.0.1"
|
|
20
|
-
cryptography = "
|
|
20
|
+
cryptography = "^48.0.1" # Not directly imported, but needed by pyjwt for the RS512 algorithm
|
|
21
21
|
pyyaml = "^6.0.3"
|
|
22
22
|
yaspin = "^3.2.0"
|
|
23
23
|
tabulate = ">=0.9,<0.11"
|
|
24
24
|
packaging = "^24.2"
|
|
25
25
|
|
|
26
26
|
[tool.poetry.group.dev.dependencies]
|
|
27
|
-
pytest = "^
|
|
27
|
+
pytest = "^9.0.3"
|
|
28
28
|
pytest-cov = "^4.0.0"
|
|
29
29
|
pytest-icdiff = "^0.6"
|
|
30
30
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/cli/command_pytest_nhsd_apim_token.py
RENAMED
|
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
|
{proxygen_cli-4.0.0 → proxygen_cli-4.0.3}/proxygen_cli/test/command_pytest_nhsd_apim_token_test.py
RENAMED
|
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
|