Skip to content

Commit aa386b8

Browse files
authored
Merge pull request #184 from node-oauth/development
Merge dev into master
2 parents b5b89c9 + 0e3cfe0 commit aa386b8

File tree

5 files changed

+90
-23
lines changed

5 files changed

+90
-23
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
- jankapunkt
5+
patreon: # Replace with a single Patreon username
6+
open_collective: # Replace with a single Open Collective username
7+
ko_fi: # Replace with a single Ko-fi username
8+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
9+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
10+
liberapay: # Replace with a single Liberapay username
11+
issuehunt: # Replace with a single IssueHunt username
12+
otechie: # Replace with a single Otechie username
13+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
14+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
15+
- https://paypal.me/kuesterjan

.github/workflows/tests-release.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v3
2727
- uses: actions/setup-node@v3
2828
with:
29-
node-version: '14'
29+
node-version: 20
3030
# install to create local package-lock.json but don't cache the files
3131
# also: no audit for dev dependencies
3232
- run: npm i --package-lock-only && npm audit --production
@@ -50,6 +50,13 @@ jobs:
5050
with:
5151
node-version: ${{ matrix.node }}
5252

53+
- name: Cache dependencies ${{ matrix.node }}
54+
uses: actions/cache@v3
55+
with:
56+
path: ~/.npm
57+
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
58+
restore-keys: |
59+
${{ runner.os }}-node-${{ matrix.node }}
5360
# for this workflow we also require npm audit to pass
5461
- run: npm i
5562
- run: npm run test:coverage
@@ -73,7 +80,7 @@ jobs:
7380
needs: [unittest]
7481
strategy:
7582
matrix:
76-
node: [14] # TODO get running for node 16 once we removed bluebird dependency
83+
node: [14, 16, 18] # TODO get running for node 16+
7784
steps:
7885
# checkout this repo
7986
- name: Checkout ${{ matrix.node }}
@@ -91,6 +98,14 @@ jobs:
9198
with:
9299
node-version: ${{ matrix.node }}
93100

101+
- name: Cache dependencies ${{ matrix.node }}
102+
uses: actions/cache@v3
103+
with:
104+
path: ~/.npm
105+
key: ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server-${{ hashFiles('github/testing/express/**/package-lock.json') }}
106+
restore-keys: |
107+
${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server
108+
94109
# in order to test the adapter we need to use the current checkout
95110
# and install it as local dependency
96111
# we just cloned and install it as local dependency
@@ -110,7 +125,7 @@ jobs:
110125
- uses: actions/checkout@v3
111126
- uses: actions/setup-node@v3
112127
with:
113-
node-version: 14
128+
node-version: 16
114129
registry-url: https://registry.npmjs.org/
115130
- run: npm i
116131
- run: npm publish --dry-run
@@ -128,7 +143,7 @@ jobs:
128143
- uses: actions/setup-node@v3
129144
with:
130145
# we always publish targeting the lowest supported node version
131-
node-version: 14
146+
node-version: 16
132147
registry-url: $registry-url(npm)
133148
- run: npm i
134149
- run: npm publish --dry-run

.github/workflows/tests.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,46 @@ on:
1313
- release-* # on release we run an extended workflow so no need for this
1414

1515
jobs:
16+
lint:
17+
name: Javascript standard lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v3
22+
23+
- name: setup node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 20
27+
28+
- name: cache dependencies
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.npm
32+
key: ${{ runner.os }}-node-16-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-
35+
- run: npm install
36+
- run: npm run lint
37+
1638
unittest:
1739
name: unit tests
1840
runs-on: ubuntu-latest
41+
needs: [lint]
1942
strategy:
2043
matrix:
21-
node: [14, 16, 18]
44+
node: [16, 18, 20]
2245
steps:
2346
- name: Checkout ${{ matrix.node }}
24-
uses: actions/checkout@v2
47+
uses: actions/checkout@v3
2548

2649
- name: Setup node ${{ matrix.node }}
27-
uses: actions/setup-node@v1
50+
uses: actions/setup-node@v3
2851
with:
2952
node-version: ${{ matrix.node }}
3053

3154
- name: Cache dependencies ${{ matrix.node }}
32-
uses: actions/cache@v1
55+
uses: actions/cache@v3
3356
with:
3457
path: ~/.npm
3558
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33

44
Complete, compliant and well tested module for implementing an OAuth2 server in [Node.js](https://nodejs.org).
55

6+
[![Tests](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml)
7+
[![CodeQL Semantic Analysis](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml)
8+
[![Tests for Release](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml)
9+
[![Documentation Status](https://readthedocs.org/projects/node-oauthoauth2-server/badge/?version=latest)](https://node-oauthoauth2-server.readthedocs.io/en/latest/?badge=latest)
10+
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
11+
![npm Version](https://img.shields.io/npm/v/@node-oauth/oauth2-server?label=version)
12+
![npm Downloads/Week](https://img.shields.io/npm/dw/@node-oauth/oauth2-server)
13+
![GitHub License](https://img.shields.io/github/license/node-oauth/node-oauth2-server)
14+
615
NOTE: This project has been forked from [oauthjs/node-oauth2-server](https://github.com/oauthjs/node-oauth2-server) and is a continuation due to the project appearing to be abandoned. Please see [our issue board](https://github.com/node-oauth/node-oauth2-server/issues) to talk about next steps and the future of this project.
716

817
## Installation
@@ -11,7 +20,8 @@ NOTE: This project has been forked from [oauthjs/node-oauth2-server](https://git
1120
npm install @node-oauth/oauth2-server
1221
```
1322

14-
The *@node-oauth/oauth2-server* module is framework-agnostic but there are several officially supported wrappers available for popular HTTP server frameworks such as [Express](https://npmjs.org/package/express-oauth-server) and [Koa](https://npmjs.org/package/koa-oauth-server). If you're using one of those frameworks it is strongly recommended to use the respective wrapper module instead of rolling your own.
23+
The `@node-oauth/oauth2-server` module is framework-agnostic but there are several officially supported wrappers available for popular HTTP server frameworks such as [Express](https://www.npmjs.com/package/@node-oauth/express-oauth-server) and [Koa (not maintained by us)](https://npmjs.org/package/koa-oauth-server).
24+
If you're using one of those frameworks it is strongly recommended to use the respective wrapper module instead of rolling your own.
1525

1626

1727
## Features
@@ -20,25 +30,28 @@ The *@node-oauth/oauth2-server* module is framework-agnostic but there are sever
2030
- Can be used with *promises*, *Node-style callbacks*, *ES6 generators* and *async*/*await* (using [Babel](https://babeljs.io)).
2131
- Fully [RFC 6749](https://tools.ietf.org/html/rfc6749.html) and [RFC 6750](https://tools.ietf.org/html/rfc6750.html) compliant.
2232
- Implicitly supports any form of storage, e.g. *PostgreSQL*, *MySQL*, *MongoDB*, *Redis*, etc.
33+
- Support for PKCE
2334
- Complete [test suite](https://github.com/node-oauth/node-oauth2-server/tree/master/test).
2435

25-
2636
## Documentation
2737

28-
[Documentation](https://oauth2-server.readthedocs.io) is hosted on Read the Docs.
29-
38+
[Documentation](https://node-oauthoauth2-server.readthedocs.io/en/latest/) is hosted on Read the Docs.
39+
Please leave an issue if something is confusing or missing in the docs.
3040

3141
## Examples
3242

33-
Most users should refer to our [Express](https://github.com/oauthjs/express-oauth-server/tree/master/examples) or [Koa](https://github.com/oauthjs/koa-oauth-server/tree/master/examples) examples.
43+
Most users should refer to our [Express (active)](https://github.com/node-oauth/express-oauth-server) or
44+
[Koa (not maintained by us)](https://github.com/oauthjs/koa-oauth-server/tree/master/examples) examples.
3445

3546
More examples can be found here: https://github.com/14gasher/oauth-example
3647

37-
## Upgrading from 2.x
48+
## Migrating from OAuthJs and 3.x
3849

39-
This module has been rewritten using a promise-based approach, introducing changes to the API and model specification. v2.x is no longer supported.
50+
Version 4.x should not be hard-breaking, however, there were many improvements and fixes that may
51+
be incompatible with specific behaviour in <= 3.x
4052

41-
Please refer to our [3.0 migration guide](https://oauth2-server.readthedocs.io/en/latest/misc/migrating-v2-to-v3.html) for more information.
53+
For more info, please read the [changelog](./CHANGELOG.md) or open an issue, if you think something
54+
is unexpectedly not working.
4255

4356
## Supported NodeJs versions
4457

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"Michael Salinger <mjsalinger@gmail.com>",
1515
"Nuno Sousa",
1616
"Max Truxa",
17-
"Daniel Reguero"
17+
"Daniel Reguero",
18+
"Jan Küster <info@jankuester.com>"
1819
],
1920
"main": "index.js",
2021
"types": "index.d.ts",
@@ -24,18 +25,18 @@
2425
"lib"
2526
],
2627
"dependencies": {
27-
"@node-oauth/formats": "^1.0.0",
28+
"@node-oauth/formats": "1.0.0",
2829
"basic-auth": "2.0.1",
2930
"bluebird": "3.7.2",
3031
"promisify-any": "2.0.1",
3132
"type-is": "1.6.18"
3233
},
3334
"devDependencies": {
34-
"chai": "^4.3.4",
35-
"eslint": "^8.0.0",
36-
"mocha": "^10.0.0",
37-
"nyc": "^15.1.0",
38-
"sinon": "^15.0.2"
35+
"chai": "4.3.4",
36+
"eslint": "8.4.1",
37+
"mocha": "9.2.2",
38+
"nyc": "15.1.0",
39+
"sinon": "13.0.1"
3940
},
4041
"license": "MIT",
4142
"engines": {

0 commit comments

Comments
 (0)