This repository provides scripts to configure the Kreya gRPC tool for testing the HFN backend services. It handles the retrieval of proto files, environment setup, and management of authentication tokens. Both Windows and macOS/Linux are supported through separate scripts.
getProtos.bat
: Batch script for Windows to pull proto files and set up the environment.getProtos.sh
: Shell script for macOS/Linux with the same functionality.getToken.js
: JavaScript script to fetch and store an authentication token in the configuration JSON used by Kreya for API testing.
- Git installed.
- Node.js installed (required to run
getToken.js
). - Kreya gRPC Tool installed: Download Kreya.
Run the appropriate script for your operating system to download and set up proto files.
getProtos.bat <environment> <branch>
./getProtos.sh <environment> <branch>
- environment: Specify
dev
orqa
. - branch: Specify the branch (used only in
dev
).
./getProtos.sh dev feature-branch
This command:
- Downloads proto files for the required backend services.
- Switches to the specified branch if
dev
is selected. - Organizes the files for use in Kreya.
Use the getToken.js
script to fetch an authentication token and store it in the required JSON configuration.
node getToken.js
The script will:
- Fetch the auth token using credentials from the environment variables.
- Store the token inside the Kreya configuration JSON under
authConfigs
→options.value
. - Ensure the token is available for testing gRPC APIs in Kreya.
Example of how the token will be saved in the Kreya JSON configuration:
{
"authConfigs": [
{
"name": "Bearer-dev",
"providerName": "static",
"id": "46d83971-08d7-42b5-acc9-413e2ca27446",
"options": {
"value": "<AUTH_TOKEN>"
}
}
]
}
- Ensure you run the appropriate protos retrieval script before testing APIs in Kreya.
- The token refresh logic ensures that the token is up-to-date and correctly stored inside the JSON file used by Kreya.