dotencr
Version:
Encrypt and decrypt individual lines inside a .env file. Supports multiple encryption keys. Keys and dotenv files can be read text file or read from the environment.
94 lines (93 loc) • 3.27 kB
TypeScript
export interface Feedback {
/**
* Populated with the file path if the dotenv file was backed up.
*/
backupFileName?: string;
/**
* The encryption/decryption results will be written to this file.
*/
dotenvOutputFileName: string;
/**
* Read dotenv variables from this file.
*/
dotenvSourceFileName: string;
errors: {
/**
* Any errors related to the ciphered variable name.
*/
cipheredVariableErrors: string[];
/**
* Any errors related to the encryption keys. Including length, name, etc.
*/
encryptionKeyErrors: string[];
/**
* List of all variables which could not be decrypted.
*/
errorDecryptingVariables: string[];
/**
* List of all variables which could not be encrypted.
*/
errorEncryptingVariables: string[];
/**
* If the ciphered and plain text variable both exist.
* Decrypt the ciphered variable. Compare the values
* of the plain text and decrypted value. If they do not match
* report the error.
* @see matchingPlainTextAndCipherValues
*/
errorValuesDoNotMatch: string[];
/**
* Any errors related to the dotenv variable name or value portion format.
*/
invalidVariableFormat: string[];
/**
* List of all unencrypted variables in the dotenv file. Unencrypted variables are considered
* an error. Since the ".env" should not contain unencrypted data when being
* checked into source control.
*/
plainTextVariables: string[];
/**
* Any errors related to the unencrypted variable name.
*/
plainTextVariableErrors: string[];
};
warnings: {
/**
* List of any missing encryption keys. This is considered a warning. It can be normal
* for a developer to not be given the encryption keys to sensitive environments such as test and production.
*/
missingEncryptionKeys: string[];
};
info: {
/**
* List of all the encrypted variables.
*/
encryptedVariables: string[];
/**
* List of all the encryption keys found.
*/
encryptionKeys: string[];
/**
* If the ciphered and plain text variable both exist.
* Decrypt the ciphered variable. Compare the values
* of the plain text and decrypted value. If they match
* report them here.
* @see errorValuesDoNotMatch
*/
matchingPlainTextAndCipherValues: string[];
/**
* Miscellaneous notifications. Eg. a command line argument that is ignored.
*/
miscellaneous: string[];
/**
* List of all variables successfully decrypted.
*/
successfullyDecrypted: string[];
/**
* List of all variables successfully encrypted.
*/
successfullyEncrypted: string[];
};
}
export declare const createDefaultFeedback: (feedbackOverrides?: Feedback | undefined) => Feedback;
export declare const coerceFeedbackPathsToRelativePaths: (feedback: Feedback) => Feedback;