Skip to content

Commit

Permalink
chore: update deps and add clean script(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Jun 14, 2022
1 parent 5e4cede commit fa0e01b
Show file tree
Hide file tree
Showing 19 changed files with 139 additions and 118 deletions.
3 changes: 2 additions & 1 deletion oada/libs/lib-arangodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"init": "node dist/init.js",
"test": "yarn run build test && ava"
},
Expand Down Expand Up @@ -70,6 +71,6 @@
"@types/json-pointer": "^1.0.31",
"@types/node": "^16.11.39",
"ava": "4.2.0",
"type-fest": "^2.13.0"
"type-fest": "^2.13.1"
}
}
1 change: 1 addition & 0 deletions oada/libs/lib-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions oada/libs/lib-kafka/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"test": "yarn run build test && ava"
},
"ava": {
Expand Down
1 change: 1 addition & 0 deletions oada/libs/pino-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node --enable-source-maps -r pino-debug dist/server.js"
},
"author": "Alex Layton <alex@layton.in>",
Expand Down
9 changes: 5 additions & 4 deletions oada/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
"scripts": {
"g:eslint": "cd $INIT_CWD && eslint",
"build": "yarn build",
"clean": "yarn build -A -c clean",
"g:tsc": "cd $INIT_CWD && tsc -b",
"g:pino-pretty": "pino-pretty"
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@tsconfig/node18": "^1.0.0",
"@tsconfig/node18": "^1.0.1",
"@types/eslint": "^8.4.3",
"@types/mocha": "^9.1.1",
"@types/node": "^16.11.39",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"@yarnpkg/sdks": "^3.0.0-rc.9",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -45,7 +46,7 @@
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-sonarjs": "^0.13.0",
"eslint-plugin-unicorn": "^42.0.0",
"prettier": "^2.6.2",
"prettier": "^2.7.0",
"typescript": "^4.7.3"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions oada/services/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "c8 mocha",
"test-arango": "isTest=true mocha test/arango/index.js",
"lint": "jshint --reporter node_modules/jshint-stylish .",
"clean": "rm -rf test/oada-compliance && rm -rf coverage",
"clean": "rm -rf test/oada-compliance && rm -rf coverage && yarn run build --clean",
"start": "node ${INSPECT} -r @oada/pino-debug --unhandled-rejections=strict dist/index.js",
"init": "node dist/init.js"
},
Expand Down Expand Up @@ -93,14 +93,14 @@
"@types/minimist": "^1.2.2",
"@types/morgan": "^1.9.3",
"@types/oauth2orize": "^1.8.10",
"@types/passport": "^1.0.8",
"@types/passport": "^1.0.9",
"@types/passport-http-bearer": "^1.0.37",
"@types/passport-local": "^1.0.34",
"@types/passport-oauth2-client-password": "^0.1.2",
"@types/pem-jwk": "^2.0.0",
"@types/urijs": "^1.19.19",
"@types/uuid": "^8.3.4",
"c8": "^7.11.3",
"type-fest": "^2.13.0"
"type-fest": "^2.13.1"
}
}
5 changes: 3 additions & 2 deletions oada/services/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ async function run() {
}
);

app.get(config.get('auth.endpoints.logout'), (request, response) => {
request.logout();
app.get(config.get('auth.endpoints.logout'), async (request, response) => {
const logout = util.promisify(request.logout);
await logout();
response.redirect(request.get('Referrer')!);
});

Expand Down
5 changes: 3 additions & 2 deletions oada/services/http-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"test": "mocha",
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"healthcheck": "node --enable-source-maps dist/healthcheck.js http://localhost:${PORT}/health",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/server.js"
},
Expand Down Expand Up @@ -50,9 +51,9 @@
"cacache": "^16.1.1",
"debug": "^4.3.4",
"es-main": "^1.0.2",
"fastify": "^4.0.0",
"fastify": "^4.0.2",
"fastify-graceful-shutdown": "^3.1.0",
"fastify-healthcheck": "^3.1.0",
"fastify-healthcheck": "^4.0.0",
"json-ptr": "^3.1.0",
"ksuid": "^3.0.0",
"tslib": "^2.4.0",
Expand Down
1 change: 1 addition & 0 deletions oada/services/permissions-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/server.js",
"test": "mocha"
},
Expand Down
3 changes: 2 additions & 1 deletion oada/services/rev-graph-update/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"scripts": {
"test": "yarn run build test && ava",
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/index.js"
},
"ava": {
Expand Down Expand Up @@ -48,7 +49,7 @@
"@types/node": "^16.11.39",
"@types/randomstring": "^1.1.8",
"ava": "4.2.0",
"type-fest": "^2.13.0",
"type-fest": "^2.13.1",
"typescript": "^4.7.3"
}
}
1 change: 1 addition & 0 deletions oada/services/shares/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} -r @oada/pino-debug --enable-source-maps --unhandled-rejections=strict dist/server.js",
"test": "mocha"
},
Expand Down
1 change: 1 addition & 0 deletions oada/services/startup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} -r @oada/pino-debug --enable-source-maps --unhandled-rejections=strict dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
1 change: 1 addition & 0 deletions oada/services/sync-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/server.js",
"test": "mocha"
},
Expand Down
1 change: 1 addition & 0 deletions oada/services/users/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/server.js"
},
"bin": {
Expand Down
8 changes: 6 additions & 2 deletions oada/services/users/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export interface UserRequest {
userid?: string;
user: User;
authorization?: {
scope: string | string[];
scope: string | readonly string[];
};
}

Expand All @@ -141,6 +141,10 @@ export interface UserResponse {
}
responder.on<UserResponse, UserRequest>('request', handleReq);

function isArray(value: unknown): value is unknown[] | readonly unknown[] {
return Array.isArray(value);
}

export async function handleReq(request: UserRequest): Promise<UserResponse> {
// TODO: Sanitize?
trace('REQUEST: req.user = %O, userid = %s', request.user, request.userid);
Expand All @@ -151,7 +155,7 @@ export async function handleReq(request: UserRequest): Promise<UserResponse> {
// While this could fit in permissions_handler, since users are not really resources (i.e. no graph),
// we'll add a check here that the user has oada.admin.user:write or oada.admin.user:all scope
const authorization = cloneDeep(request.authorization) ?? { scope: '' };
const tokenscope = Array.isArray(authorization.scope)
const tokenscope = isArray(authorization.scope)
? authorization.scope.join(' ')
: authorization.scope; // Force to space-separated string
if (
Expand Down
1 change: 1 addition & 0 deletions oada/services/webhooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} -r @oada/pino-debug --enable-source-maps --unhandled-rejections=strict dist/server.js",
"test": "mocha"
},
Expand Down
1 change: 1 addition & 0 deletions oada/services/well-known/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"scripts": {
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps -r @oada/pino-debug --unhandled-rejections=strict dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
1 change: 1 addition & 0 deletions oada/services/write-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"scripts": {
"test": "yarn run build test && ava",
"build": "yarn g:tsc",
"clean": "yarn run build --clean",
"start": "node ${INSPECT} --enable-source-maps --expose-gc -r @oada/pino-debug --unhandled-rejections=strict dist/index.js"
},
"ava": {
Expand Down
Loading

0 comments on commit fa0e01b

Please sign in to comment.