Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
lint:
name: Javascript standard lint
name: Javascript Biome lint/format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -28,8 +28,10 @@ jobs:
with:
node-version: 24
cache: npm
- run: npm clean-install
- run: npm run lint
- run: |
npm clean-install
npm run lint
npm run format

unittest:
name: unit tests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Complete, compliant and well tested module for implementing an OAuth2 server in

[![Tests](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml)
[![CodeQL Semantic Analysis](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml)
[![Tests for Release](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml)
[![Documentation Status](https://readthedocs.org/projects/node-oauthoauth2-server/badge/?version=latest)](https://node-oauthoauth2-server.readthedocs.io/en/latest/?badge=latest)
[![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)
[![npm Version](https://img.shields.io/npm/v/@node-oauth/oauth2-server?label=version)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
[![npm Downloads/Week](https://img.shields.io/npm/dw/@node-oauth/oauth2-server)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
[![GitHub License](https://img.shields.io/github/license/node-oauth/node-oauth2-server)](https://github.com/node-oauth/node-oauth2-server/blob/master/LICENSE)
[![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev/)

NOTE: This project has been forked from [oauthjs/node-oauth2-server](https://github.com/oauthjs/node-oauth2-server) and is a continuation due to the project appearing to be abandoned. Please see [our issue board](https://github.com/node-oauth/node-oauth2-server/issues) to talk about next steps and the future of this project.

Expand Down
59 changes: 59 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["index.js", "lib/**/*.js", "test/**/*.js"]
},
Comment thread
jankapunkt marked this conversation as resolved.
"formatter": {
"enabled": true,
"indentStyle": "tab"
Comment on lines +13 to +14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tiny config nit: the top-level formatter sets tab here, while javascript.formatter below sets space. Since we format with spaces, let's keep the space and drop the tab — the javascript.formatter setting already governs all the included .js files:

Suggested change
"enabled": true,
"indentStyle": "tab"
"enabled": true

},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"suspicious": {
"noRedundantUseStrict": "off",
"noPrototypeBuiltins": "off",
"useIsArray": "off",
"noGlobalAssign": "off"
},
"complexity": {
"useArrowFunction": "off",
"useDateNow": "off",
"useOptionalChain": "off",
"useLiteralKeys": "off",
"noUselessThisAlias": "off"
},
"correctness": {
"noUnusedFunctionParameters": "off",
"noUnusedVariables": "off"
},
"style": {
"useNodejsImportProtocol": "off",
"useTemplate": "off"
}
}
Comment thread
jankapunkt marked this conversation as resolved.
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"indentStyle": "space",
"trailingCommas": "all",
"lineWidth": 120
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ exports.UnauthorizedClientError = require('./lib/errors/unauthorized-client-erro
exports.UnauthorizedRequestError = require('./lib/errors/unauthorized-request-error');
exports.UnsupportedGrantTypeError = require('./lib/errors/unsupported-grant-type-error');
exports.UnsupportedResponseTypeError = require('./lib/errors/unsupported-response-type-error');

10 changes: 5 additions & 5 deletions lib/errors/access-denied-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ const OAuthError = require('./oauth-error');
*/
class AccessDeniedError extends OAuthError {
/**
* @constructor
* @param message {string}
* @param properties {object=}
*/
* @constructor
* @param message {string}
* @param properties {object=}
*/
constructor(message, properties) {
properties = {
code: 400,
name: 'access_denied',
...properties
...properties,
};

super(message, properties);
Expand Down
4 changes: 2 additions & 2 deletions lib/errors/insufficient-scope-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class InsufficientScopeError extends OAuthError {
* @constructor
* @param message {string}
* @param properties {object=}
*/
*/
constructor(message, properties) {
properties = {
code: 403,
name: 'insufficient_scope',
...properties
...properties,
};

super(message, properties);
Expand Down
4 changes: 2 additions & 2 deletions lib/errors/invalid-argument-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class InvalidArgumentError extends OAuthError {
* @constructor
* @param message {string}
* @param properties {object=}
*/
*/
constructor(message, properties) {
properties = {
code: 500,
name: 'invalid_argument',
...properties
...properties,
};

super(message, properties);
Expand Down
10 changes: 5 additions & 5 deletions lib/errors/invalid-client-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const OAuthError = require('./oauth-error');

class InvalidClientError extends OAuthError {
/**
* @constructor
* @param message {string}
* @param properties {object=}
*/
* @constructor
* @param message {string}
* @param properties {object=}
*/
constructor(message, properties) {
properties = {
code: 400,
name: 'invalid_client',
...properties
...properties,
};

super(message, properties);
Expand Down
10 changes: 5 additions & 5 deletions lib/errors/invalid-grant-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const OAuthError = require('./oauth-error');

class InvalidGrantError extends OAuthError {
/**
* @constructor
* @param message {string}
* @param properties {object=}
*/
* @constructor
* @param message {string}
* @param properties {object=}
*/
constructor(message, properties) {
properties = {
code: 400,
name: 'invalid_grant',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/invalid-request-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InvalidRequest extends OAuthError {
properties = {
code: 400,
name: 'invalid_request',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/invalid-scope-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class InvalidScopeError extends OAuthError {
properties = {
code: 400,
name: 'invalid_scope',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/invalid-token-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class InvalidTokenError extends OAuthError {
properties = {
code: 401,
name: 'invalid_token',
...properties
...properties,
};

super(message, properties);
Expand Down
8 changes: 4 additions & 4 deletions lib/errors/oauth-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const http = require('http');
*/
class OAuthError extends Error {
/**
* @constructor
* @param messageOrError
* @param properties
*/
* @constructor
* @param messageOrError
* @param properties
*/
constructor(messageOrError, properties) {
super(messageOrError, properties);

Expand Down
2 changes: 1 addition & 1 deletion lib/errors/server-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ServerError extends OAuthError {
properties = {
code: 503,
name: 'server_error',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/unauthorized-client-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UnauthorizedClientError extends OAuthError {
properties = {
code: 400,
name: 'unauthorized_client',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/unauthorized-request-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UnauthorizedRequestError extends OAuthError {
properties = {
code: 401,
name: 'unauthorized_request',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/unsupported-grant-type-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UnsupportedGrantTypeError extends OAuthError {
properties = {
code: 400,
name: 'unsupported_grant_type',
...properties
...properties,
};

super(message, properties);
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/unsupported-response-type-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UnsupportedResponseTypeError extends OAuthError {
properties = {
code: 400,
name: 'unsupported_response_type',
...properties
...properties,
};

super(message, properties);
Expand Down
Loading
Loading