Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[securitycenter] v2 client's apiEndpoint property is wrong when a regional endpoint is specified #1693

Open
7 tasks done
hegemonic opened this issue Sep 27, 2024 · 4 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. size: m Pull request size is medium. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@hegemonic
Copy link

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

n/a

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/hegemonic/cf807026d8b83c14aa0b225b16967599

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Run the code. It creates a v2 SecurityCenterClient; sets the apiEndpoint to securitycenter.me-central2.rep.googleapis.com; and prints the expected and actual apiEndpoint for the client.

A clear and concise description of what the bug is, and what you expected to happen.

The code prints the following:

expected apiEndpoint: securitycenter.me-central2.rep.googleapis.com
actual apiEndpoint: securitycenter.googleapis.com
client._opts.apiEndpoint: securitycenter.me-central2.rep.googleapis.com

I expected it to print the following:

expected apiEndpoint: securitycenter.me-central2.rep.googleapis.com
actual apiEndpoint: securitycenter.me-central2.rep.googleapis.com
client._opts.apiEndpoint: securitycenter.me-central2.rep.googleapis.com

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

  • If I specify an API endpoint, the client object shouldn't say that it's using the default endpoint.
  • You shouldn't need to look at private properties to figure out which endpoint the client is using.
Copy link

Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)

@hegemonic
Copy link
Author

@sofisl Why was this bug closed? I provided a valid link to a publicly visible gist.

@sofisl sofisl reopened this Sep 30, 2024
@sofisl sofisl transferred this issue from googleapis/google-cloud-node Jan 18, 2025
@sofisl
Copy link
Contributor

sofisl commented Jan 18, 2025

Transferring issue to correct library. Thanks for the reproduction @hegemonic

Just to clarify, this issue isn't blocking? Can you run the service with the correct endpoint (but it doesn't show up correctly?)

@sofisl sofisl added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 18, 2025
@hegemonic
Copy link
Author

@sofisl Sorry, but I don't know for sure and don't have a good way to check right now.

That said, my guess is that the client uses the correct endpoint. It looks like the service stub is constructed with the options from this._opts, and the endpoint in those options is correct.

@sofisl sofisl added the size: m Pull request size is medium. label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. size: m Pull request size is medium. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants