Skip to content
Merged
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
272 changes: 195 additions & 77 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"private": true,
"version": "0.0.0",
"type": "module",
"repository": {
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "npm run build --workspaces",
"lint": "npm run lint --workspaces",
Expand Down
6 changes: 3 additions & 3 deletions packages/authentication/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/authentication",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -22,7 +22,7 @@
"./client": "./dist/client.js"
},
"peerDependencies": {
"@theshelf/authentication": "^0.1.0",
"@theshelf/authentication": "^0.2.0",
"jitar": "^0.10.4"
}
}
3 changes: 2 additions & 1 deletion packages/authentication/src/AuthenticationMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import type { Middleware, NextHandler, Request } from 'jitar';
import { Response, Unauthorized } from 'jitar';

import type { IdentityProvider, Session } from '@theshelf/authentication';
import type IdentityProvider from '@theshelf/authentication';
import type { Session } from '@theshelf/authentication';

import crypto from 'node:crypto';

Expand Down
6 changes: 3 additions & 3 deletions packages/database/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/database",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -20,7 +20,7 @@
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"peerDependencies": {
"@theshelf/database": "^0.1.0",
"@theshelf/database": "^0.2.0",
"jitar": "^0.10.4"
}
}
2 changes: 1 addition & 1 deletion packages/database/src/DatabaseHealthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import type { HealthCheck } from 'jitar';

import type { Database } from '@theshelf/database';
import type Database from '@theshelf/database';

export default class DatabaseHealthCheck implements HealthCheck
{
Expand Down
6 changes: 3 additions & 3 deletions packages/eventbroker/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/eventbroker",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -20,7 +20,7 @@
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"peerDependencies": {
"@theshelf/eventbroker": "^0.1.0",
"@theshelf/eventbroker": "^0.2.0",
"jitar": "^0.10.4"
}
}
2 changes: 1 addition & 1 deletion packages/eventbroker/src/EventBrokerHealthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import type { HealthCheck } from 'jitar';

import type { EventBroker } from '@theshelf/eventbroker';
import type EventBroker from '@theshelf/eventbroker';

export default class EventBrokerHealthCheck implements HealthCheck
{
Expand Down
6 changes: 3 additions & 3 deletions packages/filestore/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/filestore",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -20,7 +20,7 @@
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"peerDependencies": {
"@theshelf/filestore": "^0.1.0",
"@theshelf/filestore": "^0.2.0",
"jitar": "^0.10.4"
}
}
2 changes: 1 addition & 1 deletion packages/filestore/src/FileStoreHealthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import type { HealthCheck } from 'jitar';

import type { FileStore } from '@theshelf/filestore';
import type FileStore from '@theshelf/filestore';

export default class FileStoreHealthCheck implements HealthCheck
{
Expand Down
5 changes: 2 additions & 3 deletions packages/http/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/http",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -20,7 +20,6 @@
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"peerDependencies": {
"@theshelf/validation": "^0.1.0",
"jitar": "^0.10.4"
}
}
25 changes: 9 additions & 16 deletions packages/http/src/OriginMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@
import type { Middleware, NextHandler, Request, Response } from 'jitar';
import { BadRequest } from 'jitar';

import type { ValidationSchema } from '@theshelf/validation';
import validator from '@theshelf/validation';

const ORIGIN_COOKIE_NAME = 'x-client-origin';
const schema: ValidationSchema =
{
origin:
{
message: 'Invalid origin',
URL:
{
required: true
}
}
};

export default class OriginMiddleware implements Middleware
{
Expand Down Expand Up @@ -75,9 +61,16 @@ export default class OriginMiddleware implements Middleware

#validateOriginValue(value: string | undefined): void
{
const result = validator.validate({ origin: value }, schema);
if (value === undefined)
{
throw new BadRequest('Invalid origin');
}

if (result.invalid)
try
{
new URL(value);
}
catch
{
throw new BadRequest('Invalid origin');
}
Expand Down
6 changes: 3 additions & 3 deletions packages/notification/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@jitar-plugins/notification",
"private": false,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"repository": {
"url": "https://github.com/MaskingTechnology/jitar-plugins"
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
},
"scripts": {
"build": "tsc",
Expand All @@ -20,7 +20,7 @@
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"peerDependencies": {
"@theshelf/notification": "^0.1.0",
"@theshelf/notification": "^0.2.0",
"jitar": "^0.10.4"
}
}
2 changes: 1 addition & 1 deletion packages/notification/src/NotificationHealthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import type { HealthCheck } from 'jitar';

import type { NotificationService } from '@theshelf/notification';
import type NotificationService from '@theshelf/notification';

export default class NotificationHealthCheck implements HealthCheck
{
Expand Down