This commit is contained in:
parent
872661a926
commit
6cf6286fb8
@ -100,4 +100,5 @@ class Authority {
|
||||
|
||||
const auth = (new Authority);
|
||||
|
||||
export { Authority };
|
||||
export default auth;
|
||||
|
@ -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;
|
||||
|
@ -31,7 +31,8 @@
|
||||
"LICENSE",
|
||||
"*.js",
|
||||
"*.ts",
|
||||
"*.d.ts"
|
||||
"*.d.ts",
|
||||
"*.map"
|
||||
],
|
||||
"keywords": [
|
||||
"authentication",
|
||||
|
@ -9,5 +9,6 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"sourceMap": true
|
||||
}
|
||||
},
|
||||
"exclude": ["test/**/*.ts"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user