github-actions[bot] commented on code in PR #68540:
URL: https://github.com/apache/doris/pull/68540#discussion_r4334736846
##########
fe/fe-filesystem/fe-filesystem-gcs/src/main/java/org/apache/doris/filesystem/gcs/GcsFileSystemProvider.java:
##########
@@ -36,14 +42,111 @@
*
* <p>Selected explicitly by {@code provider=GCS}/{@code GCP} or {@code
fs.gcs.support=true};
* otherwise, when the user declared no filesystem explicitly, by
- * {@link S3CompatSignals#guessIsGcs} (a {@code gs.endpoint}, or an endpoint on
+ * {@link GcsAuthResolver#guessIsGcs} (a {@code gs.endpoint}, or an endpoint on
* {@code storage.googleapis.com}). Delegates I/O to {@link S3FileSystem}.
*/
public class GcsFileSystemProvider implements
FileSystemProvider<GcsFileSystemProperties> {
private static final String STORAGE_TYPE_GCS = "GCS";
private static final String FS_GCS_SUPPORT = "fs.gcs.support";
+ private static final Map<String, String> RESOURCE_ALIASES = Map.ofEntries(
+ Map.entry("gs.endpoint", "s3.endpoint"),
+ Map.entry("gs.access_key", "s3.access_key"),
+ Map.entry("gs.secret_key", "s3.secret_key"),
+ Map.entry("gs.session_token", "s3.session_token"),
+ Map.entry("gs.connection.maximum", "s3.connection.maximum"),
+ Map.entry("gs.connection.request.timeout",
"s3.connection.request.timeout"),
+ Map.entry("gs.connection.timeout", "s3.connection.timeout"),
+ Map.entry("gs.use_path_style", "use_path_style"),
+ Map.entry("gs.force_parsing_by_standard_uri",
"force_parsing_by_standard_uri"));
+
+ @Override
+ public Map<String, String> normalizeProperties(Map<String, String>
properties, Map<String, String> context) {
+ GcsAuthResolver.resolve(properties);
+ Map<String, String> normalized = new HashMap<>(properties);
+ String selected = context.get("provider");
+ if (selected == null || selected.isBlank()) {
+ if (!GcsAuthResolver.guessIsGcs(context)) {
+ normalized.keySet().removeAll(RESOURCE_ALIASES.keySet());
+ return normalized;
+ }
+ selected = "GCP";
+ normalized.put("provider", selected);
+ }
+ if ("GCP".equalsIgnoreCase(selected)) {
Review Comment:
[P2] Normalize aliases for the accepted GCS provider spelling
Starting from a working `provider=GCP` HMAC resource, `ALTER RESOURCE ...
PROPERTIES("provider"="GCS", "gs.access_key"="rotated-access",
"gs.secret_key"="rotated-secret", "s3_validity_check"="false")` succeeds, but
`selected=GCS` takes the branch that drops both `gs.*` key updates. The
persisted `s3.access_key`/`s3.secret_key` and the key pair pushed to BEs remain
the old values. The resolver and `S3ThriftAdapter` both accept GCS as the GCP
alias, so this looks like a successful key rotation and fails once the old key
is revoked. Normalize both provider spellings consistently and cover
ALTER/readback/policy push.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]