Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function getProjectAndToken(
organization: {
id: organization.id,
},
projectSettings: {},
},
expiresInSeconds,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class AnonymousAuthnHandler extends BaseSecurityHandler {
organization: {
id: `ANONYMOUS_${openOpsId()}`,
},
projectSettings: {},
};
}

Expand Down
8 changes: 2 additions & 6 deletions packages/server/api/test/helpers/auth.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { faker } from '@faker-js/faker';
import {
openOpsId,
Principal,
PrincipalType,
ProjectMemberRole,
} from '@openops/shared';
import { openOpsId, Principal, PrincipalType } from '@openops/shared';
import jwt, { Algorithm, JwtPayload, SignOptions } from 'jsonwebtoken';

const generateToken = ({
Expand Down Expand Up @@ -34,6 +29,7 @@ export const generateMockToken = async (
organization: principal?.organization ?? {
id: openOpsId(),
},
projectSettings: principal?.projectSettings ?? {},
};

return generateToken({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ beforeAll(async () => {
organization: {
id: mockOrganization.id,
},
projectSettings: {},
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('Chat Request Router', () => {
organization: {
id: 'test-org-id',
},
projectSettings: {},
};

const mockNewMessage: CoreMessage = {
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/lib/authentication/model/principal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Principal = {
organization: {
id: OpenOpsId;
};
projectSettings: Record<string, unknown>;
};

export type WorkerPrincipal = {
Expand Down
Loading