|
module.exports = function(seneca,util) { |
12✔ |
|
var Joi = util.Joi
|
× |
3 |
|
12✔ |
|
return {
|
× |
|
generate_key: {
|
12✔ |
|
desc: 'Generate a new API key.', |
12✔ |
|
reply_desc: {
|
12✔ |
|
ok: '`true` if successful', |
12✔ |
|
key: 'key string' |
12✔ |
10 |
}, |
12✔ |
|
validate: {
|
12✔ |
|
owner: Joi.string().required(),
|
12✔ |
|
scope: Joi.string().default('default'), |
12✔ |
|
|
12✔ |
15 |
}, |
12✔ |
16 |
}, |
12✔ |
17 |
|
12✔ |
18 |
|
12✔ |
|
verify_key: {
|
12✔ |
|
desc: 'Verify an API key.', |
12✔ |
|
reply_desc: {
|
12✔ |
|
ok: '`true` if verified', |
12✔ |
|
why: 'explanation code' |
12✔ |
24 |
}, |
12✔ |
|
validate: {
|
12✔ |
|
owner: Joi.string().required(),
|
12✔ |
|
scope: Joi.string().default('default'), |
12✔ |
|
key: Joi.string().required(),
|
12✔ |
29 |
}, |
12✔ |
30 |
}, |
12✔ |
31 |
|
12✔ |
32 |
} |
12✔ |
33 |
} |
12✔ |