Skip to content

Commit

Permalink
Merge 334c932 into 97df0bd
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed May 2, 2023
2 parents 97df0bd + 334c932 commit b0d7ce9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fence/blueprints/data/indexd.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ def index_document(self):
"indexd: {}".format(url + self.file_id)
)
raise InternalError("URLs and metadata not found")

# indexd can resolve GUIDs without prefix, but cannot perform other operations
# (such as delete) without the prefix, so make sure `file_id` is the whole GUID
real_guid = json_response.get("did")
if real_guid and real_guid != self.file_id:
self.file_id = real_guid

return res.json()
except Exception as e:
logger.error(
Expand Down Expand Up @@ -714,6 +721,9 @@ def delete(self):
# it's possible that for some reason (something else modified the record in the
# meantime) that the revision doesn't match, which would lead to error here
if response.status_code != 200:
logger.error(
f"Unable to delete indexd record '{self.file_id}': {response.status_code} - {response.text}"
)
return (flask.jsonify(response.json()), 500)
return ("", 204)

Expand Down
5 changes: 5 additions & 0 deletions fence/sync/sync_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -1976,6 +1976,11 @@ def _update_authz_in_arborist(
)
)
continue
self.logger.debug(
"updating client `{}` (found {} client IDs)".format(
client_name, len(clients)
)
)
# there may be more than 1 client with this name if credentials are being rotated,
# so we grant access to each client ID
for client in clients:
Expand Down

0 comments on commit b0d7ce9

Please sign in to comment.