mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 08:27:36 +00:00
Update external-migration-fns.ts
This commit is contained in:
@@ -105,7 +105,22 @@ export const parseEnvKeyDataFn = async (decryptedJson: string): Promise<Infisica
|
|||||||
secretName: string,
|
secretName: string,
|
||||||
envs: typeof parsedJson.envs
|
envs: typeof parsedJson.envs
|
||||||
): { val?: string } => {
|
): { val?: string } => {
|
||||||
if (!secret.inheritsEnvironmentId) return secret;
|
if (!secret) {
|
||||||
|
return {
|
||||||
|
val: ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have a direct value, return it
|
||||||
|
if (secret.val !== undefined) {
|
||||||
|
return secret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there's no inheritance, return the secret as is
|
||||||
|
if (!secret.inheritsEnvironmentId) {
|
||||||
|
return secret;
|
||||||
|
}
|
||||||
|
|
||||||
const inheritedEnv = envs[secret.inheritsEnvironmentId];
|
const inheritedEnv = envs[secret.inheritsEnvironmentId];
|
||||||
if (!inheritedEnv) return secret;
|
if (!inheritedEnv) return secret;
|
||||||
return findRootInheritedSecret(inheritedEnv.variables[secretName], secretName, envs);
|
return findRootInheritedSecret(inheritedEnv.variables[secretName], secretName, envs);
|
||||||
|
|||||||
Reference in New Issue
Block a user