more tests, stryker
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-12-28 14:53:14 +01:00
parent 669bc19943
commit b27ab8c6fc
8 changed files with 811 additions and 427 deletions

View File

@ -11,8 +11,9 @@ type TokenType = 'access_token'|'refresh_token'|'part_token'|'none'
interface VerificationResult {
authorized: boolean;
valid: boolean;
type: TokenType;
next_module: string;
next_module?: string;
}
interface SignatureResult {
@ -23,9 +24,9 @@ interface SignatureResult {
class Authority {
public verify (key: string): VerificationResult {
const result: VerificationResult = {
authorized: false,
type: 'none',
next_module: ''
authorized: false,
valid: false,
type: 'none'
};
const data = verify_signature_get_info (
key,
@ -41,6 +42,7 @@ class Authority {
if (!blacklist.is_valid (data.id))
return result;
result.valid = true;
result.authorized = result.type === 'access_token';
result.next_module = data.obj;