This commit is contained in:
parent
8285e58337
commit
05f2e53a8f
@ -18,5 +18,6 @@ module.exports = {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: { ecmaVersion: 2018 }
|
||||
parserOptions: { ecmaVersion: 2018 },
|
||||
rules: { 'node/no-unpublished-import': 'off' }
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -100,5 +100,12 @@ class Authority {
|
||||
|
||||
const auth = (new Authority);
|
||||
|
||||
export { Authority };
|
||||
export {
|
||||
TokenType,
|
||||
VerificationResult,
|
||||
SignatureResult,
|
||||
SignatureOptions,
|
||||
Authority
|
||||
};
|
||||
|
||||
export default auth;
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -35,3 +35,4 @@ class KeyStore {
|
||||
|
||||
const ks: KeyStore = (new KeyStore);
|
||||
export default ks;
|
||||
export { KeyStore };
|
||||
|
59
lib/index.ts
59
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 <timo@scode.ovh>, 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
|
||||
};
|
||||
|
@ -29,10 +29,10 @@
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"*.js",
|
||||
"*.ts",
|
||||
"*.d.ts",
|
||||
"*.map"
|
||||
"**/*.js",
|
||||
"**/*.ts",
|
||||
"**/*.d.ts",
|
||||
"**/*.map"
|
||||
],
|
||||
"keywords": [
|
||||
"authentication",
|
||||
|
@ -18,5 +18,6 @@ module.exports = {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: { ecmaVersion: 2018 }
|
||||
parserOptions: { ecmaVersion: 2018 },
|
||||
rules: { 'node/no-unpublished-import': 'off' }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user