tests for authority
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-12-19 16:19:09 +01:00
parent 8a264bfa58
commit 669bc19943
2 changed files with 60 additions and 2 deletions

View File

@ -22,7 +22,11 @@ interface SignatureResult {
class Authority {
public verify (key: string): VerificationResult {
const result = { authorized: false, type: 'none', next_module: '' };
const result: VerificationResult = {
authorized: false,
type: 'none',
next_module: ''
};
const data = verify_signature_get_info (
key,
(info) => keystore.get_key (info.iat / 1000),
@ -49,7 +53,7 @@ class Authority {
next_module?: string
): SignatureResult {
const time = Date.now ();
const key = keystore.get_key (time / 1000);
const key = keystore.get_key (time / 1000, valid_for);
const attributes = {
id: create_salt (),
iat: time,