question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

The 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

  1. The issue happening only in latest versions (>= 5.4.0) of @google-cloud/storage only when passing custom endpoint
  2. 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:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ddelgrosso1commented, Oct 7, 2021

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.

1reaction
WildSunLovecommented, Sep 16, 2021

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

OAuth 2.0 token not added to Headers #3608 - GitHub
To replicate the problem: Obtain a new access token. Select "Request Headers" as "Add authorization data to". Do not add the token manually...
Read more >
Microsoft identity platform access tokens
The Microsoft identity platform supports issuing any token version from any version endpoint - they aren't related.
Read more >
The OAuth 2.0 Authorization Framework: Bearer Token Usage
Any party in possession of a bearer token (a "bearer") can use it to get access to the associated resources (without demonstrating possession...
Read more >
Token Authentication Specification - Docker Documentation
The authorization service returns an opaque Bearer token representing the client's authorized access. The client retries the original request with the Bearer ...
Read more >
Changelog - Cypress Documentation
Fixed a regression introduced in the Electron browser in Cypress 10.8.0 where the CYPRESS_EVERY_NTH_FRAME environment variable was not being set appropriately ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found