URL formatting issue
Since v4.2.0 I'm getting 404 error when I try to get a secret version from the Secret Manager. The error message looks like
404. That’s an error.
The requested URL /v1/projects%2Fproject%2Fsecrets%2Fmy-secret%2Fversions%2Flatest:access was not found on this server. That’s all we know.
I believe the issue is that some of functions in the library replaces / with %2F
If I use Aiogoogle v4.1.0 - everything is OK
Request looks like
response = await aiogoogle.as_service_account(secret_manager.projects.secrets.versions.access(
name=f'projects/{project_id}/secrets/{secret_id}/versions/{version_id}'
))
Hi @dmitry-engineer Thanks for raising the issue.
I've taken a look at some of the previous issues regarding this bug. We've had 2 issues and 2 PRs concerning this issue i.e. encode forward slash vs not encode. At first we were encoding it, then this issue and subsequently a PR was created https://github.com/omarryhan/aiogoogle/issues/63. Then not encoding forward slashes caused this issue: https://github.com/omarryhan/aiogoogle/issues/96 which reverted #63
I honestly have no idea which method should be the default, would you mind checking which method Google's official Python lib uses (https://github.com/googleapis/google-api-python-client)? I think we should stick to how they handle it by default.
If it's not clear how Google api client does it, then I think not encoding forward slashes is the better solution because a user can always manually encode it before passing it to aiogoogle, however, it will be harder to do the reverse once it's passed to this lib.
Thanks!
Fixed in v5.0.0, please reopen if you're still facing the same issue, thanks!