Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global guards in @nestjs/websockets #11461

Closed
3 of 15 tasks
Maligosus opened this issue Apr 13, 2023 · 3 comments
Closed
3 of 15 tasks

Global guards in @nestjs/websockets #11461

Maligosus opened this issue Apr 13, 2023 · 3 comments
Labels
needs triage This issue has not been looked into

Comments

@Maligosus
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Global guards not work in @nestjs/websockets

Minimum reproduction code

https://codesandbox.io/s/vibrant-dijkstra-jq1r33?file=/test/app.e2e-spec.ts

Steps to reproduce

  1. npm run test:e2e

Expected behavior

Global guards are called in @nestjs/websockets

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

9.4.0

Packages versions

{
  "name": "nest-typescript-starter",
  "private": true,
  "version": "1.0.0",
  "description": "Nest TypeScript starter repository",
  "license": "MIT",
  "scripts": {
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "yarn test:e2e",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/common": "^9.0.0",
    "@nestjs/core": "^9.0.5",
    "@nestjs/platform-express": "^9.0.0",
    "@nestjs/platform-socket.io": "9.3.12",
    "@nestjs/websockets": "9.3.12",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^7.5.5",
    "socket.io-client": "4.6.1"
  },
  "devDependencies": {
    "@nestjs/cli": "^9.0.0",
    "@nestjs/schematics": "^9.0.0",
    "@nestjs/testing": "^9.0.0",
    "@types/express": "^4.17.13",
    "@types/jest": "^28.1.4",
    "@types/node": "^18.0.3",
    "@types/supertest": "^2.0.12",
    "@typescript-eslint/eslint-plugin": "^5.30.5",
    "@typescript-eslint/parser": "^5.30.5",
    "eslint": "^8.19.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.2.1",
    "jest": "^28.1.2",
    "prettier": "^2.7.1",
    "source-map-support": "^0.5.21",
    "supertest": "^6.2.4",
    "ts-jest": "^28.0.5",
    "ts-loader": "^9.3.1",
    "ts-node": "^10.8.2",
    "tsconfig-paths": "^4.0.0",
    "typescript": "^4.7.4"
  },
  "jest": {
    "moduleFileExtensions": ["js", "json", "ts"],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": ["**/*.(t|j)s"],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@Maligosus Maligosus added the needs triage This issue has not been looked into label Apr 13, 2023
@Maligosus Maligosus changed the title Global guards Global guards in @nestjs/websockets Apr 13, 2023
@Maligosus
Copy link
Author

I checked docs, and I see notice. Sorry. But i can pr to enable global guards for gateways.

@Maligosus
Copy link
Author

I found previous issue about this feature #8060 (comment)

@kamilmysliwiec
Copy link
Member

Thanks for your suggestion!

This has been discussed several times in the past and there are no plans to implement it in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

@nestjs nestjs locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants