mirror of
https://github.com/Thream/socketio-jwt.git
synced 2024-07-21 09:38:31 +02:00
chore: improve config files
This commit is contained in:
parent
c7f64a6312
commit
4b95cd4293
6
.github/ISSUE_TEMPLATE/DOCUMENTATION.md
vendored
6
.github/ISSUE_TEMPLATE/DOCUMENTATION.md
vendored
@ -5,11 +5,7 @@ title: '[Documentation]'
|
||||
labels: 'documentation'
|
||||
---
|
||||
|
||||
<!--
|
||||
Please make sure your issue has not already been fixed.
|
||||
|
||||
Please place an x (no spaces - [x]) in all [ ] that apply.
|
||||
-->
|
||||
<!-- Please make sure your issue has not already been fixed. -->
|
||||
|
||||
## Documentation
|
||||
|
||||
|
6
.github/ISSUE_TEMPLATE/IMPROVEMENT.md
vendored
6
.github/ISSUE_TEMPLATE/IMPROVEMENT.md
vendored
@ -5,11 +5,7 @@ title: '[Improvement]'
|
||||
labels: 'improvement'
|
||||
---
|
||||
|
||||
<!--
|
||||
Please make sure your issue has not already been fixed.
|
||||
|
||||
Please place an x (no spaces - [x]) in all [ ] that apply.
|
||||
-->
|
||||
<!-- Please make sure your issue has not already been fixed. -->
|
||||
|
||||
## Type of Improvement
|
||||
|
||||
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -3,9 +3,7 @@
|
||||
Please first discuss the change you wish to make via issue before making a change. It might avoid a waste of your time.
|
||||
|
||||
Before submitting your contribution, please take a moment to review this document:
|
||||
https://github.com/Thream/socketio-jwt/blob/master/.github/CONTRIBUTING.md
|
||||
|
||||
Please place an x (no spaces - [x]) in all [ ] that apply.
|
||||
https://github.com/Thream/socketio-jwt/blob/master/CONTRIBUTING.md
|
||||
|
||||
-->
|
||||
|
||||
|
6
.github/workflows/nodejs.yml
vendored
6
.github/workflows/nodejs.yml
vendored
@ -27,11 +27,11 @@ jobs:
|
||||
- name: 'Cache dependencies'
|
||||
uses: 'actions/cache@v2.1.4'
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
|
||||
path: '.npm'
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- name: 'Install dependencies'
|
||||
run: 'npm install'
|
||||
run: 'npm ci --cache .npm --prefer-offline'
|
||||
|
||||
- name: 'Lint'
|
||||
run: 'npm run lint'
|
||||
|
26
.github/workflows/npm-publish.yml
vendored
26
.github/workflows/npm-publish.yml
vendored
@ -12,19 +12,25 @@ jobs:
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2'
|
||||
|
||||
- name: 'Cache dependencies'
|
||||
uses: 'actions/cache@v2.1.4'
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
|
||||
|
||||
- uses: 'actions/setup-node@v2.1.5'
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: 'actions/setup-node@v2.1.5'
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
|
||||
- run: 'npm install'
|
||||
- run: 'npm run build'
|
||||
- run: 'npm publish --access public'
|
||||
- name: 'Cache dependencies'
|
||||
uses: 'actions/cache@v2.1.4'
|
||||
with:
|
||||
path: '.npm'
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- name: 'Install dependencies'
|
||||
run: 'npm ci --cache .npm --prefer-offline'
|
||||
|
||||
- name: 'Build'
|
||||
run: 'npm run build'
|
||||
|
||||
- name: 'Publish package on npm'
|
||||
run: 'npm publish --access public'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -2,9 +2,7 @@
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
.pnp.js
|
||||
.yarn
|
||||
.npm
|
||||
|
||||
# production
|
||||
build
|
||||
@ -12,19 +10,8 @@ build
|
||||
# testing
|
||||
coverage
|
||||
|
||||
# envs
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# lockfiles
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
# editors
|
||||
.vscode
|
||||
|
@ -97,7 +97,6 @@ const io = new Server(9000)
|
||||
io.use(
|
||||
authorize({
|
||||
secret: 'your secret or public key',
|
||||
algorithms: ['RS256'],
|
||||
onAuthentication: async decodedToken => {
|
||||
// return the object that you want to add to the user property
|
||||
// or throw an error if the token is unauthorized
|
||||
@ -118,7 +117,7 @@ io.on('connection', async (socket) => {
|
||||
|
||||
- `secret` is a string containing the secret for HMAC algorithms, or a function that should fetch the secret or public key as shown in the example with `jwks-rsa`.
|
||||
- `algorithms` (default: `HS256`)
|
||||
- `onAuthentication` is a function that will be called with the decodedToken as a parameter after the token is authenticated. Return a value to add to the `user` property in the socket object.
|
||||
- `onAuthentication` is a function that will be called with the `decodedToken` as a parameter after the token is authenticated. Return a value to add to the `user` property in the socket object.
|
||||
|
||||
### Client side
|
||||
|
||||
@ -147,7 +146,7 @@ socket.on('messages', (data) => {
|
||||
|
||||
Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.
|
||||
|
||||
The steps to contribute can be found in the [CONTRIBUTING.md](./.github/CONTRIBUTING.md) file.
|
||||
The steps to contribute can be found in the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
|
||||
|
||||
## 📄 License
|
||||
|
||||
|
24804
package-lock.json
generated
Normal file
24804
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -60,23 +60,23 @@
|
||||
"coverageDirectory": "../coverage/"
|
||||
},
|
||||
"ts-standard": {
|
||||
"files": [
|
||||
"./src/**/*.ts"
|
||||
"ignore": [
|
||||
"build",
|
||||
"coverage",
|
||||
"node_modules"
|
||||
],
|
||||
"envs": [
|
||||
"node",
|
||||
"jest"
|
||||
]
|
||||
],
|
||||
"report": "stylish"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf ./build && tsc",
|
||||
"markdownlint": "markdownlint '**/*.md' --dot --ignore node_modules",
|
||||
"lint": "ts-standard | snazzy",
|
||||
"format": "ts-standard --fix | snazzy",
|
||||
"lint": "ts-standard",
|
||||
"release": "release-it",
|
||||
"test": "jest",
|
||||
"test:watchAll": "jest --watchAll",
|
||||
"test:clearCache": "jest --clearCache",
|
||||
"postinstall": "husky install",
|
||||
"prepublishOnly": "pinst --disable",
|
||||
"postpublish": "pinst --enable"
|
||||
@ -105,7 +105,6 @@
|
||||
"release-it": "14.4.1",
|
||||
"rimraf": "3.0.2",
|
||||
"server-destroy": "1.0.1",
|
||||
"snazzy": "9.0.0",
|
||||
"socket.io": "3.1.2",
|
||||
"socket.io-client": "3.1.2",
|
||||
"ts-jest": "26.5.3",
|
||||
|
Loading…
Reference in New Issue
Block a user