Skip to content

Conversation

rockspore
Copy link
Member

This change will enable ALTS hard bound token in DirectPath, if the client runs in on GCE/GKE with ComputeEngineCredentials.

If for any reason the runtime environment doesn't support the issuance of such tokens, normal bearer access tokens will be used.

@rockspore rockspore requested review from a team as code owners February 13, 2025 21:21
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Feb 13, 2025
@rockspore
Copy link
Member Author

@rahul2393 Can you help look at it or assign other reviewers? Thanks.

I verified the flow internally that with this change, the ComputeEngineCredentials will craft correct the tokenUrl when getting tokens from the metadata server.

@@ -368,6 +369,9 @@ public GapicSpannerRpc(final SpannerOptions options) {
boolean isAttemptDirectPathXds = Boolean.parseBoolean(directPathXdsEnv);
if (isAttemptDirectPathXds) {
defaultChannelProviderBuilder.setAttemptDirectPath(true);
// This will let the credentials try to fetch a hard-bound access token if the runtime
// environment supports it.
defaultChannelProviderBuilder.setAllowHardBoundTokenTypes(Arrays.asList(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS));
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: When you have single value, you can use Collections.singletonList

Copy link
Collaborator

Choose a reason for hiding this comment

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

format the code using the following command

mvn com.coveo:fmt-maven-plugin:format

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the tips! Done.

@rockspore
Copy link
Member Author

rockspore commented Feb 25, 2025

Although this PR does no harm at this point, it'd be better to wait till googleapis/sdk-platform-java#3651 is released and used before this is merged. But just to confirm, is there anything else needed from me?

I'm mainly confused with the multi-approvers failure. Supposedly there is at least one approval one but it still says this has "0 of 2...".

@rockspore
Copy link
Member Author

@rahul2393 https://github.com/googleapis/sdk-platform-java/releases/tag/v2.54.0 is released and includes googleapis/sdk-platform-java#3651. Can you help review and merge this PR? Thanks.

@rockspore
Copy link
Member Author

Hi, @olavloite could you PTAL this since you are in both yoshi-java and cloud-spanner GitHub teams? Thanks.

@olavloite olavloite merged commit 42cc961 into googleapis:main Mar 4, 2025
32 of 33 checks passed
@rockspore rockspore deleted the directpath-bound-token branch March 4, 2025 21:33
@suztomo suztomo mentioned this pull request Mar 20, 2025
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Mar 24, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.cloud:google-cloud-spanner](https://github.com/googleapis/java-spanner)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`6.88.0` -> `6.89.0` |
|
[com.google.cloud:google-cloud-datastore](https://github.com/googleapis/java-datastore)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.27.0` -> `2.27.1` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.4` -> `2.31.6` |

---

### Release Notes

<details>
<summary>googleapis/java-spanner
(com.google.cloud:google-cloud-spanner)</summary>

###
[`v6.89.0`](https://github.com/googleapis/java-spanner/blob/HEAD/CHANGELOG.md#6890-2025-03-20)

##### Features

- Enable ALTS hard bound token in DirectPath
([#&#8203;3645](googleapis/java-spanner#3645))
([42cc961](googleapis/java-spanner@42cc961))
- Next release from main branch is 6.89.0
([#&#8203;3669](googleapis/java-spanner#3669))
([7a8a29b](googleapis/java-spanner@7a8a29b))
- Support isolation level REPEATABLE_READ for R/W transactions
([#&#8203;3670](googleapis/java-spanner#3670))
([e62f5ab](googleapis/java-spanner@e62f5ab))

##### Bug Fixes

- **deps:** Update the Java code generator (gapic-generator-java) to
2.55.1
([b959f4c](googleapis/java-spanner@b959f4c))
- Revert the ALTS bound token enablement
([#&#8203;3679](googleapis/java-spanner#3679))
([183c1f0](googleapis/java-spanner@183c1f0))

##### Performance Improvements

- Get database dialect using multiplexed session
([#&#8203;3684](googleapis/java-spanner#3684))
([f641a40](googleapis/java-spanner@f641a40))
- Skip gRPC trailers for StreamingRead & ExecuteStreamingSql
([#&#8203;3661](googleapis/java-spanner#3661))
([bd4b1f5](googleapis/java-spanner@bd4b1f5))

##### Dependencies

- Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1
([#&#8203;3689](googleapis/java-spanner#3689))
([67188df](googleapis/java-spanner@67188df))

</details>

<details>
<summary>googleapis/java-datastore
(com.google.cloud:google-cloud-datastore)</summary>

###
[`v2.27.1`](https://github.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2271-2025-03-18)

##### Bug Fixes

- **deps:** Update the Java code generator (gapic-generator-java) to
2.55.1
([ba1ad98](googleapis/java-datastore@ba1ad98))

##### Dependencies

- Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1
([#&#8203;1791](googleapis/java-datastore#1791))
([ab5ac8e](googleapis/java-datastore@ab5ac8e))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: 5b5b3e1fd7177ff56a483be663b20b28d243550c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants