Protecting API test assets by using secrets
As a project owner, you can grant or restrict access to secrets collections, edit secrets, and delete secrets. Members with access can access secrets collections in the HCL OneTest Server and view secrets, edit secrets, delete secrets, or use secrets at test runtime.
Table 1 shows the role-based operations that you can perform in your project.
Operation | Owner | Tester with Access to Secrets Collection | Viewer with Access to Secrets Collection |
---|---|---|---|
Creating a secrets collection |
|||
Creating a secret under a secrets collection |
|||
Granting access to members |
|||
Editing a secret |
|||
Viewing a secret |
|||
Deleting a secret |
|||
Editing a secrets collection |
|||
Deleting a secrets collection |
|||
Using secrets in test runs |
- Create a secrets collection. See Step 1 in Creating, editing, or deleting a secrets collection.
- Add secrets under the secrets collection created. See Step 1 in Creating a secret under a secrets collection.
- Grant access to project members who can access the secrets collection. See Step 1 in Granting access to members.
You can perform the following operations on secrets and secrets collections anytime after you create a project.
Creating, editing, or deleting a secrets collection
Before you begin
- Created a project on HCL OneTest Server. See Creating a project.
- Configured the repository that contains the test assets in your project. See Adding repositories.
- Configured a secrets collection in your project.
- Been a project owner to edit or delete a secrets collection.
- Created secrets under the selected secrets collection.
About this task
You must configure secrets collections in your project so that the members of the project can use secrets contained in a collection during test runs. You can configure secrets so that you can use them in different test environments.
Procedure
To create a secrets collection:
To edit or delete a secrets collection:
Results
- Created a secrets collection for your project.
- Edited the name of a secrets collection in your project.
- Removed a secrets collection from your project.
What to do next
- If you have created a new secrets collection, you must add secrets to your secrets collection. See Creating a secret under a secrets collection.
- You must provide access to project members to the secrets collection by selecting members. See Granting access to members.
Creating a secret under a secrets collection
Before you begin
- Created a project on HCL OneTest Server. See Creating a project.
- Configured the repository that contains the test assets in your project. See Adding repositories.
- Configured a secrets collection in your project. See Creating, editing, or deleting a secrets collection.
- Been a project owner or member with access to the secrets collection.
About this task
You can also configure secrets such that the secrets can be used across different test environments by members with access to the secrets collection. Secrets correspond to the environment variables or tags that you create in a HCL OneTest API project specific to an environment.
Procedure
Results
You have created secrets under the selected secrets collection for your project.
What to do next
- You can view, edit, or delete the secrets created under a secrets collection anytime you want. See Viewing, editing, or deleting a secret.
- You can use the secrets in the tests that require these secrets during test runs.
Granting access to members
Before you begin
- Created a project on HCL OneTest Server. See Creating a project.
- Configured the repository that contains the test assets in your project. See Adding repositories.
- Configured a secrets collection in your project. See Creating, editing, or deleting a secrets collection.
- Been a project owner or member with access to the secrets collection.
Procedure
Removing access to a secrets collection
Results
You have added members from your project to the access list of people who can access secrets in the selected secrets collection or you have removed members from the access list.
What to do next
You can create secrets under secrets collections for your project. See Creating a secret under a secrets collection.
Viewing, editing, or deleting a secret
Before you begin
- Created a project on HCL OneTest Server. See Creating a project.
- Configured the repository that contains the test assets in your project. See Adding repositories.
- Configured a secrets collection in your project. See Creating, editing, or deleting a secrets collection.
- You must have created secrets under the selected secrets collection or the secrets collection must contain secrets to view.
- Been a project owner or member with access to the secrets collection.
Procedure
Viewing a secret value
Editing a secret value
Deleting a secret
Results
- You viewed the password configured of the secret under a secrets collection that you created or were granted access.
- You changed the secret value of the secret under a secrets collection in your project.
- You deleted and removed the secret from the selected secrets collection in your project.
What to do next
You can use secrets in the tests that require these secrets during test runs. See Running tests.