Skip to content

V5.0 dev #564

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 32 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f3ce1bb
Seeking maintainers
thomseddon Apr 18, 2019
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
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
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
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
36 changes: 0 additions & 36 deletions .eslintrc

This file was deleted.

46 changes: 14 additions & 32 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
node_modules/

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

# misc
npm-debug.log
# folders
/dist
/node_modules
docs/_build/
__pycache__/
*.pyc
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.iml

.idea
.jshint
# files
.DS_Store

pids
logs
results

lib/dockerImage/keys
coverage
npm-debug.log*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive
*.pyc
/aio
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

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"
}
3 changes: 0 additions & 3 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
language: node_js

node_js:
- 6
- 7
- 8
- 9
- 10

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 the 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
Comment on lines +2 to +3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better in /* */ (at least for me the formatting is very odd in the github diff viewer).


// 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
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Changelog

### 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

palantir/tslint#4534 getting deprecated

* 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
Expand Down
Empty file modified LICENSE
100644 → 100755
Empty file.
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this really be part of the repository, or is it just a list of "personal todos?"

35 changes: 0 additions & 35 deletions index.js

This file was deleted.

10 changes: 10 additions & 0 deletions index.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';
1 change: 1 addition & 0 deletions lib/constants/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const MS_IN_S = 1_000;
1 change: 1 addition & 0 deletions lib/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './common';
38 changes: 0 additions & 38 deletions lib/errors/access-denied-error.js

This file was deleted.

15 changes: 15 additions & 0 deletions lib/errors/access-denied-error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { OAuthError } from './oauth-error';

/**
* Constructor.
*
* "The resource owner or authorization server denied the request"
*
* @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
*/

export class AccessDeniedError extends OAuthError {
constructor(message?: string | Error, properties?: any) {
super(message, { code: 400, name: 'access_denied', ...properties });
}
}
16 changes: 16 additions & 0 deletions lib/errors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export { AccessDeniedError } from './access-denied-error';
export { InsufficientScopeError } from './insufficient-scope-error';
export { InvalidArgumentError } from './invalid-argument-error';
export { InvalidClientError } from './invalid-client-error';
export { InvalidGrantError } from './invalid-grant-error';
export { InvalidRequestError } from './invalid-request-error';
export { InvalidScopeError } from './invalid-scope-error';
export { InvalidTokenError } from './invalid-token-error';
export { OAuthError } from './oauth-error';
export { ServerError } from './server-error';
export { UnauthorizedClientError } from './unauthorized-client-error';
export { UnauthorizedRequestError } from './unauthorized-request-error';
export { UnsupportedGrantTypeError } from './unsupported-grant-type-error';
export {
UnsupportedResponseTypeError,
} from './unsupported-response-type-error';
Loading