Protecting API test assets by using secrets
As a project member with Owner role, you can create secrets collections in the project. You can grant or restrict access to the secrets collection that you create in the project.
Members with access to a secrets collection can access, edit, or delete the secrets collection in HCL OneTest Server and can view secrets, edit secrets, or delete secrets.
- Other members added specifically
- All members with a specific role
Members in the project with the Owner or Tester role and with access the secrets collection can use the secrets in the secrets collection, in tests at runtime.
- Create a secrets collection. See Step 1 in Managing secrets collections.
- Add secrets in the secrets collection created. See Step 1 in Creating a secret in a secrets collection.
- Grant access to project members or member roles, who can access the secrets collection. See Step 1 in Granting access to members or member roles.
You can perform the following operations on secrets and secrets collections any time after you create a project:
Managing secrets collections
Before you begin
You must have created a project on HCL OneTest Server.
- Configured a secrets collection in your project.
- Created secrets in the selected secrets collection.
You must be a member with Owner role to create a secrets collection.
You must be a member with access to the secrets collection to edit or delete the 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.
As a member with access to the secrets collection, you can opt to edit or delete a secrets collection configured in a project. For example, you might want to edit the secrets collection name or delete the secrets collection if the testing environment has changed and if secrets that are configured earlier are not required.
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.
- You must provide access to project members or member roles to the secrets collection by selecting members or member roles.
Creating a secret in a secrets collection
Before you begin
You must have created a project on HCL OneTest Server and configured a secrets collection in your project.
You must be a 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 in the selected secrets collection for your project.
What to do next
- You can view, edit, or delete the secrets created under a secrets collection any time you want.
- You can use the secrets in the tests that require these secrets during test runs.
Granting access to members or member roles
Before you begin
You must have created a project on HCL OneTest Server and configured a secrets collection in your project.
You must be a member with an Owner role assigned.
Procedure
Removing access to a secrets collection
Results
You have added members from your project or members with specific role to the access list of people who can access secrets in the selected secrets collection, or you have removed specific members or members with specific role from the access list.
What to do next
You can create secrets under secrets collections for your project.
Managing secrets
Before you begin
You must have created a project on HCL OneTest Server and configured a secrets collection in your project.
You must have created secrets in the selected secrets collection or the secrets collection must contain secrets.
You must be a member with access to the secrets collection.
Procedure
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.