Skip to content

[DNM] #5

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

Open
wants to merge 114 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
e66277e
Update README.md
dhritzkiv Aug 14, 2017
d3660f4
Added package-lock.json
Pritilender Sep 6, 2017
92f0a0b
Changed 'hasOwnProperty' call in Request
Pritilender Sep 6, 2017
68ef835
Changed 'hasOwnProperty' call in Response
Pritilender Sep 6, 2017
74a4b14
set numArgs for promisify of generateAuthorizationCode
nkzawa Sep 8, 2017
c680cfc
readme: Update Slack badge and link
maxtruxa Sep 8, 2017
eddcce9
fix: issue correct expiry dates for tokens (#2)
razvanz Sep 25, 2017
ad26a26
Merge pull request #432 from maxtruxa/slackin-readme
maxtruxa Oct 23, 2017
8b5a945
Merge pull request #425 from dhritzkiv/patch-3
maxtruxa Oct 24, 2017
a29ec14
Merge pull request #431 from nkzawa/fix/promisify-num-args
maxtruxa Oct 24, 2017
234847a
Merge pull request #444 from razvanz/master
maxtruxa Oct 24, 2017
ad7c3f2
Revert "Added package-lock.json"
Pritilender Nov 6, 2017
8dd3d39
Added package-lock.json
Pritilender Nov 6, 2017
b9cd14d
Extend model object with request context
Dec 29, 2017
f5fee67
Rectified the link to RFC 6750 paper
nandubatchu Jan 3, 2018
9998bf6
docs: Correct tokens time scale for 2.x to 3.x migration guide
iczechowski Jan 23, 2018
9037614
Compute the correct redirect_uri in case of resource over denies access
iczechowski Jan 23, 2018
af4a581
Merge pull request #430 from Pritilender/master
mjsalinger Jan 24, 2018
70159bd
Merge pull request #454 from Pritilender/package-lock
mjsalinger Jan 24, 2018
cb7a559
Add unit and integration tests
Jan 28, 2018
23214dc
fix: validate requested scope on authorize request (#3)
razvanz Sep 28, 2017
641599f
code review
razvanz Jan 29, 2018
9d721a3
Merge pull request #451 from razvanz/fix/validate-scope-on-authorize
mjsalinger Feb 13, 2018
3d4fa77
Merge pull request #462 from basimhennawi/feature/extend-model-request
mjsalinger Feb 13, 2018
bc7211b
Merge pull request #465 from nandubatchu/master
mjsalinger Feb 13, 2018
c33a2cd
resolve merge conflict
adieuadieu Feb 14, 2018
cbd461b
Minor updates
Mar 10, 2016
4491056
refactor: _.contains --> _.includes
adieuadieu Jan 1, 2018
5c8e37d
refactor: small tweaks to fix tests related to catching response_type…
adieuadieu Jan 1, 2018
43f8eb6
Correct generateAccessToken invocation
fabiancook Jan 14, 2018
63dbb3b
Merge pull request #1 from fabiancook/patch-1
adieuadieu Jan 14, 2018
cb6245d
style: responseType/ResponseType variable naming improvement
adieuadieu Feb 14, 2018
f60b519
test: add unit test for implicit grant type
adieuadieu Feb 14, 2018
a8375bc
fix: callback support on implicit grant type's saveToken model function
adieuadieu Feb 14, 2018
6e006bf
test: add integration test for implicit grant type
adieuadieu Feb 14, 2018
fe9359a
test: add integration test for implicit grant's token response type
adieuadieu Feb 14, 2018
96fcd01
resolve merge conflict
adieuadieu Feb 14, 2018
8a92da7
fix: correct issues from rebase
adieuadieu Feb 14, 2018
5fbb487
docs: add text about implicit grant
adieuadieu Feb 14, 2018
408a0bc
Number of arguments MUST be passed
wspringer Apr 3, 2018
51c8ac2
docs: Ensure accessTokenExpiresAt is required
May 14, 2018
89173de
Merge pull request #491 from mattgrande/master
maxtruxa May 14, 2018
47ddec6
Specify arg count when promisifying generateAuthorizationCode
sgronblo May 15, 2018
0d3d781
Change the server_error code to 500
MartinLoeper Feb 13, 2018
b8ff853
Merge branch 'master' into dev
thomseddon Aug 3, 2018
c39fa21
Merge pull request #472 from MartinLoeper/master
thomseddon Aug 3, 2018
22886f5
Merge pull request #493 from sgronblo/fix-generate-authorization-code…
mjsalinger Aug 7, 2018
2e200d8
Merge pull request #483 from wspringer/master
mjsalinger Aug 7, 2018
d97a674
Merge pull request #464 from adieuadieu/implicit-grant-support
mjsalinger Aug 7, 2018
6d4c1ce
Merge pull request #471 from smartrecruiters/fix-migration-documentaiton
mjsalinger Aug 7, 2018
3fc1f3e
revoke-handler: implementation
visvk Mar 30, 2016
592c809
revoke-handler: revoke accessToken
visvk Aug 18, 2016
2677693
Rebase revoke-handler to oauthjs:dev
visvk Aug 7, 2018
6a61aa5
revoke-handler: throw InvalidClientError if client_id does not match …
visvk Aug 22, 2016
b4d17f6
fix: correct client ID check in refresh_token grant type
Namburgesas Jun 14, 2018
ba13288
Merge pull request #289 from visvk/revoke-handler
mjsalinger Aug 8, 2018
c1c1405
Backported 3.x changelog
mjsalinger Aug 27, 2018
2808bad
Merge pull request #519 from mjsalinger/fix-dependencies
mjsalinger Aug 17, 2018
558e8cf
Switch to eslint
compwright Jul 27, 2018
ff09b2b
Merge pull request #508 from compwright/upgrade-deps
mjsalinger Aug 27, 2018
af6741e
Merge pull request #501 from Namburgesas/dev
mjsalinger Aug 27, 2018
be9a568
Updated changelog
mjsalinger Aug 27, 2018
c6a3137
Bumped to 4.0.0-dev.1
mjsalinger Aug 27, 2018
a950bc9
fix: authorization_code grant should not be required in implicit flow
adieuadieu Aug 28, 2018
653a92b
Revert "fix; correct client ID check in refresh_token grant type"
mjsalinger Aug 29, 2018
c516c16
Merge pull request #524 from oauthjs/revert-501-dev
mjsalinger Sep 5, 2018
4a77277
Merge pull request #522 from adieuadieu/fix/unauthorized_client_when_…
mjsalinger Sep 5, 2018
04eaf5a
Updated changelog
mjsalinger Sep 5, 2018
0154165
Bumped to 4.0.0-dev.2
mjsalinger Sep 5, 2018
45b508a
Updated changelog
mjsalinger Sep 5, 2018
0bff971
rewrite-in-typescript
nkitku Apr 21, 2019
bd988da
added-proposal-for-v5
nkitku Apr 21, 2019
b027643
added-.vscode
nkitku Apr 21, 2019
2cd5e08
teslint-fixes
nkitku Apr 22, 2019
a4f99a1
fixed-gitignore
nkitku Apr 22, 2019
38f9b15
Remove commented code
kiebzak Apr 23, 2019
cac41dd
added-docs
nkitku Apr 23, 2019
8b31697
expose-interfaces
nkitku Apr 24, 2019
8b7d9da
rewriting-test-files
nkitku Apr 27, 2019
de35cc1
fixed-tests
nkitku Apr 30, 2019
28bdd3c
updated-todos-and-file-folder-permissions
nkitku May 10, 2019
c13e9ea
fix-imports
nkitku May 10, 2019
58b08b5
fixing-conflicts
nkitku May 10, 2019
6146cc7
remove-node-6-support
nkitku May 10, 2019
038c90a
updated-codes-and-changelogs
nkitku May 18, 2019
1aa302e
dependencies-updated
nkitku Jun 6, 2019
4600122
updated-dependencies
nkitku Jul 11, 2019
be5d69d
fixed-linting
nkitku Jul 18, 2019
098ed84
added-vsode-settings-file-gitignore
nkitku Jul 23, 2019
737682a
extend-model-object-with-request-in-revoke-handler
nkitku Jul 23, 2019
e4ebd21
fixed-invalid_token-code
nkitku Sep 10, 2019
3a6abf6
fixed-magic-time-constants
nkitku Sep 10, 2019
c2e6a22
request-method-to-upper-case-and-updated-test
nkitku Sep 11, 2019
a29eb1a
updated-ts-version
nkitku Sep 11, 2019
fffd5f9
tsconfig-&-npm-scripts-updated
nkitku Sep 12, 2019
3ebcf71
ignored-message-attr-in-auth-error
nkitku Sep 12, 2019
412a3a6
updated-packages
nkitku Nov 12, 2019
e446c30
updated-packages
nkitku Nov 12, 2019
3366396
listed NodeJS 12 in travis
nkitku Nov 29, 2019
98d1dcb
fixing-for-strict-null-checks
nkitku Nov 30, 2019
b1bab59
moved-required-@types
nkitku Nov 30, 2019
52120fd
enabled-sourcemap
nkitku Dec 5, 2019
ad8b498
Merge pull request #564 from nkitku/v5.0-dev
thomseddon Jan 28, 2020
36275b5
add codecoverage and upgrade packages
Uzlopak Apr 25, 2020
e11930b
Set WWW-Authenticate header for invalid requests
Aug 14, 2020
a7b9e6f
cherry pick
Sep 27, 2020
74a4260
Merge branch 'smartrecruiters-access_denied' into access_denied
Sep 27, 2020
9c9de00
merge
Sep 27, 2020
23ba8e5
Merge branch 'Uzlopak-feature/add-code-coverage' into trunk/patch-1
Sep 27, 2020
57a379a
jhermsmeier-www-authenticate rebase
Sep 27, 2020
df9e5fe
rm lock
Sep 27, 2020
40b63f2
Merge branch 'jhermsmeier-www-authenticate' into trunk/patch-1
Sep 27, 2020
0ec8a52
fix: lint erros
Sep 27, 2020
a199f89
todo
Sep 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
76 changes: 76 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import"],
"extends": [
// Recommended defaults for ESLint:
"eslint:recommended",
// Turn off what's checked by TS compiler:
"plugin:@typescript-eslint/eslint-recommended",
// Turn on recommended TS-specific rules:
"plugin:@typescript-eslint/recommended",
// Turn on extra rules that require type-checking:
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// Turn on rules for imports:
"plugin:import/typescript",
// Turn off rules conflicting with Prettier:
"prettier"
],
"ignorePatterns": ["node_modules", "dist", "coverage"],
"rules": {
// This is already checked by Typescript's "noUnusedLocals" setting
"@typescript-eslint/no-unused-vars": "off",

// No reason to disallow
"@typescript-eslint/no-inferrable-types": "off",

// Optimize code for legibility, not for ease of parsing
"@typescript-eslint/no-use-before-define": "off",

// Allow all interface names
"@typescript-eslint/interface-name-prefix": "off",

// Require type annotations for return types, with some exceptions
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": true
}
],

// Disallow default exports; only allow named exports
"import/no-default-export": "error",

// Impose alphabetically ordered imports
"import/order": "error",

// Standardize usage of array types (`T[]` or `Array<T>`)
"@typescript-eslint/array-type": [
"error",
{ "default": "array-simple", "readonly": "generic" }
],

// Disallow variable names conflicting with deprecated globals
"no-restricted-globals": [
"error",
"event",
"name",
"external",
"orientation"
],

// Disallow use of `console`
"no-console": "error"
}
}
25 changes: 24 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
node_modules/

# IDE
/.idea
/.awcache
/.vscode/*.code-workspace
/.vscode/settings.json

# misc
npm-debug.log

# folders
#/dist
/node_modules
docs/_build/
__pycache__/

# files
.DS_Store
*.pyc
<<<<<<< HEAD
/aio

# codecoverage
/.nyc_output
/coverage
=======
lib-cov
*.seed
*.log
Expand Down Expand Up @@ -34,3 +56,4 @@ tramp
# Org-mode
.org-id-locations
*_archive
>>>>>>> e11930b8c35537b10f965c7390d7fe58622ba0f8
1 change: 0 additions & 1 deletion .jshintignore

This file was deleted.

26 changes: 0 additions & 26 deletions .jshintrc

This file was deleted.

1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

10 changes: 10 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"reporter": [
"lcovonly",
"html",
"text",
"text-summary"
]
}
Empty file added .patch
Empty file.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf"
}
6 changes: 6 additions & 0 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
language: node_js

node_js:
<<<<<<< HEAD
- 8
- 10
- 12
=======
- 4
- 6
- 8
- 10
- 12
- 13
- 14
>>>>>>> e11930b8c35537b10f965c7390d7fe58622ba0f8

sudo: false
22 changes: 22 additions & 0 deletions .vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# VSCode Configuration

This folder contains opt-in [Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings) and [Extension Recommendations](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions) that our team recommends using when working on this repository.

## Usage

To use the recommended settings follow the steps below:

- copy `.vscode/recommended-settings.json` to `.vscode/settings.json`
- restart the editor

If you already have your custom workspace settings you should instead manually merge the file content.

This isn't an automatic process so you will need to repeat it when settings are updated.

To see the recommended extensions select "Extensions: Show Recommended Extensions" in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).

## Editing `.vscode/recommended-settings.json`

If you wish to add extra configuration items please keep in mind any settings you add here will be used by many users.

Try to keep these settings to things that help facilitate the development process and avoid altering the user workflow whenever possible.
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require",
"ts-node/register",
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"--recursive",
"${workspaceFolder}/test/**/*.spec.ts"
],
"internalConsoleOptions": "openOnSessionStart"
}
]
}
39 changes: 39 additions & 0 deletions .vscode/recommended-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"dist": true
},
"files.watcherExclude": {
"**/.git/**": true,
"**/node_modules/**": true,
"**/dist/**": true
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true
},
"editor.formatOnSave": false,
"typescript.format.enable": false,
"editor.formatOnPaste": false,
"[typescript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.tslint": true
}
},
"[json]": {
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.formatOnSave": true
},
"[javascript]": {
"editor.formatOnSave": true
},
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.printWidth": 80
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
## Changelog

<<<<<<< HEAD
### 5.0.0
* BREAKING: Remove support for node v6
* BREAKING: Remove support for callbacks only support native Promises
* new: Rewrote in TypeScript
* new: Switch from Eslint to Tslint
* new: added .vscode folder for recommend extensions and recommend setting required for development
* new: added suitable TypeScript Interfaces for various Objects

### 4.0.0
* BREAKING: Set server_error Code to 500
* BREAKING: Remove support for node v4
* new: Added revoke-handler to revoke access token
* new: Added implicit grant flow
* new: Switch from jshint to eslin
* fix: authorization_code grant should not be required in implicit flowt

### 3.1.0
* new: Added package-lock.json
* new: Extend model object with request context
* new: .npmignore tests
* fix: validate requested scope on authorize request
* fix: issue correct expiry dates for tokens
=======
### 3.1.0
* new: .npmignore tests
* fix: validate requested scope on authorize request
* fix: always issue correct expiry dates for tokens
>>>>>>> e11930b8c35537b10f965c7390d7fe58622ba0f8
* fix: set numArgs for promisify of generateAuthorizationCode
* fix: Changed 'hasOwnProperty' call in Response
* docs: Ensure accessTokenExpiresAt is required
Expand All @@ -12,6 +37,12 @@
* readme: Update Slack badge and link
* readme: Fix link to RFC6750 standard

<<<<<<< HEAD
### 3.0.1
* Updated dependencies

### 3.0.0
=======
### 3.0.2 (24/05/2020)

* Update all dependencies 🎉
Expand All @@ -23,6 +54,7 @@
Tag never released on npm

### 3.0.0 (04/08/2017)
>>>>>>> e11930b8c35537b10f965c7390d7fe58622ba0f8
* Complete re-write, with Promises and callback support
* Dropped support for node v0.8, v0.10, v0.12
* Supports Node v4, v6, v7, and v8. Will continue support for node current and active LTS versions
Expand Down
Empty file modified LICENSE
100644 → 100755
Empty file.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<<<<<<< HEAD
=======

>>>>>>> e11930b8c35537b10f965c7390d7fe58622ba0f8
# oauth2-server

[![npm Version][npm-image]][npm-url]
Expand All @@ -22,7 +25,7 @@ The *oauth2-server* module is framework-agnostic but there are several officiall

## Features

- Supports `authorization_code`, `client_credentials`, `refresh_token` and `password` grant, as well as *extension grants*, with scopes.
- Supports `authorization_code`, `client_credentials`, `refresh_token`, `implicit` 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)).
- 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.
Expand Down
8 changes: 8 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Todo:
✔ Add a todo
✔ A Basic Rewrite of library in TypeScript
✔ A Basic Rewrite of tests in TypeScript
☐ Add examples for nestjs, expressjs, koa and others
☐ Add Migration guide
☐ Review all Docs
10 changes: 10 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from './lib/errors';
export * from './lib/grant-types';
export * from './lib/handlers';
export * from './lib/interfaces';
export { Request } from './lib/request';
export { Response } from './lib/response';
export * from './lib/response-types';
export { OAuth2Server } from './lib/server';
export * from './lib/token-types';
export * from './lib/validator/is';
Loading