After version 5.3.0, Authorization bearer token is not being sent to custom endpoints, we forcefully needed to downgrade version to 5.3.0 to make things work
See original GitHub issueThe issue is with in the latest client library @google-cloud/storage
version , and it seems the issue coming after this change https://github.com/googleapis/nodejs-storage/pull/1316, previous versions working fine. We downgraded to @google-cloud/storage
version 5.3.0, then it’s started working fine. Surprisingly, it wasn’t not complained in the last 10 months.
- Node.js version: 14.x
@google-cloud/storage
version: 5.13.1- Working version: 5.3.0
- Not working version: 5.13.1
Steps to reproduce
- The issue happening only in latest versions (>= 5.4.0) of @google-cloud/storage only when passing custom endpoint
- This working fine if custom endpoint not being passed
Here is the sample headers where Authorization header is missing, when request is made from the latest version (5.13.1) of @google-cloud/storage
2021-08-19:23:41:21.371 DEBUG s3server/routing.go:109 *** BEGIN REQUEST ***** 2021-08-19:23:41:21.371 DEBUG s3server/routing.go:111 GET /storage/v1/b/solaw-demo-east-1/o/config? HTTP/1.1 Host: bolt.us-east1.solaw2-gcp.bolt.projectn.co Accept: / Accept-Encoding: gzip,deflate Connection: Keep-Alive User-Agent: gcloud-node-storage/5.13.0 Via: 1.1 google X-Cloud-Trace-Context: efc4f02fb637ca3d80e3f6eb5082fb5d/14590283126324610390 X-Forwarded-For: 107.178.200.166, 34.117.111.184 X-Forwarded-Proto: https X-Goog-Api-Client: gl-node/14.17.3 gccl/5.13.0
2021-08-19:23:41:21.371 DEBUG s3server/routing.go:112 *** END REQUEST ******* 2021-08-19:23:41:21.371 DEBUG s3server/routing.go:115 boltRequest URL: /storage/v1/b/solaw-demo-east-1/o/config 2021-08-19:23:41:21.371 INFO s3server/routing_gcs_json.go:177 URL /storage/v1/b/solaw-demo-east-1/o/config, prefix , bucket solaw-demo-east-1, bucketParam o, object config, objectParam 2021-08-19:23:41:21.371 WARN s3server/routing_gcs_json.go:184 error retrieving principal from headers {“error”: “could not find bearer token unexpected EOF”}
No Authorization
header is being sent, but it’s (Bearer token) working in versions before 5.4.0
Thanks,
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Hi @MadhuPolu with the release of version
5.15.0
we have added a new option that can be passed to the storage constructor,useAuthWithCustomEndpoint
, this should restore the functionality of allowing authentication with a custom endpoint.We are looking into this deeper; it may have been a misunderstanding in terms of how this feature was implemented, and we hope to have a clearer response to you early next week. For now, I think your workaround of downgrading to 5.3.0 should be sufficient, and hopefully soon we can have a clearer resolution so you can use the latest version.
Thanks for your patience!