Possible bug: Config option signingEndpoint is not used when passed to getSignedUrl
#8795
Unanswered
MisanthropicBit
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the
@google-cloud/storagelibrary to implement an integration test for some code that uses signed urls (viafile.getSignedUrl) and I'm testing with a bunch of test servers. In order to test signed urls I'm passing a customsigningEndpointthat points to a local test server that is started up when the test starts.The problem is that the
file.getSignedUrlseems to have a bug where that config option is not passed down through the code (here). If you follow the code down throughURLSigner.getSignedUrltoURLSigner.getSignedUrlV4, you'll eventually get to this code which looks for thesigningEndpointin the config but never finds it. Effectively, the config option is ignored. TheURLSigner.getSignedUrlV2suffers from the same issue although I'm only using version 4.I think this is a bug because the
GetSignedUrlConfiginterface includes asigningEndpointoption which is never used and I expected the providedsigningEndpointconfig option to be used in place of a default one.A simple solution would be the following diff:
const signConfig: SignerGetSignedUrlConfig = { method, expires: cfg.expires, accessibleAt: cfg.accessibleAt, extensionHeaders, queryParams, contentMd5: cfg.contentMd5, contentType: cfg.contentType, host: cfg.host, + signingEndpoint: cfg.signingEndpoint, };If this is not a bug, what is the point of
signingEndpoint? Does it do something else? Can I redirect the signing process to another endpoint in another way? My code will run in a GCE environment so this is only an issue for testing and if someone else needs to use a custom signing endpoint in a production environment in the future.I've confirmed the issue in my tests (where authentication is done through test servers so the code will be allowed to eventually run the code in question), but I may simply be misunderstanding something here.
Beta Was this translation helpful? Give feedback.
All reactions