proxygen-cli 2.1.13__tar.gz → 2.1.14__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.
Files changed (36) hide show
  1. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/PKG-INFO +34 -12
  2. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/README.md +33 -11
  3. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/constants.py +1 -1
  4. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/pyproject.toml +1 -1
  5. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/__init__.py +0 -0
  6. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_credentials.py +0 -0
  7. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_docker.py +0 -0
  8. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_instance.py +0 -0
  9. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_main.py +0 -0
  10. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_pytest_nhsd_apim_token.py +0 -0
  11. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_secret.py +0 -0
  12. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_settings.py +0 -0
  13. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/cli/command_spec.py +0 -0
  14. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/auth.py +0 -0
  15. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/credentials.py +0 -0
  16. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/dot_proxygen.py +0 -0
  17. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/output.py +0 -0
  18. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/proxygen_api.py +0 -0
  19. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/settings.py +0 -0
  20. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/spec.py +0 -0
  21. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/spec_server.py +0 -0
  22. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/lib/version.py +0 -0
  23. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/__init__.py +0 -0
  24. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_credentials_test.py +0 -0
  25. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_instance_test.py +0 -0
  26. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_main_test.py +0 -0
  27. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_pytest_nhsd_apim_token_test.py +0 -0
  28. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_secret_test.py +0 -0
  29. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_settings_test.py +0 -0
  30. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/command_spec_test.py +0 -0
  31. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/conftest.py +0 -0
  32. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/fixtures/client.key +0 -0
  33. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/fixtures/client.pem +0 -0
  34. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/fixtures/secret.txt +0 -0
  35. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/proxygen_cli/test/mock_private_key.py +0 -0
  36. {proxygen_cli-2.1.13 → proxygen_cli-2.1.14}/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.13
3
+ Version: 2.1.14
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
@@ -36,28 +36,50 @@ After installation, the `proxygen` executable is available. Typing `proxygen` di
36
36
 
37
37
  ## Configuration
38
38
 
39
+
40
+ ### Settings
41
+ To specify the API you are developing for, use:
42
+ ```
43
+ proxygen settings set api <API-NAME>
44
+ ```
45
+ 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.
46
+
47
+
39
48
  ### Credentials
49
+ There are two ways to authenticate via the Proxygen CLI. Either via user login credentials such as a username and password or as a machine user using your private key and client_id.
40
50
 
41
- The Proxygen CLI client credentials `client_id`, `client_secret` are setup as part of proxygen CLI package.
51
+ #### Setting up for user access
52
+ If you are setting up user access for the first time you will first need to request a user account. Contact the [platforms-api-producer-support](https://nhsdigital-platforms.slack.com/archives/C016JRWN6AY) channel asking for a proxygen user account to be set up providing:
42
53
 
43
- All users should have individual credentials. `proxygen-cli` needs to know about them. You can setup your user credentials in proxygen-cli using:
54
+ - Your nhs.net email address
55
+ - The proxygen-managed api/s your account will need access to
56
+
57
+ To setup the Proxygen CLI credentials for the first time with user access enter the following command:
44
58
  ```
45
59
  proxygen credentials set
46
60
  ```
47
- This command prompts you to enter your `username`, and `password`.
61
+ 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.
48
62
 
49
- To update any credentials `client_id`/ `client_secret`/ `username`/ `password` in the future, use:
50
- ```
51
- proxygen credentials set <KEY> <VALUE>
52
- ```
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.
53
64
 
65
+ #### Setting up for machine-user access
66
+ After having set up your API using the instructions at [Getting set up with proxy generator](https://nhsd-confluence.digital.nhs.uk/display/APM/Getting+set+up+with+proxy+generator), you should have the following:
54
67
 
55
- ### Settings
56
- To specify the API you are developing for, use:
68
+ - A private key from a key pair for machine user access
69
+ - The key id for that specific key pair
70
+ - The client_id for your api machine user access (usually <your-api-name>-client)
71
+
72
+ Using this information enter the following command:
57
73
  ```
58
- proxygen settings set api <API-NAME>
74
+ proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID>
59
75
  ```
60
- 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.
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
+
78
+ > **_NOTE:_** If you are switching between using user access and machine-user access bare in mind:
79
+ > - proxygen-cli will favour user access if username and password credentials are set
80
+ > - User access uses proxygen-cli-user-client as a client_id. If you switch between access modes remember to switch the client_id
81
+ > - The value for client_secret should remain untouched as it is not used for machine-user access
82
+ > - If you lose the client_secret for then proxygen-cli-user-client then reach out to the platforms-api-producer-support channel for it
61
83
 
62
84
 
63
85
  ## Commands
@@ -11,28 +11,50 @@ After installation, the `proxygen` executable is available. Typing `proxygen` di
11
11
 
12
12
  ## Configuration
13
13
 
14
+
15
+ ### Settings
16
+ To specify the API you are developing for, use:
17
+ ```
18
+ proxygen settings set api <API-NAME>
19
+ ```
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
+
22
+
14
23
  ### Credentials
24
+ There are two ways to authenticate via the Proxygen CLI. Either via user login credentials such as a username and password or as a machine user using your private key and client_id.
15
25
 
16
- The Proxygen CLI client credentials `client_id`, `client_secret` are setup as part of proxygen CLI package.
26
+ #### Setting up for user access
27
+ If you are setting up user access for the first time you will first need to request a user account. Contact the [platforms-api-producer-support](https://nhsdigital-platforms.slack.com/archives/C016JRWN6AY) channel asking for a proxygen user account to be set up providing:
17
28
 
18
- All users should have individual credentials. `proxygen-cli` needs to know about them. You can setup your user credentials in proxygen-cli using:
29
+ - Your nhs.net email address
30
+ - The proxygen-managed api/s your account will need access to
31
+
32
+ To setup the Proxygen CLI credentials for the first time with user access enter the following command:
19
33
  ```
20
34
  proxygen credentials set
21
35
  ```
22
- This command prompts you to enter your `username`, and `password`.
36
+ 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.
23
37
 
24
- To update any credentials `client_id`/ `client_secret`/ `username`/ `password` in the future, use:
25
- ```
26
- proxygen credentials set <KEY> <VALUE>
27
- ```
38
+ 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.
28
39
 
40
+ #### Setting up for machine-user access
41
+ After having set up your API using the instructions at [Getting set up with proxy generator](https://nhsd-confluence.digital.nhs.uk/display/APM/Getting+set+up+with+proxy+generator), you should have the following:
29
42
 
30
- ### Settings
31
- To specify the API you are developing for, use:
43
+ - A private key from a key pair for machine user access
44
+ - The key id for that specific key pair
45
+ - The client_id for your api machine user access (usually <your-api-name>-client)
46
+
47
+ Using this information enter the following command:
32
48
  ```
33
- proxygen settings set api <API-NAME>
49
+ proxygen credentials set private_key_path <PATH_TO_PRIVATE_KEY> key_id <KEY_ID_FOR_PRIVATE_KEY> client_id <MACHINE_USER_CLIENT_ID>
34
50
  ```
35
- 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.
51
+ 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.
52
+
53
+ > **_NOTE:_** If you are switching between using user access and machine-user access bare in mind:
54
+ > - proxygen-cli will favour user access if username and password credentials are set
55
+ > - User access uses proxygen-cli-user-client as a client_id. If you switch between access modes remember to switch the client_id
56
+ > - The value for client_secret should remain untouched as it is not used for machine-user access
57
+ > - If you lose the client_secret for then proxygen-cli-user-client then reach out to the platforms-api-producer-support channel for it
36
58
 
37
59
 
38
60
  ## Commands
@@ -18,4 +18,4 @@ LITERAL_SECRET_TYPES = Literal[
18
18
  ]
19
19
 
20
20
  PROXYGEN_CLIENT_ID = "proxygen-cli-user-client"
21
- PROXYGEN_CLIENT_SECRET = "AEJZAShjA4w4n9lQBvDWRpzL0fUlHNIi"
21
+ PROXYGEN_CLIENT_SECRET = "CDuV9K39GxFS37tzdopKitIMv8AZaIAj"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "proxygen-cli"
3
- version = "2.1.13"
3
+ version = "2.1.14"
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"