-
Notifications
You must be signed in to change notification settings - Fork 30
/
password.calls.js
104 lines (93 loc) · 1.86 KB
/
password.calls.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Copyright (c) 2020 Richard Rodger and other contributors, MIT License */
'use strict'
const Shared = require('./shared')
const LN = require('seneca-msg-test').LN
const print_calls = false
module.exports = [
// continuity
{
pattern: 'hook:password,cmd:encrypt' + LN(),
print: print_calls,
params: {
pass: '1*92hmddCTd#',
salt: 'abe44aba97de143916a27522ab365ccb',
rounds: 11111,
},
out: {
ok: true,
salt: 'abe44aba97de143916a27522ab365ccb',
pass: 'fd61a166af8a86b2e6f43415e175c3459b22741b4936c6beb71ae65d374115b5dfd89e8fae61100e1454b8bc48a18fd24bf9d0d6f316fe9791d1ca387f6b83ae',
},
},
{
pattern: 'hook:password,cmd:encrypt' + LN(),
print: print_calls,
params: {
pass: 'foo',
test: true,
rounds: 2,
},
out: {
ok: true,
},
},
{
pattern: 'hook:password,cmd:encrypt' + LN(),
params: {
password: 'foo',
salt: 'bar',
test: true,
rounds: 2,
},
out: {
ok: true,
salt: 'bar',
},
},
{
pattern: 'hook:password,cmd:encrypt' + LN(),
params: {
password: 'foo',
salt: 'zed',
test: true,
},
out: {
ok: true,
salt: 'zed',
},
},
{
pattern: 'hook:password,cmd:encrypt' + LN(),
params: {
test: true,
},
err: { code: 'no_pass' },
},
// FIX
// {
// print: true,
// pattern: 'hook:password,cmd:encrypt' + LN(),
// params: {
// test: true,
// pass: {},
// },
// err: { code: 'act_invalid_msg' },
// },
// FIX
// {
// pattern: 'hook:password,cmd:encrypt' + LN(),
// params: {
// test: true,
// pass: '',
// },
// err: { code: 'act_invalid_msg' },
// },
{
pattern: 'hook:password,cmd:encrypt' + LN(),
params: {
fail: true,
pass: 'zed',
},
err: {},
},
]