Skip to content

Commit 5512447

Browse files
committed
fixup! fixup! Add gcs.auth-type configuration
1 parent fe32067 commit 5512447

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

docs/src/main/sphinx/object-storage/file-system-gcs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Cloud Storage:
7474
* - `gcs.auth-type`
7575
- Authentication type to use for Google Cloud Storage access. Default to `DEFAULT`.
7676
Supported values are:
77-
* `DEFAULT`: loads credentials from the environment. Either `gcs.json-key` or
77+
* `SERVICE_ACCOUNT`: loads credentials from the environment. Either `gcs.json-key` or
7878
`gcs.json-key-file-path` can be set in addition to override the default
7979
credentials provider.
8080
* `ACCESS_TOKEN`: usage of client-provided OAuth 2.0 token to access Google

lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsFileSystemConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public boolean isAuthMethodValid()
305305
}
306306

307307
@AssertFalse(message = "Cannot set both gcs.use-access-token and gcs.auth-type")
308-
public boolean areAuthTypeAndGcsAccessTokenConfigured()
308+
public boolean isAuthTypeAndGcsAccessTokenConfigured()
309309
{
310310
return authType.isPresent() && useGcsAccessToken.isPresent();
311311
}

lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsFileSystemConfig.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io.airlift.units.DataSize;
1818
import io.airlift.units.Duration;
1919
import io.trino.filesystem.gcs.GcsFileSystemConfig.AuthType;
20+
import jakarta.validation.constraints.AssertFalse;
2021
import jakarta.validation.constraints.AssertTrue;
2122
import org.junit.jupiter.api.Test;
2223

@@ -169,32 +170,32 @@ public void testValidation()
169170
new GcsFileSystemConfig()
170171
.setAuthType(AuthType.ACCESS_TOKEN)
171172
.setUseGcsAccessToken(true),
172-
"authTypeAndUseGcsAccessTokenMutuallyExclusive",
173+
"authTypeAndGcsAccessTokenConfigured",
173174
"Cannot set both gcs.use-access-token and gcs.auth-type",
174-
AssertTrue.class);
175+
AssertFalse.class);
175176

176177
assertFailsValidation(
177178
new GcsFileSystemConfig()
178179
.setAuthType(AuthType.ACCESS_TOKEN)
179180
.setUseGcsAccessToken(false),
180-
"authTypeAndUseGcsAccessTokenMutuallyExclusive",
181+
"authTypeAndGcsAccessTokenConfigured",
181182
"Cannot set both gcs.use-access-token and gcs.auth-type",
182-
AssertTrue.class);
183+
AssertFalse.class);
183184

184185
assertFailsValidation(
185186
new GcsFileSystemConfig()
186187
.setUseGcsAccessToken(true)
187188
.setAuthType(AuthType.SERVICE_ACCOUNT),
188-
"authTypeAndUseGcsAccessTokenMutuallyExclusive",
189+
"authTypeAndGcsAccessTokenConfigured",
189190
"Cannot set both gcs.use-access-token and gcs.auth-type",
190-
AssertTrue.class);
191+
AssertFalse.class);
191192

192193
assertFailsValidation(
193194
new GcsFileSystemConfig()
194195
.setUseGcsAccessToken(false)
195196
.setAuthType(AuthType.SERVICE_ACCOUNT),
196-
"authTypeAndUseGcsAccessTokenMutuallyExclusive",
197+
"authTypeAndGcsAccessTokenConfigured",
197198
"Cannot set both gcs.use-access-token and gcs.auth-type",
198-
AssertTrue.class);
199+
AssertFalse.class);
199200
}
200201
}

0 commit comments

Comments
 (0)