Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_resource: Issue when folder_id is set and not all users keys are imported. #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions passboltapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ def create_resource(
folder = self.read_folder(folder_id)
# get users with access to folder
users_list = self.list_users_with_folder_access(folder_id)

# import users key to GPG otherwise secret share will fail
for user in users_list: self.gpg.import_keys(user.gpgkey.armored_key)

lookup_users: Mapping[PassboltUserIdType, PassboltUserTuple] = {user.id: user for user in users_list}
self_user_id = [user.id for user in users_list if self.user_fingerprint == user.gpgkey.fingerprint]
if self_user_id:
Expand Down