This project takes 0.5.0 credentials in app-config.json across projects and transforms them into the required 0.6.0 credential format based on V0.6.0 Migration Guide
There are 2 types of code that are produced:
- main_transformer.py: reads full app-config.json and outputs all the transformed credentials within app-config.json
- testing_indiv_credential.py: reads a single credential and outputs the transformed credential
pyx-untp-migration/
├── 00_Script/ # main python scripts & transformation modules (main_transformer.py)
├── 01_Data/app-config # stores app-config.json for different Pyx projects
├── 02_Documentation/ # contains project documentations
└── 03_Test_UNTP-Playground/ # stores successful test files in tests-untp playground
-
Clone the repository /pyx-apps/ in Ubuntu 24.04
-
Install Python Extensions:
- Python Debugger
- Python
- Pylance
- Python Environment
-
Create and activate a Python virtual environment (recommended):
python -m venv .venv source .venv/bin/activate # Linux / macOS .venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Place your files in
01_Data/app-config/<project_name>/, e.g.:- To transform app-config.json:
01_Data/app-config/BCMine/app-config.json 01_Data/app-config/RegenFarmers/app-config.json- To transform individual credential:
01_Data/app-config/BCMine/sample-credential.json
-
Update the parameters
- To transform app-config.json:
input_folder_name = "01_Data/app-config" brand_name = 'RBTP' # comment out testing_folder file_name = "app-config.json" version = '0.6.0'
- To transform individual credential:
input_folder_name = "01_Data/app-config" brand_name = 'RBTP' file_name = "sample-credential.json" testing_folder = 'DIA' version = '0.6.0'
-
Run the tool:
- To transform app-config.json:
python3 00_Script/main_transformer.py
- To transform individual credential:
python3 00_Script/testing_indiv_credential.py
To test the credentials:
- Place the upgraded app-config.json to the upgraded server.
- If you would like to change the name of the app-config.json for testing purposes, update the
<app-config-name>in package.json:
"scripts": {
"copy-config": "cp <app-config-name>.json packages/mock-app/src/constants/app-config.json && cp <app-config-name>.json packages/components/src/constants/app-config.json",- Run the below commands:
yarn build yarn start
- Ensure credentials are issued successfully.
-
App-config transformation
01_Data/app-config/RBTP/app-config.json → 01_Data/app-config/RBTP/transformed-app-config-v0.6.0.json -
Single credential transformation
01_Data/app-config/RBTP/sample-credential.json → 01_Data/app-config/RBTP/transformed-<credential_type>-sample-credential-v0.6.0.json
- This code is primarily designed to transform credentials from v0.5.0 to v0.6.0. To migrate future releases, separate modules need to be created and parameters need to be configured.