I am trying to import some existing logins to passbolt see partial code below, I am getting “The secrets of all the users having access to the resource are required.”
...
secrets = passbolt.get(f'/secrets/resource/{resource.id}.json')['body']
# secrets = map(lambda s: s['body'])
if login.access_level:
group = get_group(f'level {login.access_level.level}')
share_payload = {
'permissions': [
{'is_new': True, "aro": "Group", 'aro_foreign_key': group['id'], "aco": "Resource", "aco_foreign_key": resource.id, 'type': resource_type_id}
],
"secrets": [secrets]
}
print(222222222222, share_payload)
try:
resp = passbolt.post(
f"/share/simulate/resource/{resource.id}.json", share_payload, return_response_object=True
)
print(33333333, resp.content)
passbolt.put(f"/share/resource/{resource.id}.json", share_payload, return_response_object=True)
except Exception as ex:
print(ex.response.content)
raise
the simulate request returned successful but failed on the next PUT
What am I doing wrong here?