diff --git a/lib/.eslintrc.js b/lib/.eslintrc.js index 94184dc..bb3ef30 100644 --- a/lib/.eslintrc.js +++ b/lib/.eslintrc.js @@ -18,5 +18,6 @@ module.exports = { Atomics: 'readonly', SharedArrayBuffer: 'readonly' }, - parserOptions: { ecmaVersion: 2018 } + parserOptions: { ecmaVersion: 2018 }, + rules: { 'node/no-unpublished-import': 'off' } }; diff --git a/lib/AuthHandler.ts b/lib/AuthHandler.ts index 0f4d287..557eb14 100644 --- a/lib/AuthHandler.ts +++ b/lib/AuthHandler.ts @@ -131,7 +131,7 @@ class AuthRequest { return pt.id; } - public invalid (error_description?: string) { + public invalid (error_description?: string): void { this.default_header (); this.response.writeHead (400); this.response.end (JSON.stringify ({ @@ -140,7 +140,7 @@ class AuthRequest { })); } - public deny () { + public deny (): void { this.default_header (); this.response.writeHead (401); this.response.end (JSON.stringify ({ error: 'invalid_client' })); @@ -230,3 +230,12 @@ export default function create_auth_handler ( return Promise.resolve (); }; } + +export { + AccessSettings, + AccessResult, + AccessResponse, + AuthRequest, + AuthRequestHandler, + CreateHandlerOptions +}; diff --git a/lib/Authority.ts b/lib/Authority.ts index f32970a..ecfeb84 100644 --- a/lib/Authority.ts +++ b/lib/Authority.ts @@ -100,5 +100,12 @@ class Authority { const auth = (new Authority); -export { Authority }; +export { + TokenType, + VerificationResult, + SignatureResult, + SignatureOptions, + Authority +}; + export default auth; diff --git a/lib/Gateway.ts b/lib/Gateway.ts index badf237..4e79e47 100644 --- a/lib/Gateway.ts +++ b/lib/Gateway.ts @@ -89,4 +89,9 @@ export default function create_gateway (options: GatewayOptions): Gateway { return g.process_request.bind (g); } -export { Gateway, AnyFunc }; +export { + AnyFunc, + Gateway, + GatewayOptions, + GatewayClass +}; diff --git a/lib/KeyStore.ts b/lib/KeyStore.ts index d99cefb..0b445ce 100644 --- a/lib/KeyStore.ts +++ b/lib/KeyStore.ts @@ -35,3 +35,4 @@ class KeyStore { const ks: KeyStore = (new KeyStore); export default ks; +export { KeyStore }; diff --git a/lib/index.ts b/lib/index.ts index 5c605ee..44603b6 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,7 +1,56 @@ -import create_gateway from './Gateway'; -import create_auth_handler from './AuthHandler'; +/* + * Copyright (C) Sapphirecode - All Rights Reserved + * This file is part of Auth-Server-Helper which is released under MIT. + * See file 'LICENSE' for full license details. + * Created by Timo Hocker , January 2021 + */ -import blacklist from './Blacklist'; -import authority from './Authority'; +/* eslint-disable import/no-namespace */ +import create_auth_handler, { + AccessResponse, + CreateHandlerOptions, + AuthRequestHandler, + AuthRequest, + AccessSettings, + AccessResult +} from './AuthHandler'; +import authority, { + VerificationResult, + TokenType, + SignatureResult, + SignatureOptions, + Authority +} from './Authority'; +import blacklist, { Blacklist } from './Blacklist'; +import create_gateway, { + GatewayOptions, + GatewayClass, + Gateway, + AnyFunc +} from './Gateway'; +import { KeyStore } from './KeyStore'; -export { create_gateway, create_auth_handler, blacklist, authority }; +export { + create_gateway, + create_auth_handler, + blacklist, + authority, + + AccessResponse, + CreateHandlerOptions, + AuthRequestHandler, + AuthRequest, + AccessSettings, + AccessResult, + VerificationResult, + TokenType, + SignatureResult, + SignatureOptions, + Authority, + Blacklist, + GatewayOptions, + GatewayClass, + Gateway, + AnyFunc, + KeyStore +}; diff --git a/package.json b/package.json index 0adec7d..2752dcd 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ }, "files": [ "LICENSE", - "*.js", - "*.ts", - "*.d.ts", - "*.map" + "**/*.js", + "**/*.ts", + "**/*.d.ts", + "**/*.map" ], "keywords": [ "authentication", @@ -47,4 +47,4 @@ "engines": { "node": ">=10.0.0" } -} +} \ No newline at end of file diff --git a/test/.eslintrc.js b/test/.eslintrc.js index 94184dc..bb3ef30 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -18,5 +18,6 @@ module.exports = { Atomics: 'readonly', SharedArrayBuffer: 'readonly' }, - parserOptions: { ecmaVersion: 2018 } + parserOptions: { ecmaVersion: 2018 }, + rules: { 'node/no-unpublished-import': 'off' } };