Explicitly set workspaceId column as uuid type to ease pg LEFT JOIN (#15430)

Pg scan was redundant because historically the workspaceId was
`varchar`, even though below migration won't change that we had a look
to workspaceId col declaration across the codebase
This commit is contained in:
Paul Rastoin
2025-10-29 19:08:44 +01:00
committed by GitHub
parent 33545a072c
commit f6f52d676f
14 changed files with 88 additions and 15 deletions
@@ -28,9 +28,9 @@ import {
compareHash,
hashPassword,
} from 'src/engine/core-modules/auth/auth.util';
import { type AuthTokens } from 'src/engine/core-modules/auth/dto/auth-tokens.dto';
import { type AuthorizeAppOutput } from 'src/engine/core-modules/auth/dto/authorize-app.dto';
import { type AuthorizeAppInput } from 'src/engine/core-modules/auth/dto/authorize-app.input';
import { type AuthTokens } from 'src/engine/core-modules/auth/dto/auth-tokens.dto';
import { type UpdatePasswordOutput } from 'src/engine/core-modules/auth/dto/update-password.dto';
import { type UserCredentialsInput } from 'src/engine/core-modules/auth/dto/user-credentials.input';
import { type CheckUserExistOutput } from 'src/engine/core-modules/auth/dto/user-exists.dto';
@@ -65,7 +65,8 @@ export class RenewTokenService {
const accessToken =
isDefined(authProvider) &&
targetedTokenType === JwtTokenTypeEnum.WORKSPACE_AGNOSTIC
targetedTokenType === JwtTokenTypeEnum.WORKSPACE_AGNOSTIC &&
!isDefined(workspaceId)
? await this.workspaceAgnosticTokenService.generateWorkspaceAgnosticToken(
{
userId: user.id,
@@ -74,7 +75,7 @@ export class RenewTokenService {
)
: await this.accessTokenService.generateAccessToken({
userId: user.id,
workspaceId,
workspaceId: workspaceId as string,
authProvider: resolvedAuthProvider,
isImpersonating,
impersonatorUserWorkspaceId,
@@ -60,7 +60,7 @@ export type TransientTokenJwtPayload = CommonPropertiesJwtPayload & {
export type RefreshTokenJwtPayload = CommonPropertiesJwtPayload & {
type: JwtTokenTypeEnum.REFRESH;
workspaceId?: string;
workspaceId?: string | null;
userId: string;
jti?: string;
authProvider?: AuthProviderEnum;