uranusjr commented on a change in pull request #18790:
URL: https://github.com/apache/airflow/pull/18790#discussion_r724671792
##########
File path:
airflow/providers/google/cloud/_internal_client/secret_manager_client.py
##########
@@ -24,7 +24,7 @@
from functools import cached_property
except ImportError:
from cached_property import cached_property
-from google.api_core.exceptions import NotFound, PermissionDenied
+from google.api_core.exceptions import NotFound, PermissionDenied,
InvalidArgument
Review comment:
```suggestion
from google.api_core.exceptions import InvalidArgument, NotFound,
PermissionDenied
```
##########
File path:
airflow/providers/google/cloud/_internal_client/secret_manager_client.py
##########
@@ -96,3 +96,10 @@ def get_secret(self, secret_id: str, project_id: str,
secret_version: str = 'lat
secret_id,
)
return None
+ except InvalidArgument:
+ self.log.error(
+ """Google Cloud API Call Error (InvalidArgument): Invalid
secret ID %s.
+ Only allow secret ID with English letters (A-Z), numbers
(0-9), dashes (-), and underscores (_) """,
+ secret_id,
+ )
+ return None
Review comment:
```suggestion
except InvalidArgument:
self.log.error(
"Google Cloud API Call Error (InvalidArgument): Invalid
secret ID %s. "
"Only ASCII alphabets (A-Z), numbers (0-9), dashes (-), and
underscores (_) "
"are allowed in the secret ID.",
secret_id,
)
return None
```
(Are only uppercase alphabets allowed, or are lowercases also? The message
doesn't currently make that clear.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]