-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[improvement](s3) Default S3 access to HTTPS #65379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -394,11 +394,7 @@ public static String extendGlobNumberRange(String pathPattern) { | |
| public static void validateAndTestEndpoint(String endpoint) throws UserException { | ||
| HttpURLConnection connection = null; | ||
| try { | ||
| String urlStr = endpoint; | ||
| // Add default protocol if not specified | ||
| if (!endpoint.startsWith("http://") && !endpoint.startsWith("https://")) { | ||
| urlStr = "http://" + endpoint; | ||
| } | ||
| String urlStr = buildEndpointUrl(endpoint); | ||
| endpoint = endpoint.replaceFirst("^http://", ""); | ||
| endpoint = endpoint.replaceFirst("^https://", ""); | ||
| List<String> whiteList = new ArrayList<>(Arrays.asList(Config.s3_load_endpoint_white_list)); | ||
|
|
@@ -434,6 +430,13 @@ public static void validateAndTestEndpoint(String endpoint) throws UserException | |
| } | ||
| } | ||
|
|
||
| public static String buildEndpointUrl(String endpoint) { | ||
| if (endpoint.contains("://")) { | ||
| return endpoint; | ||
| } | ||
| return "https://" + endpoint; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only changes the load/TVF endpoint validation path, but other scheme-less object-storage endpoints still keep the old HTTP behavior. For example, |
||
| } | ||
|
|
||
| /** | ||
| * Check if a path pattern is deterministic, meaning all file paths can be determined | ||
| * without listing. A pattern is deterministic if it contains no true wildcard characters | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildEndpointUrlalso runs for empty updates afterconvertToStdProperties, soALTER RESOURCE ... SET ("AWS_ENDPOINT" = "")(or"s3.endpoint" = "") is no longer ignored by the existingreplaceIfEffectiveValueguard.buildEndpointUrl("")returns the non-empty stringhttps://, and withs3_validity_check=falsethis gets written to both endpoint keys, leaving the resource with an invalid endpoint instead of preserving the old value. Please skip blank endpoint values before normalization, or validate/reject them before they can be persisted.