Skip to content

Commit deb11f2

Browse files
authored
Merge pull request #22 from node-oauth/migrate-es-6
4.0.0 - Migrate to async/await
2 parents c58132f + fe5ec7c commit deb11f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+16477
-2392
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github
2+
.nyc_output
3+
coverage
4+
docs
5+
node_modules

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"extends": "eslint:recommended",
3+
"root": true,
34
"env": {
45
"node": true,
56
"mocha": true,
6-
"es6": false
7+
"es6": true
78
},
89
"parserOptions": {
9-
"ecmaVersion": 9,
10+
"ecmaVersion": "latest",
1011
"sourceType": "module",
1112
"ecmaFeatures" : {
1213
"globalReturn": false,

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
restore-keys: |
3535
${{ runner.os }}-node-${{ matrix.node }}
3636
- run: npm ci
37+
- run: npm run lint
3738
- run: npm run test:coverage
39+
- run: npm run build:docs
3840

3941
# with the following action we enforce PRs to have a high coverage
4042
# and ensure, changes are tested well enough so that coverage won't fail

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 4.0.0
4+
5+
- bump minimal node to 16
6+
- upgrade @node-oauth/oauth2-server to 5.1.0
7+
- drop bluebird dependency
8+
- upgrade all deps / dev-deps
9+
- refactor all code to minimum es6
10+
- use native async/await
11+
12+
313
## 3.0.0
414
- use @node-oauth/oauth2-server
515
- update all dependencies to latest

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 - Today Seegno and contributors
3+
Copyright (c) 2015 - Today Node-OAuth contributors; Formerly: Seegno and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Complete, compliant and well tested module for implementing an OAuth2 Server/Pro
44

55
[![Tests](https://github.com/node-oauth/express-oauth-server/actions/workflows/tests.yml/badge.svg)](https://github.com/node-oauth/express-oauth-server/actions/workflows/tests.yml)
66
[![CodeQL](https://github.com/node-oauth/express-oauth-server/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/node-oauth/express-oauth-server/actions/workflows/github-code-scanning/codeql)
7+
[![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)
8+
[![npm Version](https://img.shields.io/npm/v/@node-oauth/express-oauth-server?label=version)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
9+
[![npm Downloads/Week](https://img.shields.io/npm/dw/@node-oauth/express-oauth-server)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
710
![GitHub](https://img.shields.io/github/license/node-oauth/express-oauth-server)
811

912

@@ -24,11 +27,11 @@ expect the request body to be parsed already.
2427
The following example uses `body-parser` but you may opt for an alternative library.
2528

2629
```js
27-
var bodyParser = require('body-parser');
28-
var express = require('express');
29-
var OAuthServer = require('@node-oauth/express-oauth-server');
30+
const bodyParser = require('body-parser');
31+
const express = require('express');
32+
const OAuthServer = require('@node-oauth/express-oauth-server');
3033

31-
var app = express();
34+
const app = express();
3235

3336
app.oauth = new OAuthServer({
3437
model: {}, // See https://github.com/node-oauth/node-oauth2-server for specification
@@ -45,21 +48,31 @@ app.use(function(req, res) {
4548
app.listen(3000);
4649
```
4750

51+
## More Examples
52+
53+
For more examples, please visit [our dedicated "examples" repo](https://github.com/node-oauth/node-oauth2-server-examples)
54+
, which also contains express examples.
55+
4856
## Options
4957

58+
> Note: The following options **extend** the default options from `@node-oauth/oauth2-sever`!
59+
> You can read more about all possible options in the
60+
> [@node-oauth/oauth2-sever documentation](https://node-oauthoauth2-server.readthedocs.io/en/master/api/oauth2-server.html)
61+
5062
```
51-
var options = {
63+
const options = {
5264
useErrorHandler: false,
5365
continueMiddleware: false,
5466
}
5567
```
56-
* `useErrorHandler`
68+
69+
- `useErrorHandler`
5770
(_type: boolean_ default: false)
5871

5972
If false, an error response will be rendered by this component.
6073
Set this value to true to allow your own express error handler to handle the error.
6174

62-
* `continueMiddleware`
75+
- `continueMiddleware`
6376
(_type: boolean default: false_)
6477

6578
The `authorize()` and `token()` middlewares will both render their
@@ -69,3 +82,7 @@ var options = {
6982
**Note:** You cannot modify the response since the headers have already been sent.
7083

7184
`authenticate()` does not modify the response and will always call next()
85+
86+
## License
87+
88+
MIT, see

0 commit comments

Comments
 (0)