Skip to content

Commit c2a8b11

Browse files
authored
Merge pull request #7 from node-oauth/3.0.0
Update deps and use @node-oauth/oauth2-server
2 parents 519b939 + 986ffb0 commit c2a8b11

19 files changed

+2846
-778
lines changed

.eslintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"env": {
4+
"node": true,
5+
"mocha": true,
6+
"es6": false
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 9,
10+
"sourceType": "module",
11+
"ecmaFeatures" : {
12+
"globalReturn": false,
13+
"impliedStrict": true,
14+
"jsx": false
15+
}
16+
}
17+
}
18+

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
node: [14, 16, 18]
2020
steps:
2121
- name: Checkout ${{ matrix.node }}
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323

2424
- name: Setup node ${{ matrix.node }}
2525
uses: actions/setup-node@v3
@@ -33,7 +33,7 @@ jobs:
3333
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
3434
restore-keys: |
3535
${{ runner.os }}-node-${{ matrix.node }}
36-
- run: npm i
36+
- run: npm ci
3737
- run: npm run test:coverage
3838

3939
# with the following action we enforce PRs to have a high coverage

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
11
node_modules/
2+
docs/_build/
3+
__pycache__/
4+
*.pyc
5+
lib-cov
6+
*.seed
7+
*.log
8+
*.csv
9+
*.dat
10+
*.out
11+
*.pid
12+
*.gz
13+
*.iml
14+
15+
.idea
16+
.jshint
17+
.DS_Store
18+
19+
pids
20+
logs
21+
results
22+
23+
lib/dockerImage/keys
24+
coverage
25+
npm-debug.log*~
26+
\#*\#
27+
/.emacs.desktop
28+
/.emacs.desktop.lock
29+
.elc
30+
auto-save-list
31+
tramp
32+
.\#*
33+
.vscode
34+
35+
# Org-mode
36+
.org-id-locations
37+
*_archive
38+
39+
# coverage
40+
.nyc_output
41+
42+
package-lock.json
43+
yarn.lock

.jshintignore

-1
This file was deleted.

.jshintrc

-29
This file was deleted.

.mocharc.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
recursive: true
22
reporter: "spec"
3-
retries: 1
3+
retries: 0
44
slow: 20
55
timeout: 2000
66
ui: "bdd"
7-
require: test/assertions
7+
exit: true
8+
# require: test/assertions
89
# for more options see here https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml

.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test/
2+
examples/
3+
package-lock.json
4+
yarn.lock

.travis.yml

-13
This file was deleted.

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 3.0.0
4+
- use @node-oauth/oauth2-server
5+
- update all dependencies to latest
6+
- add code coverage to tests
7+
- add GitHub actions CI
8+
- replace jshint with eslint
9+
10+
---
11+
These previous versions are from the forked `oauthjs` org.
12+
We did not publish them are related in any way to these publications.
13+
314
## 2.0.0
415
* Refactor for v3.0.0 of node-oauth2-server
516

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Seegno
3+
Copyright (c) 2015 - Today 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 renamed to README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
# Express OAuth Server [![Build Status](https://travis-ci.org/oauthjs/express-oauth-server.png?branch=master)](https://travis-ci.org/oauthjs/express-oauth-server)
1+
# Express OAuth Server
22

33
Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with [express](https://github.com/expressjs/express) in [node.js](http://nodejs.org/).
44

5-
This is the express wrapper for [oauth2-server](https://github.com/oauthjs/node-oauth2-server).
5+
[![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)
6+
[![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+
![GitHub](https://img.shields.io/github/license/node-oauth/express-oauth-server)
8+
9+
10+
This is the express wrapper for [@node-oauth/oauth2-server](https://github.com/node-oauth/node-oauth2-server),
11+
it's a fork from the former [oauthjs/express-oauth-server](https://github.com/oauthjs/express-oauth-server).
612

713
## Installation
814

9-
$ npm install express-oauth-server
15+
```shell
16+
$ npm install @node-oauth/express-oauth-server
17+
```
1018

1119
## Quick Start
1220

13-
The module provides two middlewares - one for granting tokens and another to authorize them. `express-oauth-server` and, consequently `oauth2-server`, expect the request body to be parsed already.
21+
The module provides two middlewares - one for granting tokens and another to authorize them.
22+
`@node-oauth/express-oauth-server` and, consequently `@node-oauth/oauth2-server`,
23+
expect the request body to be parsed already.
1424
The following example uses `body-parser` but you may opt for an alternative library.
1525

1626
```js
1727
var bodyParser = require('body-parser');
1828
var express = require('express');
19-
var OAuthServer = require('express-oauth-server');
29+
var OAuthServer = require('@node-oauth/express-oauth-server');
2030

2131
var app = express();
2232

2333
app.oauth = new OAuthServer({
24-
model: {}, // See https://github.com/oauthjs/node-oauth2-server for specification
34+
model: {}, // See https://github.com/node-oauth/node-oauth2-server for specification
2535
});
2636

2737
app.use(bodyParser.json());

examples/mongodb/model.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global Promise */
12

23
/**
34
* Module dependencies.

examples/postgresql/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
var bodyParser = require('body-parser');
77
var express = require('express');
8-
var oauthServer = require('express-oauth-server');
8+
var oauthServer = require('@node-oauth/express-oauth-server');
99
var render = require('co-views')('views');
1010
var util = require('util');
1111

examples/postgresql/model.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/* eslint-disable require-yield */
12

2-
/**
3+
/**
34
* Module dependencies.
45
*/
56

@@ -82,3 +83,5 @@ module.exports.saveAccessToken = function *(token, client, user) {
8283
return result.rowCount ? result.rows[0] : false; // TODO return object with client: {id: clientId} and user: {id: userId} defined
8384
});
8485
};
86+
87+
/* eslint-enable require-yield */

examples/redis/model.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global Promise */
12

23
/**
34
* Module dependencies.

0 commit comments

Comments
 (0)