fix: updated aws principal arn field size to 2048

This commit is contained in:
=
2025-06-18 23:00:52 +05:30
parent 46f9927cf1
commit d35331b0a8
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
const hasColumn = await knex.schema.hasColumn(TableName.IdentityAwsAuth, "allowedPrincipalArns");
if (hasColumn) {
await knex.schema.alterTable(TableName.IdentityAwsAuth, (t) => {
t.string("allowedPrincipalArns", 2048).notNullable().alter();
});
}
}
export async function down(knex: Knex): Promise<void> {
const hasColumn = await knex.schema.hasColumn(TableName.IdentityAwsAuth, "allowedPrincipalArns");
if (hasColumn) {
await knex.schema.alterTable(TableName.IdentityAwsAuth, (t) => {
t.string("allowedPrincipalArns", 255).notNullable().alter();
});
}
}

View File

@@ -9,6 +9,7 @@ const arnRegex = new RE2(/^arn:aws:iam::\d{12}:(user\/[a-zA-Z0-9_.@+*/-]+|role\/
export const validateAccountIds = z
.string()
.trim()
.max(2048)
.default("")
// Custom validation to ensure each part is a 12-digit number
.refine(
@@ -36,6 +37,7 @@ export const validateAccountIds = z
export const validatePrincipalArns = z
.string()
.trim()
.max(2048)
.default("")
// Custom validation for ARN format
.refine(