Skip to content

Conversation

lqiu96
Copy link
Member

@lqiu96 lqiu96 commented Nov 27, 2024

Reverts #3326

Context: #3326 (comment)

s2a-gRPC is an Experimental library and shouldn't be added until it's stabilized.

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Nov 27, 2024
@lqiu96 lqiu96 requested a review from blakeli0 November 27, 2024 20:56
Copy link

@lqiu96
Copy link
Member Author

lqiu96 commented Nov 27, 2024

CC: @rmehta19

This is the revert PR

@lqiu96 lqiu96 marked this pull request as ready for review November 27, 2024 20:56
Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@rmehta19
Copy link
Contributor

rmehta19 commented Dec 2, 2024

CC: @rmehta19

This is the revert PR

SG. We will re-open once S2A is de-experimentalized in gRPC.

@lqiu96 lqiu96 merged commit 254e9ff into main Dec 2, 2024
49 checks passed
@lqiu96 lqiu96 deleted the revert-3326-grpc-channel-using-s2a branch December 2, 2024 17:46
lqiu96 added a commit that referenced this pull request Dec 3, 2024
…pc transport" (#3400)

Reverts #3326

Context:
#3326 (comment)

s2a-gRPC is an Experimental library and shouldn't be added until it's
stabilized.
lqiu96 added a commit that referenced this pull request Dec 3, 2024
…pc transport" (#3400)

Reverts #3326

Context:
#3326 (comment)

s2a-gRPC is an Experimental library and shouldn't be added until it's
stabilized.
rmehta19 added a commit to rmehta19/sdk-platform-java that referenced this pull request Jan 7, 2025
lqiu96 pushed a commit that referenced this pull request Jan 24, 2025
…t libraries grpc transport (#3548)

**Revert #3400.**

**This PR re-introduces the S2A integration the Java Cloud SDK
(initially introduced in #3326, and temporarily reverted in #3400).**

**This PR does this by reverting #3400 with the following patches:**
- load the S2A APIs via reflection. This allows us to merge the code
while the [S2A API is still experimental in
gRPC-Java](https://github.com/grpc/grpc-java/blob/master/s2a/src/main/java/io/grpc/s2a/S2AChannelCredentials.java)
without introducing a diamond dependency conflict. Once the S2A APIs are
stable, the reflection logic can be removed and the S2A API can be used
directly (via a dependency on S2A API)
- fix NPE (#3401)
- use a different env var name for enabling the feature


**Below is the original description from #3326**

Modify the Client Libraries gRPC Channel builder to use mTLS via S2A if
the experimental environment variable is set, S2A is available (We check
this by using [SecureSessionAgent
utility](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java)),
and a few more conditions (see `shouldUseS2A`).

Following https://google.aip.dev/auth/4115, Only attempt to use S2A
after DirectPath and DCA (https://google.aip.dev/auth/4114) are ruled
out as options. If conditions to use S2A are not met (env variable not
set, or S2A is not running in environment, etc (`shouldUseS2A` returns
false)), fall back to default TLS connection.

When we are creating S2A-enabled Grpc Channel Credentials, we first try
to secure the connection between the client and the S2A via MTLS, using
[MTLS-MDS](https://cloud.google.com/compute/docs/metadata/overview#https-mds)
credentials. If MTLS-MDS credentials can't be loaded, then we fallback
to a plaintext connection between the client and S2A.

The parallel go implementation : googleapis/google-api-go-client#1874
(now lives here:
https://github.com/googleapis/google-cloud-go/blob/main/auth/internal/transport/cba.go)

S2A Java client: https://github.com/grpc/grpc-java/tree/master/s2a

Resolving b/376258193 means that S2A.java is no longer experimental
diegomarquezp pushed a commit that referenced this pull request Jan 25, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.52.0</summary>

##
[2.52.0](v2.51.1...v2.52.0)
(2025-01-24)


### Features

* add support for new setAllowHardBoundTokens field.
([#3467](#3467))
([38431a2](38431a2))
* revert
[#3400](#3400):
reintroduce experimental S2A integration in client libraries grpc
transport
([#3548](#3548))
([65a0f11](65a0f11))


### Dependencies

* update dependency com.google.api-client:google-api-client-bom to
v2.7.2
([#3578](#3578))
([f6e5ad9](f6e5ad9))
* update dependency commons-codec:commons-codec to v1.17.2
([#3557](#3557))
([07ce801](07ce801))
* update dependency gitpython to v3.1.44
([#3559](#3559))
([e924db0](e924db0))
* update dependency org.checkerframework:checker-qual to v3.48.4
([#3560](#3560))
([a4726e9](a4726e9))
* update dependency smmap to v5.0.2
([#3561](#3561))
([6cd5d0d](6cd5d0d))
* update docker.io/library/alpine docker tag to v3.21.1
([#3551](#3551))
([edd5a4c](edd5a4c))
* update docker.io/library/alpine docker tag to v3.21.2
([#3580](#3580))
([f577ecd](f577ecd))
* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker
digest to 9a259c6
([#3554](#3554))
([eb2cbd6](eb2cbd6))
* update docker.io/library/python:3.13.1-alpine3.20 docker digest to
9ab3b6e
([#3555](#3555))
([40a74fe](40a74fe))
* update google auth library dependencies to v1.31.0
([#3577](#3577))
([7fa879a](7fa879a))
* update googleapis/java-cloud-bom digest to c7c443f
([#3579](#3579))
([fcf40b7](fcf40b7))
* update repo-automation-bots digest to 0a12b5d
([#3464](#3464))
([b9c9d21](b9c9d21))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request Feb 5, 2025
…ws (#3591)

Similar to implementation for DirectPath in
#3572.

This is part of the experimental S2A feature (see #3400)
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Feb 11, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.api.grpc:proto-google-common-protos](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`2.51.0` -> `2.52.0` |
|
[com.google.cloud:google-cloud-core-http](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`2.50.0` -> `2.51.0` |
|
[com.google.cloud:google-cloud-core](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`2.50.0` -> `2.51.0` |
| [com.google.api:gax](https://github.com/googleapis/sdk-platform-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`2.60.0` -> `2.61.0` |
| [io.netty:netty-handler](https://netty.io/)
([source](https://github.com/netty/netty)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `4.1.117.Final` ->
`4.1.118.Final` |
| [io.netty:netty-bom](https://netty.io/)
([source](https://github.com/netty/netty)) | dependencies |
misk/gradle/libs.versions.toml | gradle | patch | `4.1.117.Final` ->
`4.1.118.Final` |
|
[com.autonomousapps.dependency-analysis](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin)
| plugin | misk/gradle/libs.versions.toml | gradle | patch | `2.8.1` ->
`2.8.2` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.16` -> `2.30.17` |

---

### Release Notes

<details>
<summary>googleapis/sdk-platform-java
(com.google.api.grpc:proto-google-common-protos)</summary>

###
[`v2.52.0`](https://github.com/googleapis/sdk-platform-java/blob/HEAD/CHANGELOG.md#2520-2025-01-24)

##### Features

- add support for new setAllowHardBoundTokens field.
([#&#8203;3467](googleapis/sdk-platform-java#3467))
([38431a2](googleapis/sdk-platform-java@38431a2))
- revert
[#&#8203;3400](googleapis/sdk-platform-java#3400):
reintroduce experimental S2A integration in client libraries grpc
transport
([#&#8203;3548](googleapis/sdk-platform-java#3548))
([65a0f11](googleapis/sdk-platform-java@65a0f11))

##### Dependencies

- update dependency com.google.api-client:google-api-client-bom to
v2.7.2
([#&#8203;3578](googleapis/sdk-platform-java#3578))
([f6e5ad9](googleapis/sdk-platform-java@f6e5ad9))
- update dependency commons-codec:commons-codec to v1.17.2
([#&#8203;3557](googleapis/sdk-platform-java#3557))
([07ce801](googleapis/sdk-platform-java@07ce801))
- update dependency gitpython to v3.1.44
([#&#8203;3559](googleapis/sdk-platform-java#3559))
([e924db0](googleapis/sdk-platform-java@e924db0))
- update dependency org.checkerframework:checker-qual to v3.48.4
([#&#8203;3560](googleapis/sdk-platform-java#3560))
([a4726e9](googleapis/sdk-platform-java@a4726e9))
- update dependency smmap to v5.0.2
([#&#8203;3561](googleapis/sdk-platform-java#3561))
([6cd5d0d](googleapis/sdk-platform-java@6cd5d0d))
- update docker.io/library/alpine docker tag to v3.21.1
([#&#8203;3551](googleapis/sdk-platform-java#3551))
([edd5a4c](googleapis/sdk-platform-java@edd5a4c))
- update docker.io/library/alpine docker tag to v3.21.2
([#&#8203;3580](googleapis/sdk-platform-java#3580))
([f577ecd](googleapis/sdk-platform-java@f577ecd))
- update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker
digest to
[`9a259c6`](googleapis/sdk-platform-java@9a259c6)
([#&#8203;3554](googleapis/sdk-platform-java#3554))
([eb2cbd6](googleapis/sdk-platform-java@eb2cbd6))
- update docker.io/library/python:3.13.1-alpine3.20 docker digest to
[`9ab3b6e`](googleapis/sdk-platform-java@9ab3b6e)
([#&#8203;3555](googleapis/sdk-platform-java#3555))
([40a74fe](googleapis/sdk-platform-java@40a74fe))
- update google auth library dependencies to v1.31.0
([#&#8203;3577](googleapis/sdk-platform-java#3577))
([7fa879a](googleapis/sdk-platform-java@7fa879a))
- update googleapis/java-cloud-bom digest to
[`c7c443f`](googleapis/sdk-platform-java@c7c443f)
([#&#8203;3579](googleapis/sdk-platform-java#3579))
([fcf40b7](googleapis/sdk-platform-java@fcf40b7))
- update repo-automation-bots digest to
[`0a12b5d`](googleapis/sdk-platform-java@0a12b5d)
([#&#8203;3464](googleapis/sdk-platform-java#3464))
([b9c9d21](googleapis/sdk-platform-java@b9c9d21))

</details>

<details>
<summary>autonomousapps/dependency-analysis-android-gradle-plugin
(com.autonomousapps.dependency-analysis)</summary>

###
[`v2.8.2`](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/blob/HEAD/CHANGELOG.md#Version-282)

-   \[Fix]: generate supergraph just once per variant (source set).

</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: 77625f13e2ef5d155af3a50a4e15fb8d98ebdd62
lqiu96 pushed a commit that referenced this pull request Feb 20, 2025
…t libraries grpc transport (#3548)

**Revert #3400.**

**This PR re-introduces the S2A integration the Java Cloud SDK
(initially introduced in #3326, and temporarily reverted in #3400).**

**This PR does this by reverting #3400 with the following patches:**
- load the S2A APIs via reflection. This allows us to merge the code
while the [S2A API is still experimental in
gRPC-Java](https://github.com/grpc/grpc-java/blob/master/s2a/src/main/java/io/grpc/s2a/S2AChannelCredentials.java)
without introducing a diamond dependency conflict. Once the S2A APIs are
stable, the reflection logic can be removed and the S2A API can be used
directly (via a dependency on S2A API)
- fix NPE (#3401)
- use a different env var name for enabling the feature


**Below is the original description from #3326**

Modify the Client Libraries gRPC Channel builder to use mTLS via S2A if
the experimental environment variable is set, S2A is available (We check
this by using [SecureSessionAgent
utility](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java)),
and a few more conditions (see `shouldUseS2A`).

Following https://google.aip.dev/auth/4115, Only attempt to use S2A
after DirectPath and DCA (https://google.aip.dev/auth/4114) are ruled
out as options. If conditions to use S2A are not met (env variable not
set, or S2A is not running in environment, etc (`shouldUseS2A` returns
false)), fall back to default TLS connection.

When we are creating S2A-enabled Grpc Channel Credentials, we first try
to secure the connection between the client and the S2A via MTLS, using
[MTLS-MDS](https://cloud.google.com/compute/docs/metadata/overview#https-mds)
credentials. If MTLS-MDS credentials can't be loaded, then we fallback
to a plaintext connection between the client and S2A.

The parallel go implementation : googleapis/google-api-go-client#1874
(now lives here:
https://github.com/googleapis/google-cloud-go/blob/main/auth/internal/transport/cba.go)

S2A Java client: https://github.com/grpc/grpc-java/tree/master/s2a

Resolving b/376258193 means that S2A.java is no longer experimental
lqiu96 pushed a commit that referenced this pull request Feb 20, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.52.0</summary>

##
[2.52.0](v2.51.1...v2.52.0)
(2025-01-24)


### Features

* add support for new setAllowHardBoundTokens field.
([#3467](#3467))
([38431a2](38431a2))
* revert
[#3400](#3400):
reintroduce experimental S2A integration in client libraries grpc
transport
([#3548](#3548))
([65a0f11](65a0f11))


### Dependencies

* update dependency com.google.api-client:google-api-client-bom to
v2.7.2
([#3578](#3578))
([f6e5ad9](f6e5ad9))
* update dependency commons-codec:commons-codec to v1.17.2
([#3557](#3557))
([07ce801](07ce801))
* update dependency gitpython to v3.1.44
([#3559](#3559))
([e924db0](e924db0))
* update dependency org.checkerframework:checker-qual to v3.48.4
([#3560](#3560))
([a4726e9](a4726e9))
* update dependency smmap to v5.0.2
([#3561](#3561))
([6cd5d0d](6cd5d0d))
* update docker.io/library/alpine docker tag to v3.21.1
([#3551](#3551))
([edd5a4c](edd5a4c))
* update docker.io/library/alpine docker tag to v3.21.2
([#3580](#3580))
([f577ecd](f577ecd))
* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker
digest to 9a259c6
([#3554](#3554))
([eb2cbd6](eb2cbd6))
* update docker.io/library/python:3.13.1-alpine3.20 docker digest to
9ab3b6e
([#3555](#3555))
([40a74fe](40a74fe))
* update google auth library dependencies to v1.31.0
([#3577](#3577))
([7fa879a](7fa879a))
* update googleapis/java-cloud-bom digest to c7c443f
([#3579](#3579))
([fcf40b7](fcf40b7))
* update repo-automation-bots digest to 0a12b5d
([#3464](#3464))
([b9c9d21](b9c9d21))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request Feb 20, 2025
…ws (#3591)

Similar to implementation for DirectPath in
#3572.

This is part of the experimental S2A feature (see #3400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants