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

feat(datastore): Configure both mTLS and TLS endpoints for Datastore client #9653

Merged
merged 4 commits into from
Apr 16, 2024

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Mar 27, 2024

The benefit of the change is so that the transport layer can establish mTLS connection where possible, thus improving security for communication to google apis.

Resolves: b/329657227

@bhshkh bhshkh requested review from a team as code owners March 27, 2024 23:36
@bhshkh bhshkh changed the title Configure both mTLS and TLS endpoints for Datastore client fix(datastore): Configure both mTLS and TLS endpoints for Datastore client Mar 27, 2024
Copy link

conventional-commit-lint-gcf bot commented Mar 27, 2024

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@bhshkh bhshkh changed the title fix(datastore): Configure both mTLS and TLS endpoints for Datastore client feat(datastore): Configure both mTLS and TLS endpoints for Datastore client Mar 27, 2024
@@ -115,6 +118,7 @@ func NewClientWithDatabase(ctx context.Context, projectID, databaseID string, op
} else {
o = []option.ClientOption{
option.WithEndpoint(prodAddr),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use withDefaultEndpoint() in place of WithEndpoint()?
The WithEndpoint() param is treated as an overriding option by the transport layer code, thus preventing the WithDefaultMTLSEndpoint() param from being used. thx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler warning:

internaloption.WithDefaultEndpoint is deprecated: WithDefaultEndpoint does not support setting the universe domain. Use WithDefaultEndpointTemplate and WithDefaultUniverseDomain to compose the default endpoint instead.

So, used template and domain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see looks like things changed recently, but yes you are right, we can use the template and domain instead, e.g. https://github.com/googleapis/google-cloud-go/blob/main/ai/generativelanguage/apiv1/generative_client.go#L61

@bhshkh bhshkh added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 28, 2024
@bhshkh
Copy link
Contributor Author

bhshkh commented Mar 28, 2024

Do not merge until release freeze ends in mid April

@bhshkh bhshkh requested a review from gkevinzheng March 28, 2024 00:49
@product-auto-label product-auto-label bot added the api: datastore Issues related to the Datastore API. label Mar 28, 2024
Copy link
Contributor

@gkevinzheng gkevinzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bhshkh bhshkh removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 16, 2024
@bhshkh bhshkh merged commit 38bd793 into googleapis:main Apr 16, 2024
8 checks passed
@bhshkh bhshkh deleted the feature/datastore-mtls branch April 16, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants