fix no method 'wrap' in sign route #716
This commit is contained in:
Родитель
aac2c01c85
Коммит
212ec77d9c
|
@ -79,9 +79,8 @@ module.exports = function (log, isA, error, signer, domain) {
|
|||
reply(error.serviceUnavailable())
|
||||
}
|
||||
else if (result && result.err) {
|
||||
// TODO: parse result.err better
|
||||
log.warn({ op: 'signer.enqueue', err: result.err })
|
||||
reply(error.wrap(result.err))
|
||||
log.warn({ op: 'signer.enqueue', err: result.err, req: request.payload })
|
||||
reply(error.invalidRequestParameter(result.err.message))
|
||||
}
|
||||
else {
|
||||
reply(result)
|
||||
|
|
|
@ -73,6 +73,36 @@ TestServer.start(config)
|
|||
}
|
||||
)
|
||||
|
||||
test(
|
||||
'bad key',
|
||||
function (t) {
|
||||
var email = server.uniqueEmail()
|
||||
var password = 'allyourbasearebelongtous'
|
||||
var client = null
|
||||
var duration = 1000 * 60 * 60 * 24
|
||||
return Client.createAndVerify(config.publicUrl, email, password, server.mailbox)
|
||||
.then(
|
||||
function (c) {
|
||||
client = c
|
||||
return client.sign(
|
||||
{
|
||||
"algorithm":"RS",
|
||||
"n":"abcdef",
|
||||
"e":"65537"
|
||||
},
|
||||
duration
|
||||
)
|
||||
}
|
||||
)
|
||||
.then(
|
||||
t.fail,
|
||||
function (err) {
|
||||
t.equal(err.errno, 107, 'invalid parameter error')
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
test(
|
||||
'/certificate/sign inputs',
|
||||
function (t) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче