Skip to content

Commit

Permalink
chore: move package json fields to rc files
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Mar 3, 2021
1 parent ee74dcf commit 5efbf9b
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 94 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v2
with:
node-version: 12
- name: Store node version variable
Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
- 12
- 14.15.0
- 14
- '>=15'
os:
- ubuntu-latest
- windows-latest
Expand Down
6 changes: 6 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporter": [
"lcov",
"text-summary"
]
}
41 changes: 41 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"scripts": {
"postchangelog": "sed -i '' -e 's/### \\[/## [/g' CHANGELOG.md"
},
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"section": "Refactor",
"hidden": true
},
{
"type": "perf",
"section": "Performance",
"hidden": false
},
{
"type": "test",
"hidden": true
}
]
}
6 changes: 1 addition & 5 deletions docs/update-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ const props = [

line = Buffer.from(strLine);


if (strLine.startsWith('/*') && !strLine.includes('eslint') && !strLine.includes('istanbul')) {
if (strLine.startsWith('/*') && !strLine.includes('eslint')) {
inBlock = true;
nextIsOption = true;
return;
Expand Down Expand Up @@ -300,9 +299,6 @@ const props = [
if (line.includes('/* eslint-enable')) {
return undefined;
}
if (line.includes('/* istanbul ignore')) {
return undefined;
}
line = line.replace(/ \/\/ TODO.+/, '');
line = line.replace(/ class="[ \-\w]+ ?"/, '');
if (line.includes('<meta ')) {
Expand Down
1 change: 0 additions & 1 deletion lib/actions/authorization/check_client_grant_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = function checkClientGrantType({ oidc: { route, client } }, next
case 'device_authorization':
grantType = 'urn:ietf:params:oauth:grant-type:device_code';
break;
/* istanbul ignore next */
default:
throw new Error('not implemented');
}
Expand Down
2 changes: 0 additions & 2 deletions lib/actions/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ you are expected to disable these interactions and provide your own');

const configuration = instance(provider).configuration('interactions');

/* istanbul ignore if */
if (configuration.url !== defaultInteractionUri) {
attention.warn('you\'ve configured your own interactions.url but devInteractions are still enabled, \
your configuration is not in effect');
Expand Down Expand Up @@ -147,7 +146,6 @@ your configuration is not in effect');
});
break;
}
/* istanbul ignore next */
default:
ctx.throw(501, 'not implemented');
}
Expand Down
2 changes: 0 additions & 2 deletions lib/actions/introspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ module.exports = function introspectionAction(provider) {
}

function getClientCredentials(token) {
/* istanbul ignore if */
if (!grantTypeHandlers.has('client_credentials')) {
return undefined;
}
return ClientCredentials.find(token);
}

function getRefreshToken(token) {
/* istanbul ignore if */
if (!grantTypeHandlers.has('refresh_token')) {
return undefined;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/actions/revocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ module.exports = function revocationAction(provider) {
}

function getClientCredentials(token) {
/* istanbul ignore if */
if (!grantTypeHandlers.has('client_credentials')) {
return undefined;
}
return provider.ClientCredentials.find(token);
}

function getRefreshToken(token) {
/* istanbul ignore if */
if (!grantTypeHandlers.has('refresh_token')) {
return undefined;
}
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/_/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function defaults(deep, target, ...sources) {
continue;
}
for (const [key, value] of Object.entries(source)) {
/* istanbul ignore if */
if (key === '__proto__' || key === 'constructor') {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/_/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function merge(target, ...sources) {
continue;
}
for (const [key, value] of Object.entries(source)) {
/* istanbul ignore if */
if (key === '__proto__' || key === 'constructor') {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/_/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const isPlainObject = require('./is_plain_object');

module.exports = (object, path, value) => {
const properties = path.split('.');
/* istanbul ignore if */
if (properties.includes('__proto__') || properties.includes('constructor')) {
throw new TypeError('__proto__ and constructor cannot be set');
}
Expand Down
15 changes: 0 additions & 15 deletions lib/helpers/configuration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { deprecate } = require('util');

const { JWA } = require('../consts');

const get = require('./_/get');
Expand Down Expand Up @@ -468,7 +466,6 @@ class Configuration {
}
});

/* istanbul ignore if */
if (ENABLED_DRAFTS.size) {
attention.info('The following draft features are enabled and their implemented version not acknowledged');
ENABLED_DRAFTS.forEach((draft) => {
Expand All @@ -495,16 +492,4 @@ class Configuration {
}
}

Configuration.prototype.postLogoutSuccessSourceDeprecationNotice = deprecate(
/* istanbul ignore next */
() => {},
`postLogoutSuccessSourceDeprecationNotice is deprecated, use features.rpInitiatedLogout.postLogoutSuccessSourceDeprecationNotice for configuring it instead, see ${docs('featuresrpinitiatedlogout')}`,
);

Configuration.prototype.logoutSourceDeprecationNotice = deprecate(
/* istanbul ignore next */
() => {},
`logoutSourceDeprecationNotice is deprecated, use features.rpInitiatedLogout.logoutSourceDeprecationNotice for configuring it instead, see ${docs('featuresrpinitiatedlogout')}`,
);

module.exports = Configuration;
4 changes: 0 additions & 4 deletions lib/helpers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ function clientBasedCORS(ctx, origin, client) {
return false;
}

/* istanbul ignore next */
function getCertificate(ctx) {
mustChange('features.mTLS.getCertificate', 'retrieve the PEM-formatted client certificate from the request context');
throw new Error('features.mTLS.getCertificate function not configured');
}

/* istanbul ignore next */
function certificateAuthorized(ctx) {
mustChange('features.mTLS.certificateAuthorized', 'determine if the client certificate is verified and comes from a trusted CA');
throw new Error('features.mTLS.certificateAuthorized function not configured');
}

/* istanbul ignore next */
function certificateSubjectMatches(ctx, property, expected) {
mustChange('features.mTLS.certificateSubjectMatches', 'verify that the tls_client_auth_* registered client property value matches the certificate one');
throw new Error('features.mTLS.certificateSubjectMatches function not configured');
Expand Down Expand Up @@ -435,7 +432,6 @@ function rotateRefreshToken(ctx) {

// cap the maximum amount of time a refresh token can be
// rotated for up to 1 year, afterwards its TTL is final
/* istanbul ignore if */
if (refreshToken.totalLifetime() >= 365.25 * 24 * 60 * 60) {
return false;
}
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/interaction_policy/check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
/* eslint-disable no-param-reassign */

class Check {
Expand Down
2 changes: 0 additions & 2 deletions lib/helpers/interaction_policy/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* istanbul ignore file */

const Check = require('./check');
const Prompt = require('./prompt');
const login = require('./prompts/login');
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/interaction_policy/prompt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
/* eslint-disable no-param-reassign */

const Check = require('./check');
Expand Down
1 change: 0 additions & 1 deletion lib/models/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ function stripFragment(uri) {

function deriveEncryptionKey(secret, length) {
const digest = length <= 32 ? 'sha256' : length <= 48 ? 'sha384' : length <= 64 ? 'sha512' : false; // eslint-disable-line no-nested-ternary
/* istanbul ignore if */
if (!digest) {
throw new Error('unsupported symmetric encryption key derivation');
}
Expand Down
1 change: 0 additions & 1 deletion lib/models/id_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ module.exports = function getIdToken(provider) {
enc: client.authorizationEncryptedResponseEnc,
};
break;
/* istanbul ignore next */
default:
throw new TypeError('invalid use option');
}
Expand Down
1 change: 0 additions & 1 deletion lib/models/mixins/is_sender_constrained.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = (superclass) => class extends superclass {
case 'jkt':
this[jkt] = input;
break;
/* istanbul ignore next */
default:
throw new Error('unsupported');
}
Expand Down
3 changes: 0 additions & 3 deletions lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,14 @@ class Provider extends events.EventEmitter {
return this.#app.callback();
}

/* istanbul ignore next */
listen(...args) {
return this.#app.listen(...args);
}

/* istanbul ignore next */
get proxy() {
return this.#app.proxy;
}

/* istanbul ignore next */
set proxy(value) {
this.#app.proxy = value;
}
Expand Down
1 change: 0 additions & 1 deletion lib/router/tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
/* eslint-disable */
// https://github.com/steambap/koa-tree-router @ 0.7.0 / MIT
// Modifications:
Expand Down
48 changes: 0 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,53 +94,5 @@
},
"engines": {
"node": "^12.19.0 || ^14.15.0"
},
"nyc": {
"cache": false,
"reporter": [
"lcov",
"text-summary"
]
},
"standard-version": {
"scripts": {
"postchangelog": "sed -i '' -e 's/### \\[/## [/g' CHANGELOG.md"
},
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"section": "Refactor",
"hidden": true
},
{
"type": "perf",
"section": "Performance",
"hidden": false
},
{
"type": "test",
"hidden": true
}
]
}
}

0 comments on commit 5efbf9b

Please sign in to comment.