Compare commits

...

3 Commits

Author SHA1 Message Date
f51e9ba8ff add back role migration 2023-09-25 11:51:25 -07:00
a255af6ad8 Merge pull request #1022 from Infisical/debug-vercel-integration
Patch Vercel integration for custom preview branches
2023-09-23 11:42:38 +01:00
30da2e50b1 Patch Vercel integration for custom preview branches 2023-09-23 11:38:49 +01:00
3 changed files with 25 additions and 4 deletions

View File

@ -950,7 +950,11 @@ const syncSecretsVercel = async ({
? {
teamId: integrationAuth.teamId
}
: {})
: {}),
...(integration?.path
? {
gitBranch: integration?.path
} : {})
};
const vercelSecrets: VercelSecret[] = (
@ -969,7 +973,7 @@ const syncSecretsVercel = async ({
if (
integration.targetEnvironment === "preview" &&
integration.path &&
secret.gitBranch &&
integration.path !== secret.gitBranch
) {
// case: secret on preview environment does not have same target git branch
@ -978,7 +982,7 @@ const syncSecretsVercel = async ({
return true;
});
const res: { [key: string]: VercelSecret } = {};
for await (const vercelSecret of vercelSecrets) {

View File

@ -819,3 +819,18 @@ export const backfillPermission = async () => {
console.info("Could not acquire lock for script [backfillPermission], skipping");
}
};
export const migrateRoleFromOwnerToAdmin = async () => {
await MembershipOrg.updateMany(
{
role: OWNER
},
{
$set: {
role: ADMIN
}
}
);
console.info("Backfill: Finished converting owner role to member");
}

View File

@ -18,7 +18,8 @@ import {
backfillServiceToken,
backfillServiceTokenMultiScope,
backfillTrustedIps,
backfillUserAuthMethods
backfillUserAuthMethods,
migrateRoleFromOwnerToAdmin
} from "./backfillData";
import {
reencryptBotOrgKeys,
@ -85,6 +86,7 @@ export const setup = async () => {
await backfillTrustedIps();
await backfillUserAuthMethods();
// await backfillPermission();
await migrateRoleFromOwnerToAdmin()
// re-encrypt any data previously encrypted under server hex 128-bit ENCRYPTION_KEY
// to base64 256-bit ROOT_ENCRYPTION_KEY