Hi,
I would need help with sharing resource to my group.
I get a list of aros from /share/search-aros.json?api-version=v2. Then I take public key of all items in body except item 0, which is group.
Then I encrypt secret with all this keys. and post it to passbolt with permissions. I run simulation and proper PUT of shared resource. I got responses like this:
Simulation:
{
"header": {
"id": "77be293a-e936-47bd-a374-6b0cf5a14e14",
"status": "success",
"servertime": 1558704204,
"title": "app_share_dryRun_success",
"action": "7df37cb5-cfb9-57c2-a7a5-b65c9f573de0",
"message": "The operation was successful.",
"url": "\\/share\\/simulate\\/resource\\/721b4cfb-95a7-4998-a1e1-0ec880202ce6.json?api-version=v2",
"code": 200
},
"body": {
"changes": {
"added": [
{
"User": {
"id": "5afa8b42-65e2-4180-b18f-8b796cd5e7f9"
}
},
{
"User": {
"id": "5698ff9c-aa6c-4de1-847f-b12a644aab7d"
}
},
{
"User": {
"id": "dff78e84-5d44-436a-af1f-de83a9036dcf"
}
},
{
"User": {
"id": "bddca801-e920-490c-ac25-c07e0799916b"
}
},
{
"User": {
"id": "84944791-f042-4bfd-bb4f-d278bae46545"
}
},
{
"User": {
"id": "0ff20a46-d705-454d-baf1-b678ab5f3d13"
}
},
{
"User": {
"id": "15a9ae4b-b542-47cd-a7bc-8204b1c78c53"
}
},
{
"User": {
"id": "de0b1786-ddbe-452d-9a92-01f64511b364"
}
}
],
"removed": []
}
}
}
Proper PUT:
{
"header": {
"id": "3be164eb-b671-4a4c-9a11-64be3f114fbf",
"status": "error",
"servertime": 1558704205,
"title": "app_share_share_error",
"action": "f3b4bd12-9d43-5749-a5fe-425c4cfe3ccb",
"message": "Not Found",
"url": "\\/share\\/resource\\/721b4cfb-95a7-4998-a1e1-0ec880202ce6.json?api-version=v2",
"code": 400
},
"body": {
"secrets": {
"secrets_provided": "The secrets of all the users having access to the resource are required."
}
}
}
There is not more users then list i got from aros. What am’I missing?
Just to give more info…this are data I’m sending to passbolt API.
{
"permissions":[
{
"is_new":"true",
"aro":"Group",
"aro_foreign_key":"1bc2d0da-287d-44e7-9bc9-d35ced1ec2d6",
"aco":"Resource",
"aco_foreign_key":"721b4cfb-95a7-4998-a1e1-0ec880202ce6",
"type":"7"
}
],
"secrets":[
{
"user_id":"5698ff9c-aa6c-4de1-847f-b12a644aab7d",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMA5Yn1GZO6R5PAQf+MjxsUxOaIBRjqYvEG7m\/o7f+97XZlBFUC6Ui21\/UCP6E\n9dU5MTQQ\/VCddaCgI9yIAKq4u5sLoWrlxphJq1Hi1QvVGj+dBaZb4FuRgUAbpdA2\n9jOtmgeAQnC1K6F1ehoBpQjGaeN16W\/GR1CgkE\/WuICvM1HT281PCn9ygU3mSB\/D\nOx5raJvLjGlkqFXhrEdCtYSUAgjQmkRFMkklZhO3W9OQYfs\/vQGoFjioScGbOSd7\nS5FFwceJn4XmnVfG8eKe6ODxnR1oqqrnBBrsbWaFdn7V4OdpNkQoWDYjJ401PB1g\n3Tw+b4txsqHhXcx7Sqxn6K8iaU01t1oldywTlNzBwtJHAc9qqULn8GC8SC\/X3cVz\nsc2GzO6TAaf6q4pfp+TgSBRSPWJ42sTZ2c0WMkFaLqX7PdUALCSUUN77vj\/OkI6m\ngSspcKAYDIc=\n=WyvL\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"0ff20a46-d705-454d-baf1-b678ab5f3d13",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMA8t3MA0H3vOSAQgA1DgvL1ccqo8Yq8vla5kQ3RK5ttjDE6AIsVhWTQdAbaFI\nbpRs2oWKUVH1ZYEedjfVf4PeVIvaLrHxFmaRpNwnD2vQvKviPpFkfFgp3pskEEVd\nAP2oCZPd50LMJhX40ZzgWeLEOb8+4R4rfzCRsrTNBOnj1U4FiT\/LqjYsFDLw8KwP\nPB+RDhwIG+iVHaNzWU1sqdT4bxrssMa6tvbmGTbbO94h6vRpKIfUQGswslw6oRmf\nm7YOlddXiy7TiPBcj0HgTs9wdaoeHzMHiILqlPTTxXLFfjOhSknYIlK4v9naOo\/I\nqwiagw5ag6rmXZ+28PS9OrEyVniOIHYVT+t9hczP4NJHAUR5cBAiHC3bq4kLzmNC\nBKylwV\/A+QvGMl2gy6P2zuCqeengx6kSlkhJvbLNRDknrFRvUzXgYbcNne86Py9Q\n9bLBqYEnEXM=\n=rG5u\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"bddca801-e920-490c-ac25-c07e0799916b",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQGMA5DEzLJi6tx8AQv\/XFsv4Nl\/9aca+AVuiZDNO+P\/73UY6P7cooci2RZ3nLqa\neEaY+7sZaZzG7\/WrYY2GCjDyLVF7eiZr9rFgYlOm\/GzLaSYZJLnweOpskvozrxeX\nfvqgULMx83HiLMwIo9SSOrDsp4TtpQBdNpvdDFwFCRQkklcIOZnLH20\/AnuyAP\/x\nIT0\/QAHBPX1A5c+zBlGvcyuN1FCfrrWLMLt3M8RPxjEjG1jrkFO2hNX7jyM3WJek\nAo1iYW22+FFICTzjOn\/qXXUUCsSvMoRa1ko3yMvq4b5ienD0GiabM8JaDzK28UBp\nxn4xqkzHWLN6JlNbYBwnkVVfnxOvQmbDHSHCFwBwJ3F2Kk2RQtNF4F5Og6ORZnx5\nxnBgc0iTy\/6uYFAfR4J\/QHStLsYK8iqnOaXVZP8ZMAS3GdUeZ\/PR1v8vtNQbvNRR\nlTUhJiwTW1jAsMO20Kf+LhxPaXHVjCUIY8EHppySOUBEsGi70Dc0b9xsyxvfHtw4\n4RN4cvHfX60\/oWE3R7q70kcBeED6EFBdImktKg34DOShIvOx2WFKfCq7eAgwr9GN\nOL2En7PaEoanylsRgT+k2AW2Tk\/33O8U8HFOy50CSCPhixddx+y\/AA==\n=Kuzc\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"dff78e84-5d44-436a-af1f-de83a9036dcf",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMA52wi32z2rfIAQf\/SO8qXaVFt5rTOPVJhYFdU7iHsbDf2GCM2ijE1JBnCGSW\nNSfh5g83+7wsrMje5ttrLsNB\/2tuYDsfQOenD+4h2EdZcxxvoCnPBU4scY\/ZqwrQ\nIq+686g8tqrO7+lUPdCDZkcaN1WhIhr40Bxz57y0QfQ7k93sqHdb9mjM+P9k1LWo\n++AXIGAS7wD2Zabfd6ZUSGQIzyu2xKAj4GExbUCfRq3ln21zPP3CMPmX87pwslIG\nuL2WqlZI3v5TTU1hzzh0nCyqmfQwmQcAm+t1dQKIeSfNRBjbNQl4Hzx6fZXcTpTw\nZ9txVu5nHpBGiMenLxl7dUkrLi047ckZqE\/drHOKVdJHASw4FgnDePqHTnK+FuRz\nS\/yPv8tAg+zrwXo6rkINmTuV47kjhbSLR8bTm2urd9wjSQZzFU5CS\/TozC7D1YW5\nfuiAql0eun4=\n=Ly90\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"53ebbb87-7c77-4aaf-bc2d-363fd181cb2e",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMAxpM4shU\/bd2AQf7BKH11eo5q9Y9XMasvXQWqy\/1AwdPU5eneLSDQmQIufaV\ntduVS55QtIXzIntxovBmlzDfYS0Bvk5ufczJ1RYp0VBf4u\/eUtnrhwuakxWVUVpP\nZG7o+EwF6hbTUYq1Vij8p6CLPyjyfOkgpvb++sgYllDcwc9R0JvZoH7zBo0teTGT\njQcv8GDYm7K3iexKHbqxlGffsKdmq4sgQiZyp2GdKwTpZDXviHzewfyRYBSxwS2s\n7QVWNPAsJmuqubz\/gRdm8zAZ7IMuSLVVVuMbRAZAz3MDU2k7mvcJrJkCh60a+I9H\ntncO2ZKns0KzHwDJmfK8jGUl0jiT6xtzJ0IHA3XgttJHAa6K1BhDd9c58\/NKZIWk\n9F+HZBLtFp\/6zA2CFNg492OoyD+zzEoVpjsd9NzBLVKkOsNJHf3zc8PskxUpLBJT\nq5zbMqOttoU=\n=pCNj\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"5afa8b42-65e2-4180-b18f-8b796cd5e7f9",
"data":"-----BEGIN PGP MESSAGE-----\n\n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END PGP MESSAGE-----\n"
},
{
"user_id":"15a9ae4b-b542-47cd-a7bc-8204b1c78c53",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMA4++0lDAs2BpAQf\/YbBDT9j6ccYfpD942FVNyU9G8V3eCBCXXS4h5d6IhgPH\ngl4DFTU5gBrguLtvbUz7XDfygeMaQV1b+2H34RlcYYoKQu76k1hTMwFRV91BoRoE\nDdLksEdJlJhyZmFNqxfVz3B\/BbVMGdUnbIFQzYvuNmD0K6fsFQAZvtLawKp+zkHM\nbV7bmrGja\/EfW0+W7JK8XplWWFhLCzxAAnM6xplLi+dYIxNfZwesH9hsGdtciHAp\ntm0TbLWH8dVPZGXSZVGQDdgoTEMNr2FKrgA7fbaAhvcpSVYuuzrbmpbROizQLPZh\nBUCRtUWerMWtmBq5aAQmOPDvvT4I1HLlOGWevS+I9tJHAZkFP4uV84S89tR76H\/i\n3yG1Au8iKFdkwIvEXHv92GID0ZeBhgaYNMC+cWYlwc3LqdBcGBQQ2AIT7MlvQNPS\nhncrb+2ripM=\n=JH4E\n-----END PGP MESSAGE-----\n"
},
{
"user_id":"de0b1786-ddbe-452d-9a92-01f64511b364",
"data":"-----BEGIN PGP MESSAGE-----\n\nhQEMA9hIHhztINcRAQf\/dEQY68Rs3WXiRhOj2HygGrnkgsyzfikExcoA+Jlbl1hu\nSmJJjU1BSgQ23u99gejUe\/tWLnxkx4fKzUpVBr2vYI+Jj+Jan1aqPuYhQV+h0\/et\nkTJYruj5uIWrA6wc\/dqrLOYcTV\/qVJ11U0jM\/81v\/2+eUb8UkhZY5sjXaqODGw+Q\nvouDddqOmf51yMPfzr4+ZI+sVUutF2oNih9OLTjnxloqg\/RhCkGBWW0YDFo4xmtZ\nyanAUVZ8NW\/UnpUzhZaZk8V4IiuCaZ7EqxplWclpxbb9vPGXo6gEc1MKA1lrH1+N\nHRebjXgMzYe02BSUGSf6WZktcgC496Tj3gxTodRc3tJHAcW5GZog4Opx3Jg1g\/eR\nySKt3C5YOIfR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