Skip to content

Release 5.0.0 #194

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

Merged
merged 65 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9b68723
relase(pre): 5.0.0-rc.0
jankapunkt Jun 22, 2023
8dd11fe
fix(pkce): get code_challenge and _method from query if not present i…
jankapunkt Jul 10, 2023
cc643fe
fix(pkce): get code_challenge and _method from query if not present i…
jankapunkt Jul 12, 2023
69cdd2c
Fix generateAuthorizationCode not being awaited
MaximilianGaedig Aug 2, 2023
f198623
Update authorization_code test
MaximilianGaedig Aug 2, 2023
47916a7
fix: await generateAuthorizationCode in authorize-handler
jankapunkt Aug 2, 2023
f869d39
fix(ci): install oauth2-server from current ref in actions
jankapunkt Aug 2, 2023
35a02b9
Merge pull request #205 from node-oauth/fix-ci-release-tests
jankapunkt Aug 2, 2023
aeffa48
docs: update changelog
jankapunkt Aug 2, 2023
7ebf3aa
types: update supported version to 5.0.0
jankapunkt Aug 2, 2023
471af88
release: 5.0.0-rc.1
jankapunkt Aug 2, 2023
3bffe8b
Removed callback support in typings.
shrihari-prakash Aug 4, 2023
6cfb8f0
Merge pull request #211 from shrihari-prakash/release-5.0.0
jankapunkt Aug 4, 2023
f6db51a
Fixed getUserFromClient not awaited.
shrihari-prakash Aug 15, 2023
fc8f4dc
Merge branch 'node-oauth:release-5.0.0' into release-5.0.0
shrihari-prakash Aug 15, 2023
bfc4e8f
Added tests.
shrihari-prakash Aug 15, 2023
204aa1d
Merge branch 'release-5.0.0' of https://github.com/node-oauth/node-oa…
shrihari-prakash Aug 15, 2023
76c1c62
Merge branch 'release-5.0.0' of https://github.com/shrihari-prakash/n…
shrihari-prakash Aug 15, 2023
c299425
fix: await getUserFromClient in client credentials grant
jankapunkt Aug 15, 2023
c6682a6
publish 5.0.0-rc.2
jankapunkt Aug 15, 2023
704d917
tests(compliance): added client credential workflow compliance tests
jankapunkt Aug 17, 2023
f0259db
tests(integration): grant types integration tests model integration c…
jankapunkt Aug 17, 2023
9bf64c4
tests(integration): deep cover refresh-token grant type
jankapunkt Aug 22, 2023
92cc613
tests(integration): deep cover authenticte handler
jankapunkt Aug 22, 2023
323c91b
tests(unit): improve coverage for TokenModel
jankapunkt Aug 22, 2023
fde0915
tests(unit): improve coverage for crypto util
jankapunkt Aug 22, 2023
c0593ef
tests(integration): deep-cover model integration in AuthorizeHandler …
jankapunkt Aug 22, 2023
c1fb9d4
tests: add deep integration tests (part I)
jankapunkt Aug 26, 2023
6758bff
Merge branch 'development' into release-5.0.0
jankapunkt Aug 29, 2023
028e020
update minimum nodejs version in release test workflow
jorenvandeweyer Aug 29, 2023
a42dc06
rewrote the scope validation
jorenvandeweyer Sep 9, 2023
2221751
removed callbacks from docs
jorenvandeweyer Sep 9, 2023
716b52e
forgot a single scope
jorenvandeweyer Sep 10, 2023
3e30107
release 5.0.0-rc,3
jankapunkt Sep 18, 2023
9c8c05b
Merge branch 'development' into release-5.0.0
jankapunkt Sep 18, 2023
45eb687
Merge branch 'release-5.0.0' into feature/scope-validation
jankapunkt Sep 27, 2023
8ce21a4
Merge branch 'feature/scope-validation' of github.com:jorenvandeweyer…
jorenvandeweyer Sep 27, 2023
0d4e5f3
added extra test for coverage
jorenvandeweyer Sep 27, 2023
d50cb2d
fix: use array scope and do not ignore scope on refresh token call
jankapunkt Sep 28, 2023
ed1f8a3
Merge branch 'development' into release-5.0.0
jankapunkt Sep 28, 2023
6d7a990
remove invalid bearer token that was used in test
jorenvandeweyer Sep 28, 2023
85d0a79
Merge pull request #243 from jorenvandeweyer/bugfix/invalid-bearer
jankapunkt Sep 28, 2023
1c40926
publish 5.0.0-rc.4
jankapunkt Sep 29, 2023
da3dc54
fix typing of revokeToken
jorenvandeweyer Oct 7, 2023
782af2a
Merge pull request #247 from jorenvandeweyer/bugfix/revoke-token-typing
jankapunkt Oct 8, 2023
d41585b
pass client to model function
jorenvandeweyer Oct 25, 2023
d012193
fixed typo
jorenvandeweyer Oct 26, 2023
b97f6c7
Merge pull request #256 from jorenvandeweyer/feature/pass-client-to-g…
jankapunkt Oct 26, 2023
ca43d4a
fix(pkce): get code challenge and method from either body or query (r…
jankapunkt Nov 1, 2023
eb9f123
build: publish release 5.0.0-rc.5
jankapunkt Nov 1, 2023
7e2abee
docs: add readthedocs v2 config file
jankapunkt Nov 6, 2023
f3e2438
docs: sphinx conf updated to v2 compatible
jankapunkt Nov 6, 2023
6d27e3f
docs: merged master docs into 5.0.0
jankapunkt Nov 6, 2023
1da9837
docs: add migrating to v5 topic
jankapunkt Nov 6, 2023
ff8cdad
docs: add missing adapters and getting started guide
jankapunkt Nov 6, 2023
f06f2fd
docs: update sphinx conf and index toc
jankapunkt Nov 6, 2023
7f18e08
docs: use requirements files to install themes and plugins
jankapunkt Nov 6, 2023
da9ce1a
docs: update rtd config
jankapunkt Nov 6, 2023
3991a8c
docs: remove requirements
jankapunkt Nov 6, 2023
72f3675
docs: remove build using requirements files
jankapunkt Nov 6, 2023
fb59e30
docs: add multiple documentation links
jankapunkt Nov 6, 2023
937d9a7
docs: fix table of contents
jankapunkt Nov 6, 2023
a4f2145
docs: add sphinx rtd theme
jankapunkt Nov 6, 2023
1858669
docs: install sphinx theme with python
jankapunkt Nov 6, 2023
a7a1b25
published release 5.0.0
jankapunkt Nov 6, 2023
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
157 changes: 78 additions & 79 deletions .github/workflows/tests-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
branches:
- release-* # all release-<version> branches


jobs:
# STEP 1 - NPM Audit

Expand All @@ -23,13 +22,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
# install to create local package-lock.json but don't cache the files
# also: no audit for dev dependencies
- run: npm i --package-lock-only && npm audit --production
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
# install to create local package-lock.json but don't cache the files
# also: no audit for dev dependencies
- run: npm i --package-lock-only && npm audit --production

# STEP 2 - basic unit tests

Expand All @@ -40,34 +39,34 @@ jobs:
needs: [audit]
strategy:
matrix:
node: [14, 16, 18]
node: [16, 18, 20]
steps:
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}
# for this workflow we also require npm audit to pass
- run: npm i
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: VeryGoodOpenSource/[email protected]
with:
path: './coverage/lcov.info'
min_coverage: 95
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}
# for this workflow we also require npm audit to pass
- run: npm i
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: VeryGoodOpenSource/[email protected]
with:
path: './coverage/lcov.info'
min_coverage: 95

# STEP 3 - Integration tests

Expand All @@ -80,41 +79,41 @@ jobs:
needs: [unittest]
strategy:
matrix:
node: [14, 16, 18] # TODO get running for node 16+
node: [16, 18, 20] # TODO get running for node 16+
steps:
# checkout this repo
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3

# checkout express-adapter repo
- name: Checkout express-adapter ${{ matrix.node }}
uses: actions/checkout@v3
with:
repository: node-oauth/express-oauth-server
path: github/testing/express

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server-${{ hashFiles('github/testing/express/**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server

# in order to test the adapter we need to use the current checkout
# and install it as local dependency
# we just cloned and install it as local dependency
# xxx: added bluebird as explicit dependency
- run: |
cd github/testing/express
npm i
npm install ../../../
npm run test
# checkout this repo
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3

# checkout express-adapter repo
- name: Checkout express-adapter ${{ matrix.node }}
uses: actions/checkout@v3
with:
repository: node-oauth/express-oauth-server
path: github/testing/express

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server-${{ hashFiles('github/testing/express/**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server

# in order to test the adapter we need to use the current checkout
# and install it as local dependency
# we just cloned and install it as local dependency
# xxx: added bluebird as explicit dependency
- run: |
cd github/testing/express
npm i
npm install https://github.com/node-oauth/node-oauth2-server.git#${{ github.ref_name }}
npm run test

# todo repeat with other adapters

Expand All @@ -139,13 +138,13 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
# we always publish targeting the lowest supported node version
node-version: 16
registry-url: $registry-url(npm)
- run: npm i
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
# we always publish targeting the lowest supported node version
node-version: 16
registry-url: $registry-url(npm)
- run: npm i
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
22 changes: 22 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

## 5.0.0

This release contains several breaking changes.
Please carefully consult the documentation while updating.

- removed `bluebird` and `promisify-any`
- uses native Promises and `async/await` everywhere
- drop support for Node 14 (EOL), setting Node 16 as `engine` in `package.json`
- this is a breaking change, because **it removes callback support** for
`OAuthServer` and your model implementation.
- fixed missing await in calling generateAuthorizationCode in AuthorizeHandler
- fix scope validation bug
- revoke code before validating redirect URI
- improved Bearer token validation
- validate scope as an array of strings (breaking change)
- model support for retrieving user based on client
- more tests added; test coverage improved

## 4.2.0
### Fixed
Expand Down Expand Up @@ -51,7 +61,7 @@
- Upgrades all code from ES5 to ES6, where possible.

## 4.1.0
### Changed
### Changed
* Bump dev dependencies to resolve vulnerabilities
* Replaced jshint with eslint along with should and chai
* Use sha256 when generating tokens
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ If you're using one of those frameworks it is strongly recommended to use the re
## Features

- Supports `authorization_code`, `client_credentials`, `refresh_token` and `password` grant, as well as *extension grants*, with scopes.
- Can be used with *promises*, *Node-style callbacks*, *ES6 generators* and *async*/*await* (using [Babel](https://babeljs.io)).
- Can be used with *promises*, *ES6 generators* and *async*/*await* (using [Babel](https://babeljs.io)).
- Fully [RFC 6749](https://tools.ietf.org/html/rfc6749.html) and [RFC 6750](https://tools.ietf.org/html/rfc6750.html) compliant.
- Implicitly supports any form of storage, e.g. *PostgreSQL*, *MySQL*, *MongoDB*, *Redis*, etc.
- Support for PKCE
- Complete [test suite](https://github.com/node-oauth/node-oauth2-server/tree/master/test).

## Documentation

[Documentation](https://node-oauthoauth2-server.readthedocs.io/en/latest/) is hosted on Read the Docs.
Documentation is hosted on Read the Docs. We have multiple versions of the docs available:

- [stable](https://node-oauthoauth2-server.readthedocs.io/en/master/) (master branch)
- [development](https://node-oauthoauth2-server.readthedocs.io/en/development/) (development branch)

Please leave an issue if something is confusing or missing in the docs.

## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/access-denied-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The resource owner or authorization server denied the request. See :rfc:`Section

::

const AccessDeniedError = require('oauth2-server/lib/errors/access-denied-error');
const AccessDeniedError = require('@node-oauth/oauth2-server/lib/errors/access-denied-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/insufficient-scope-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The request requires higher privileges than provided by the access token. See :r

::

const InsufficientScopeError = require('oauth2-server/lib/errors/insufficient-scope-error');
const InsufficientScopeError = require('@node-oauth/oauth2-server/lib/errors/insufficient-scope-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-argument-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An invalid argument was encountered.

::

const InvalidArgumentError = require('oauth2-server/lib/errors/invalid-argument-error');
const InvalidArgumentError = require('@node-oauth/oauth2-server/lib/errors/invalid-argument-error');

.. note:: This error indicates that the module is used incorrectly (i.e., there is a programming error) and should never be seen because of external errors (like invalid data sent by a client).

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-client-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Client authentication failed (e.g., unknown client, no client authentication inc

::

const InvalidClientError = require('oauth2-server/lib/errors/invalid-client-error');
const InvalidClientError = require('@node-oauth/oauth2-server/lib/errors/invalid-client-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-grant-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The provided authorization grant (e.g., authorization code, resource owner crede

::

const InvalidGrantError = require('oauth2-server/lib/errors/invalid-grant-error');
const InvalidGrantError = require('@node-oauth/oauth2-server/lib/errors/invalid-grant-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-request-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The request is missing a required parameter, includes an invalid parameter value

::

const InvalidRequestError = require('oauth2-server/lib/errors/invalid-request-error');
const InvalidRequestError = require('@node-oauth/oauth2-server/lib/errors/invalid-request-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-scope-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The requested scope is invalid, unknown, or malformed. See :rfc:`Section 4.1.2.1

::

const InvalidScopeError = require('oauth2-server/lib/errors/invalid-scope-error');
const InvalidScopeError = require('@node-oauth/oauth2-server/lib/errors/invalid-scope-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/invalid-token-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The access token provided is expired, revoked, malformed, or invalid for other r

::

const InvalidTokenError = require('oauth2-server/lib/errors/invalid-token-error');
const InvalidTokenError = require('@node-oauth/oauth2-server/lib/errors/invalid-token-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/oauth-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Base class for all errors returned by this module.

::

const OAuthError = require('oauth2-server/lib/errors/oauth-error');
const OAuthError = require('@node-oauth/oauth2-server/lib/errors/oauth-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/server-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The authorization server encountered an unexpected condition that prevented it f

::

const ServerError = require('oauth2-server/lib/errors/server-error');
const ServerError = require('@node-oauth/oauth2-server/lib/errors/server-error');

``ServerError`` is used to wrap unknown exceptions encountered during request processing.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/unauthorized-client-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The authenticated client is not authorized to use this authorization grant type.

::

const UnauthorizedClientError = require('oauth2-server/lib/errors/unauthorized-client-error');
const UnauthorizedClientError = require('@node-oauth/oauth2-server/lib/errors/unauthorized-client-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/unauthorized-request-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The request lacked any authentication information or the client attempted to use

::

const UnauthorizedRequestError = require('oauth2-server/lib/errors/unauthorized-request-error');
const UnauthorizedRequestError = require('@node-oauth/oauth2-server/lib/errors/unauthorized-request-error');

According to :rfc:`Section 3.1 of RFC 6750 <6750#section-3.1>` you should just fail the request with ``401 Unauthorized`` and not send any error information in the body if this error occurs:

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/unsupported-grant-type-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The authorization grant type is not supported by the authorization server. See :

::

const UnsupportedGrantTypeError = require('oauth2-server/lib/errors/unsupported-grant-type-error');
const UnsupportedGrantTypeError = require('@node-oauth/oauth2-server/lib/errors/unsupported-grant-type-error');

--------

Expand Down
2 changes: 1 addition & 1 deletion docs/api/errors/unsupported-response-type-error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The authorization server does not supported obtaining an authorization code usin

::

const UnsupportedResponseTypeError = require('oauth2-server/lib/errors/unsupported-response-type-error');
const UnsupportedResponseTypeError = require('@node-oauth/oauth2-server/lib/errors/unsupported-response-type-error');

--------

Expand Down
Loading