package
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Timo Hocker 2021-01-05 17:06:35 +01:00
parent 872661a926
commit 6cf6286fb8
4 changed files with 11 additions and 6 deletions

View File

@ -100,4 +100,5 @@ class Authority {
const auth = (new Authority);
export { Authority };
export default auth;

View File

@ -17,25 +17,25 @@ class Blacklist {
this._signatures = [];
}
public clear_before (date: Date) {
public clear_before (date: Date):void {
for (let i = this._signatures.length - 1; i >= 0; i--) {
if (this._signatures[i].iat < date)
this._signatures.splice (i, 1);
}
}
public add_signature (hash: string) {
public add_signature (hash: string):void {
this._signatures.push ({ iat: (new Date), hash });
}
public remove_signature (hash:string) {
public remove_signature (hash:string):void {
for (let i = this._signatures.length - 1; i >= 0; i--) {
if (this._signatures[i].hash === hash)
this._signatures.splice (i, 1);
}
}
public is_valid (hash: string) {
public is_valid (hash: string):boolean {
for (const sig of this._signatures) {
if (sig.hash === hash)
return false;
@ -46,4 +46,6 @@ class Blacklist {
}
const bl = (new Blacklist);
export { Blacklist };
export default bl;

View File

@ -31,7 +31,8 @@
"LICENSE",
"*.js",
"*.ts",
"*.d.ts"
"*.d.ts",
"*.map"
],
"keywords": [
"authentication",

View File

@ -9,5 +9,6 @@
"forceConsistentCasingInFileNames": true,
"declaration": true,
"sourceMap": true
}
},
"exclude": ["test/**/*.ts"]
}