Browse Source

fix: add missing authguard decorator for controllers

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
a9829ccc87
  1. 4
      packages/nocodb-nest/src/modules/columns/columns.controller.ts
  2. 6
      packages/nocodb-nest/src/modules/datas/datas.controller.ts
  3. 5
      packages/nocodb-nest/src/modules/import/import.controller.ts
  4. 6
      packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.ts
  5. 6
      packages/nocodb-nest/src/modules/sync/sync.controller.ts
  6. 1
      packages/nocodb-nest/src/run/testDocker.ts

4
packages/nocodb-nest/src/modules/columns/columns.controller.ts

@ -11,7 +11,7 @@ import {
} from '@nestjs/common'
import { ColumnReqType } from 'nocodb-sdk';
import { AuthGuard } from '@nestjs/passport';
import { GlobalGuard } from '../../guards/global/global.guard'
import { GlobalGuard } from '../../guards/global/global.guard';
import {
Acl,
ExtractProjectIdMiddleware,
@ -19,7 +19,7 @@ import {
import { ColumnsService } from './columns.service';
@Controller()
@UseGuards(ExtractProjectIdMiddleware,GlobalGuard)
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
export class ColumnsController {
constructor(private readonly columnsService: ColumnsService) {}

6
packages/nocodb-nest/src/modules/datas/datas.controller.ts

@ -6,12 +6,14 @@ import {
Param,
Patch,
Post,
Request,
Request, UseGuards,
} from '@nestjs/common'
import { Acl } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { GlobalGuard } from '../../guards/global/global.guard'
import { Acl, ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { DatasService } from './datas.service';
@Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
export class DatasController {
constructor(private readonly datasService: DatasService) {}

5
packages/nocodb-nest/src/modules/import/import.controller.ts

@ -1,7 +1,9 @@
import { Controller, HttpCode, Post, Request } from '@nestjs/common'
import { Controller, HttpCode, Post, Request, UseGuards } from '@nestjs/common'
import { forwardRef, Inject } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import { GlobalGuard } from '../../guards/global/global.guard'
import { NcError } from '../../helpers/catchError';
import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { SyncSource } from '../../models';
import NocoJobs from '../../jobs/NocoJobs';
import { ImportService } from './import.service';
@ -81,6 +83,7 @@ export default (
});
};
@Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
export class ImportController {
constructor(
private readonly importService: ImportService,

6
packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.ts

@ -1,9 +1,11 @@
import { Controller, Get, HttpCode, Post } from '@nestjs/common'
import { Controller, Get, HttpCode, Post, UseGuards } from '@nestjs/common'
import { OrgUserRoles } from 'nocodb-sdk';
import { Acl } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { GlobalGuard } from '../../guards/global/global.guard'
import { Acl } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { OrgLcenseService } from './org-lcense.service';
@Controller()
@UseGuards(GlobalGuard)
export class OrgLcenseController {
constructor(private readonly orgLcenseService: OrgLcenseService) {}

6
packages/nocodb-nest/src/modules/sync/sync.controller.ts

@ -6,12 +6,14 @@ import {
Param,
Patch,
Post,
Req,
Req, UseGuards,
} from '@nestjs/common'
import { Acl } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { GlobalGuard } from '../../guards/global/global.guard'
import { Acl, ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { SyncService } from './sync.service';
@Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
export class SyncController {
constructor(private readonly syncService: SyncService) {}

1
packages/nocodb-nest/src/run/testDocker.ts

@ -23,7 +23,6 @@ process.env[`DEBUG`] = 'xc*';
(async () => {
await nocobuild(server);
const httpServer = server.listen(process.env.PORT || 8080, async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
if (!(await User.getByEmail('user@nocodb.com'))) {
const response = await axios.post(
`http://localhost:${process.env.PORT || 8080}/api/v1/auth/user/signup`,

Loading…
Cancel
Save