@ -80,10 +80,10 @@ describe("controller calls", () => {
errorstack : [ "(1 elements cleared)" ] ,
} ,
} ) ;
let result = controller . myself ( { address : testMail , userid : "pEp_own_userId" , username : testName } ) ;
let result = controller . myself ( { address : testMail , user_ id : "pEp_own_userId" , username : testName } ) ;
queue . expectSent (
{
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" , method : "myself" , params : [ { address : "test@test.com" , userid : "pEp_own_userId" , username : "Test User 01" } ] , id : 1 , jsonrpc : "2.0" ,
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" , method : "myself" , params : [ { address : "test@test.com" , user_ id : "pEp_own_userId" , username : "Test User 01" } ] , id : 1 , jsonrpc : "2.0" ,
} ,
) ;
return result . should . become ( {
@ -96,12 +96,14 @@ describe("controller calls", () => {
describe ( "is pEp user" , ( ) => {
it ( "true" , ( ) => {
queue . respondWith ( { jsonrpc : "2.0" , id : 2 , result : { outParams : [ true ] , return : { status : 0 , hex : "0 \"PEP_STATUS_OK\"" } , errorstack : [ "(1 elements cleared)" ] } } ) ;
result = controller . is_pEp_user ( testMail , testId , testName , testFp ) ;
result = controller . is_pEp_user ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "is_pEp_user" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} , true ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -110,12 +112,14 @@ describe("controller calls", () => {
} ) ;
it ( "false" , ( ) => {
queue . respondWith ( { jsonrpc : "2.0" , id : 2 , result : { outParams : [ false ] , return : { status : 0 , hex : "0 \"PEP_STATUS_OK\"" } , errorstack : [ "(1 elements cleared)" ] } } ) ;
result = controller . is_pEp_user ( testMail , testId , testName , testFp ) ;
result = controller . is_pEp_user ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "is_pEp_user" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} , true ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -143,9 +147,9 @@ describe("controller calls", () => {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "get_trustwords" ,
params : [ {
user_id : "" , username : "Test User 01" , address : "test@test.com" , fpr : "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97 " ,
address : "test@test.com " , username : "Test User 01" , fpr : "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97" , user_id : "" ,
} , {
user_id : "" , username : "Test User 02" , address : "test2@test.com" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71 " ,
address : "test2@test.com " , username : "Test User 02" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" , user_id : "" ,
} , "en" , "OUT" , "OUT" , false ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -164,12 +168,14 @@ describe("controller calls", () => {
errorstack : [ "(1 elements cleared)" ] ,
} ,
} ) ;
let result = controller . update_identity ( testMail , testId , testName , testFp ) ;
let result = controller . update_identity ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "update_identity" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -211,12 +217,14 @@ describe("controller calls", () => {
} ) ;
it ( "trust personal key" , ( ) => {
queue . respondWith ( { jsonrpc : "2.0" , id : 1 , result : { outParams : [ ] , return : { status : 518 , hex : "0x206 \"PEP_KEY_UNSUITABLE\"" } , errorstack : [ "(1 elements cleared)" ] } } ) ;
result = controller . trust_personal_key ( testMail , testId , testName , testFp ) ;
result = controller . trust_personal_key ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "trust_personal_key" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -225,12 +233,14 @@ describe("controller calls", () => {
} ) ;
it ( "identity rating" , ( ) => {
queue . respondWith ( { jsonrpc : "2.0" , id : 1 , result : { outParams : [ { rating : 6 } ] , return : { status : 0 , hex : "0 \"PEP_STATUS_OK\"" } , errorstack : [ "(1 elements cleared)" ] } } ) ;
result = controller . identity_rating ( testMail , testId , testName , testFp ) ;
result = controller . identity_rating ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "identity_rating" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} , [ "OP" ] ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -286,12 +296,14 @@ describe("controller calls", () => {
} ) ;
} ) ;
it ( "key mistrusted" , ( ) => {
result = controller . key_mistrusted ( testMail , testId , testName , testFp ) ;
result = controller . key_mistrusted ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "key_mistrusted" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} ] ,
id : 1 ,
jsonrpc : "2.0" ,
@ -299,12 +311,14 @@ describe("controller calls", () => {
return result . should . become ( [ ] ) ;
} ) ;
it ( "key reset trust" , ( ) => {
result = controller . key_reset_trust ( testMail , testId , testName , testFp ) ;
result = controller . key_reset_trust ( {
address : testMail , user_id : testId , username : testName , fpr : testFp ,
} ) ;
queue . expectSent ( {
security_token : "0847cqi9WqqE5ZcVtA8_mDIgEmYMv14xlNAvSZW" ,
method : "key_reset_trust" ,
params : [ {
user_id : "test_user_id" , username : "Test User 01" , address : "test@test.com " , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
address : "test@test.com" , user_id : "test_user_id" , username : "Test User 01" , fpr : "B39706EF952EC3AF0BA5921A91F792D28B044A71" ,
} ] ,
id : 1 ,
jsonrpc : "2.0" ,