Skip to content
Open
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
8 changes: 4 additions & 4 deletions infra/k6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"scripts": {
"test:all": "k6 run scenarios/stress-full.js",
"test:auth": "k6 run scenarios/auth.js",
"test:teams": "k6 run scenarios/teams.js",
"test:teams-members": "k6 run scenarios/teams-members.js",
"test:teams-invitations": "k6 run scenarios/teams-invitations.js",
"test:teams-me": "k6 run scenarios/teams-me.js",
"test:team": "k6 run scenarios/team.js",
"test:team-members": "k6 run scenarios/team-members.js",
"test:team-invitations": "k6 run scenarios/team-invitations.js",
"test:team-me": "k6 run scenarios/team-me.js",
"test:projects": "k6 run scenarios/projects.js",
"test:users": "k6 run scenarios/users.js",
"test:boards:all": "k6 run scenarios/boards.js && k6 run scenarios/boards-columns.js && k6 run scenarios/boards-views.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 20 additions & 7 deletions libs/bootstrap/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* хука для Node.js HTTP-слоя (this.raw). Приведение к 'any' здесь является легитимным решением
* для динамического monkey-patching-а.
*/
.addHook('onRequest', (request: any, reply: any, done) => {

Check warning on line 70 in libs/bootstrap/src/bootstrap.ts

View workflow job for this annotation

GitHub Actions / Lint & Test

Unexpected any. Specify a different type

Check warning on line 70 in libs/bootstrap/src/bootstrap.ts

View workflow job for this annotation

GitHub Actions / Lint & Test

Unexpected any. Specify a different type

Check warning on line 70 in libs/bootstrap/src/bootstrap.ts

View workflow job for this annotation

GitHub Actions / Lint & Test

Unexpected any. Specify a different type

Check warning on line 70 in libs/bootstrap/src/bootstrap.ts

View workflow job for this annotation

GitHub Actions / Lint & Test

Unexpected any. Specify a different type
reply.setHeader = function (key: string, value: string) {
return this.raw.setHeader(key, value);
};
Expand Down Expand Up @@ -100,6 +100,10 @@
},
});

const isProduction = configService.get('NODE_ENV') === 'production';
const domain = configService.get('DOMAIN');
const stage = configService.get('STAGE_DOMAIN');

if (apiPrefix) {
app.setGlobalPrefix(apiPrefix);
}
Expand All @@ -118,9 +122,6 @@
if (swaggerOptions) {
const { path = 'docs', ...metadata } = swaggerOptions;

const domain = configService.get('DOMAIN');
const stage = configService.get('STAGE_DOMAIN');

const fullOptions = {
...metadata,
path,
Expand All @@ -135,14 +136,26 @@
}
if (useCookieParser) {
const secret = configService.getOrThrow('COOKIE_SECRET');
await app.register(fastifyCookie, { secret });
await app.register(fastifyCookie, {
secret,
parseOptions: {
httpOnly: true,
sameSite: 'lax',
signed: true,
secure: isProduction,
path: '/',
domain: domain ? `.${domain}` : undefined,
},
});
await app.register(fastifyCsrf, {
cookieOpts: {
signed: true,
httpOnly: true,
sameSite: 'strict',
secure: configService.getOrThrow('NODE_ENV') === 'production',
sameSite: 'lax',
secure: isProduction,
path: '/',
domain: domain ? `.${domain}` : undefined,
},
sessionPlugin: '@fastify/cookie',
});
}
if (setupApp) {
Expand Down
6 changes: 6 additions & 0 deletions migrations/0006_opposite_pet_avengers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE "base"."team_members" ALTER COLUMN "role" SET DATA TYPE text;
ALTER TABLE "base"."team_members" ALTER COLUMN "role" SET DEFAULT 'member'::text;
DROP TYPE "base"."team_role";
CREATE TYPE "base"."team_role" AS ENUM('owner', 'admin', 'member', 'viewer');
ALTER TABLE "base"."team_members" ALTER COLUMN "role" SET DEFAULT 'member'::"base"."team_role";
ALTER TABLE "base"."team_members" ALTER COLUMN "role" SET DATA TYPE "base"."team_role" USING "role"::"base"."team_role";
Loading
Loading