refactor: Update clientSecret field to support longer OAuth secrets and enhance documentation

This commit is contained in:
Nawaz Dhandala
2026-01-12 11:17:31 +00:00
parent 1a0fac5a3f
commit 07476f366c
3 changed files with 22 additions and 4 deletions

View File

@@ -652,16 +652,15 @@ export default class ProjectSmtpConfig extends BaseModel {
})
@TableColumn({
required: false,
type: TableColumnType.Password,
type: TableColumnType.VeryLongText,
title: "OAuth Client Secret",
description:
"The Client Secret from your OAuth application registration. Required for OAuth authentication.",
"The Client Secret from your OAuth application registration. Required for OAuth authentication. For Google service accounts, this is the private key from the JSON key file.",
example: "your-client-secret",
})
@Column({
nullable: true,
type: ColumnType.Password,
length: ColumnLength.Password,
type: ColumnType.VeryLongText,
})
public clientSecret?: string = undefined;

View File

@@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class IncreaseClientSecretLength1768216593272 implements MigrationInterface {
name = 'IncreaseClientSecretLength1768216593272'
public async up(queryRunner: QueryRunner): Promise<void> {
// Change clientSecret from varchar(500) to text to support longer OAuth secrets
// (e.g., Google service account private keys which are ~1700+ characters)
await queryRunner.query(`ALTER TABLE "ProjectSMTPConfig" ALTER COLUMN "clientSecret" TYPE text`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
// Revert back to varchar(500)
await queryRunner.query(`ALTER TABLE "ProjectSMTPConfig" ALTER COLUMN "clientSecret" TYPE character varying(500)`);
}
}

View File

@@ -217,6 +217,7 @@ import { MigrationName1767896933148 } from "./1767896933148-MigrationName";
import { RenameServiceCatalogToService1767966850199 } from "./1767966850199-RenameServiceCatalogToService";
import { MigrationName1767979055522 } from "./1767979055522-MigrationName";
import { MigrationName1767979448478 } from "./1767979448478-MigrationName";
import { IncreaseClientSecretLength1768216593272 } from "./1768216593272-IncreaseClientSecretLength";
export default [
InitialMigration,
@@ -438,4 +439,5 @@ export default [
MigrationName1767979055522,
MigrationName1767979448478,
MigrationName1767896933148,
IncreaseClientSecretLength1768216593272,
];