Skip to content

Commit c5883e6

Browse files
authored
fix: Add PermissionDenied to ignorable exceptions in maybe_secret() (#1441)
1 parent edb0b4b commit c5883e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

data_validation/secret_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def maybe_secret(self, project_id: str, secret_id: str, version_id="latest") ->
5353
# Return the decoded payload.
5454
payload = response.payload.data.decode("UTF-8")
5555
return payload
56-
except (exceptions.NotFound, exceptions.InvalidArgument):
57-
# The secret does not exist and therefore we can assume it is just a token to be returned.
56+
except (
57+
exceptions.NotFound,
58+
exceptions.InvalidArgument,
59+
exceptions.PermissionDenied,
60+
):
61+
# The secret does not exist or is inaccessible and therefore we can assume it is just a token to be returned.
5862
return secret_id

0 commit comments

Comments
 (0)