InfraCrid Management Guide
The InfraCrid function allows you to manage encrypted infrastructure credentials securely. It provides features for adding, editing, and viewing encrypted environment variables, with a simple integration mechanism for pipelines.
Command Group: infracrid
      All commands related to managing encrypted infrastructure credentials are grouped under infracrid.
Usage:
dob infracrid [COMMAND]
      Available Commands:
add– Add a new encrypted environment variable and generate a URL.edit– Edit an existing encrypted environment variable.view– View the decrypted value of an existing variable.
Command Details
infracrid add
      Add an encrypted environment variable and generate a URL for usage in the pipeline configuration.
Usage:
dob infracrid add --name <variable_name> --value <variable_value>
      Details:
- Encrypts the provided value using the cipher library.
 - Saves the encrypted value to a 
.credfile in the predefinedBUILDCRID_DIR. - Generates a unique URL (
infracrid://<name>) for reference in pipeline configurations. 
infracrid edit
      Edit the value of an existing encrypted environment variable.
Usage:
dob infracrid edit --name <variable_name> --value <new_variable_value>
      Details:
- Locates the 
.credfile for the specified variable in theBUILDCRID_DIR. - Updates the file with the encrypted new value.
 
Note:
- If the variable does not exist, the command displays an error message.
 
infracrid view
      View the decrypted value of an existing encrypted environment variable.
Usage:
infracrid view --name <variable_name>
      Details:
- Decrypts the content of the 
.credfile for the specified variable. - Displays the decrypted value in the terminal.
 
Note:
- If the variable does not exist, the command displays an error message.
 
Implementation Details
Encryption and Decryption
- Uses the cipher object for encrypting and decrypting values.
 - Ensures data is stored securely in 
.credfiles. 
Storage
- Encrypted 
.credfiles are saved in theBUILDCRID_DIRdirectory. - File naming convention: 
<variable_name>.cred. 
URL Generation
- Each environment variable is associated with a unique URL format: 
infracrid://<name>. - These URLs can be used in pipeline configurations to reference variables.
 
Example Usages
Add a New Variable
dob infracrid add
      Input:
Variable Name: DB_PASSWORD
Variable Value: my_secure_password
      
      Output:
Variable saved. Use this URL in your config: infracrid://DB_PASSWORD
      
      Edit an Existing Variable
dob infracrid edit
      Input:
Variable Name: DB_PASSWORD
New Variable Value: updated_password
      
      Output:
Variable 'DB_PASSWORD' updated successfully.
      
      View a Variable
dob infracrid view
      Input:
Variable Name: DB_PASSWORD
      
      Output:
Decrypted value for 'DB_PASSWORD': my_secure_password
      
      Notes
- Security: Ensure 
BUILDCRID_DIRis protected and accessible only to authorized users. - Dependencies: This tool requires the Click library for CLI management and a properly configured cipher for encryption and decryption.