From 902af7be56cc410685713a3309f92a2ce030fab7 Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Wed, 30 Oct 2024 12:22:16 +0800 Subject: [PATCH 1/6] Bump from 1.7.0 to 1.29.0 in /plugins/repository-gcs Signed-off-by: Gao Binlong --- plugins/repository-gcs/build.gradle | 2 +- .../licenses/google-auth-library-credentials-1.29.0.jar.sha1 | 1 + .../licenses/google-auth-library-credentials-1.7.0.jar.sha1 | 1 - .../licenses/google-auth-library-oauth2-http-1.29.0.jar.sha1 | 1 + .../licenses/google-auth-library-oauth2-http-1.7.0.jar.sha1 | 1 - 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 plugins/repository-gcs/licenses/google-auth-library-credentials-1.29.0.jar.sha1 delete mode 100644 plugins/repository-gcs/licenses/google-auth-library-credentials-1.7.0.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.29.0.jar.sha1 delete mode 100644 plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.7.0.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index b90bcc7f822d1..3ed705bac95b4 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -48,7 +48,7 @@ opensearchplugin { } versions << [ - 'google_auth': '1.7.0' + 'google_auth': '1.29.0' ] dependencies { diff --git a/plugins/repository-gcs/licenses/google-auth-library-credentials-1.29.0.jar.sha1 b/plugins/repository-gcs/licenses/google-auth-library-credentials-1.29.0.jar.sha1 new file mode 100644 index 0000000000000..e2f931a1e876f --- /dev/null +++ b/plugins/repository-gcs/licenses/google-auth-library-credentials-1.29.0.jar.sha1 @@ -0,0 +1 @@ +19af4907301816d9328c1eb1fcc6dd05c8a0b544 \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-auth-library-credentials-1.7.0.jar.sha1 b/plugins/repository-gcs/licenses/google-auth-library-credentials-1.7.0.jar.sha1 deleted file mode 100644 index f2e9a4f7283bf..0000000000000 --- a/plugins/repository-gcs/licenses/google-auth-library-credentials-1.7.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b29af5a9ea94e9e7f86bded11e39f5afda5b17e8 \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.29.0.jar.sha1 b/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.29.0.jar.sha1 new file mode 100644 index 0000000000000..98d0d1beda43d --- /dev/null +++ b/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.29.0.jar.sha1 @@ -0,0 +1 @@ +2a42aead6cdc5d2cd22cdda1b9d7922e6135240f \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.7.0.jar.sha1 b/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.7.0.jar.sha1 deleted file mode 100644 index 738645d6b8c7b..0000000000000 --- a/plugins/repository-gcs/licenses/google-auth-library-oauth2-http-1.7.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -985d183303dbd4b7ceb348056e41e59677f6f74f \ No newline at end of file From baef6b55212a59382e835fa5cfcfcfeb99e9b36f Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Wed, 30 Oct 2024 13:25:12 +0800 Subject: [PATCH 2/6] Add change log Signed-off-by: Gao Binlong --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c8a34a90b62..fd0e763d0cdac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Switch from `buildSrc/version.properties` to Gradle version catalog (`gradle/libs.versions.toml`) to enable dependabot to perform automated upgrades on common libs ([#16284](https://github.com/opensearch-project/OpenSearch/pull/16284)) ### Dependencies +- Bump `google-auth-library-oauth2-http` from 1.7.0 to 1.29.0 in /plugins/repository-gcs ([#16520](https://github.com/opensearch-project/OpenSearch/pull/16520)) ### Changed From b773a8b0adf16983fe76be72ef394f65ad4879fb Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Thu, 31 Oct 2024 09:49:06 +0800 Subject: [PATCH 3/6] move version to top-level file Signed-off-by: Gao Binlong --- gradle/libs.versions.toml | 1 + plugins/repository-gcs/build.gradle | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8ff3f6e45397d..6b5c10e071d1e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,6 +24,7 @@ guava = "32.1.1-jre" protobuf = "3.25.5" jakarta_annotation = "1.3.5" google_http_client = "1.44.1" +google_auth = "1.29.0" tdigest = "3.3" hdrhistogram = "2.2.2" grpc = "1.68.0" diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 3ed705bac95b4..32419dff64558 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -47,10 +47,6 @@ opensearchplugin { classname 'org.opensearch.repositories.gcs.GoogleCloudStoragePlugin' } -versions << [ - 'google_auth': '1.29.0' -] - dependencies { api 'com.google.api:api-common:1.8.1' api 'com.google.api:gax:2.35.0' From 0195c1d97d90c97efafad2326001b30e5098a43d Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Thu, 31 Oct 2024 14:06:01 +0800 Subject: [PATCH 4/6] Fix build failure Signed-off-by: Gao Binlong --- plugins/repository-gcs/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 32419dff64558..d63592779d7d4 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -144,7 +144,6 @@ thirdPartyAudit { 'com.google.appengine.api.urlfetch.HTTPResponse', 'com.google.appengine.api.urlfetch.URLFetchService', 'com.google.appengine.api.urlfetch.URLFetchServiceFactory', - 'com.google.auth.oauth2.GdchCredentials', 'com.google.protobuf.util.JsonFormat', 'com.google.protobuf.util.JsonFormat$Parser', 'com.google.protobuf.util.JsonFormat$Printer', From 216eebed180e7e4cd0b0b2970479fbe4296a0576 Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Thu, 31 Oct 2024 15:42:41 +0800 Subject: [PATCH 5/6] Fix test failure Signed-off-by: Gao Binlong --- .../src/main/plugin-metadata/plugin-security.policy | 1 + .../repositories/gcs/GoogleCloudStorageServiceTests.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy b/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy index 48af969b04dc3..b4d34ce8ba683 100644 --- a/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy +++ b/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy @@ -43,4 +43,5 @@ grant { // gcs client set Authenticator for proxy username/password permission java.net.NetPermission "setDefaultAuthenticator"; + permission java.io.FilePermission "/sys/class/dmi/id/product_name", "read"; }; diff --git a/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageServiceTests.java b/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageServiceTests.java index 58e412684ed5a..b620f212df413 100644 --- a/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageServiceTests.java +++ b/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageServiceTests.java @@ -242,7 +242,7 @@ public void testApplicationDefaultCredentialsWhenNoSettingProvided() throws Exce Exception exception = assertThrows(IOException.class, GoogleCredentials::getApplicationDefault); assertNotNull(storageOptions); assertNull(storageOptions.getCredentials()); - MatcherAssert.assertThat(exception.getMessage(), containsString("The Application Default Credentials are not available")); + MatcherAssert.assertThat(exception.getMessage(), containsString("Your default credentials were not found")); } /** @@ -254,7 +254,7 @@ public void testDefaultCredentialsThrowsExceptionWithoutGCStorageService() { GoogleCredentials credentials = googleApplicationDefaultCredentials.get(); assertNull(credentials); Exception exception = assertThrows(IOException.class, GoogleCredentials::getApplicationDefault); - MatcherAssert.assertThat(exception.getMessage(), containsString("The Application Default Credentials are not available")); + MatcherAssert.assertThat(exception.getMessage(), containsString("Your default credentials were not found")); } /** From 107347e340ddfeecda09020bd9a3f62bea00292a Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Fri, 1 Nov 2024 22:09:02 +0800 Subject: [PATCH 6/6] Revert some change Signed-off-by: Gao Binlong --- plugins/repository-gcs/build.gradle | 7 +++++++ .../src/main/plugin-metadata/plugin-security.policy | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index d63592779d7d4..a44f6643c086a 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -299,6 +299,13 @@ testClusters { all testClustersConfiguration } +/** + * Used for testing getting credentials from GCE + */ +test { + environment 'NO_GCE_CHECK', 'true' +} + /* * We only use a small amount of data in these tests, which means that the resumable upload path is not tested. We add * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. diff --git a/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy b/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy index b4d34ce8ba683..48af969b04dc3 100644 --- a/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy +++ b/plugins/repository-gcs/src/main/plugin-metadata/plugin-security.policy @@ -43,5 +43,4 @@ grant { // gcs client set Authenticator for proxy username/password permission java.net.NetPermission "setDefaultAuthenticator"; - permission java.io.FilePermission "/sys/class/dmi/id/product_name", "read"; };