-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Deprecate HTTP Download #9419
Deprecate HTTP Download #9419
Conversation
...rojects/core/src/integTest/groovy/org/gradle/api/resource/TextResourceIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
73f0e43
to
08d9272
Compare
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
subprojects/core-api/src/main/java/org/gradle/api/plugins/ObjectConfigurationAction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
fileSystem, | ||
clock | ||
); | ||
} |
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.
@eskatos The Kotlin DSL service logic now uses this method to create the DefaultFileOperations
to basically attempt to unify on the creation of this type. Before there were multiple different ways that this object was created across three languages. Now, at least the Kotlin DSL and the DefaultScript
for groovy are both using the same method.
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
return format(enclosingClass) + "." + aClass.getSimpleName(); | ||
} else { | ||
return aClass.getSimpleName(); | ||
} |
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.
This makes the exceptions a bit more informative when you have enclosing classes named something simple like Factory
.
...sources-http/src/main/java/org/gradle/internal/resource/transport/http/HttpClientHelper.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
subprojects/core/src/integTest/groovy/org/gradle/api/HttpScriptPluginIntegrationSpec.groovy
Outdated
Show resolved
Hide resolved
@adammurdoch @bigdaz How do we want to deal with the old |
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
@thc202 I've updated the description in PR header to describe the reasoning behind this work now that my article is finally public. Go have a look. |
* master: (225 commits) Document the purpose of PublicApi.kt Mention Eclipse test sources as a potential breaking change in the upgrade notes. Fixed managed property generation for `Property<T>` types where `T` is a parameterized type. Update library/language versions used by build-init templates. Remove the instant execution cache file when there is a failure writing to the cache file. Disallow references to `ConfigurationContainer` from tasks serialized to the instant execution cache. Recognize contributor Publish 5.5-20190620010535+0000 Fix small typo in the feature variants chapter of the user guide Rebaseline instant-execution performance tests Refine MethodCodec Polish task actions test Polish BeanSchema Temporarily ignore instant execution performance tests Refine ClassLoaderCacheInternal Tidy up DefaultInstantExecution & DefaultClassLoaderCache Add some coverage for captured task actions Dehydrate Closure and fix BeanSchema for task actions Add MethodCodec for serializing StandardTaskAction Let BeanSchema include AbstractTask.actions ... Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gradle.com>
* master: (33 commits) Implicitly finalize the value of task properties with type `ConfigurableFileCollection` when task execution commences, as is done for `Property` types. Change the implementation of `ConfigurableFileCollection.finalizeValue()` so that only the locations are finalized, not the set of files. Separate out some shared behaviour from the `FileCollectionResolveContext` implementations. Add `ConfigurableFileCollection.finalizeValue()` to allow the value of the file collection to be finalized. Remove unnecessary check. Fix failure with older versions of PMD that try to enable incremental analysis Publish 5.5-20190621010023+0000 Fix link syntax in upgrade guide Recognize contributor Polish on release notes and upgrade guide More reliably extract PMD version Remove spurious printlns from test build Use recommended Kotlin DSL syntax in test Rebaseline `help on the gradle build comparing the build` Add missing property annotation Fix unit test to expect a Provider<Boolean> Add contribution notice for PMD incremental cache Workaround issues with PMD inspecting Gradle's classpath Rework after reintroducing reverted changes Revert "Revert "Support PMD's analysis cache (gradle#2223)" and "Improve test coverage for pmd incremental analysis (gradle#2961)" (gradle#3125)" ...
subprojects/base-services/src/main/java/org/gradle/internal/service/DefaultServiceRegistry.java
Show resolved
Hide resolved
subprojects/build-cache-http/src/main/java/org/gradle/caching/http/HttpBuildCache.java
Outdated
Show resolved
Hide resolved
...rojects/core/src/integTest/groovy/org/gradle/api/resource/TextResourceIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
.../groovy/org/gradle/integtests/resolve/http/HttpsToHttpsRedirectResolveIntegrationTest.groovy
Show resolved
Hide resolved
* Additionally, in the rare case that a user or a plugin author truly needs to test with a localhost | ||
* server, they can use http://127.0.0.1 | ||
*/ | ||
if ("127.0.0.1".equals(url.getHost())) { |
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.
what about IPV6?
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.
This bypass is pretty much for our testing exclusively. It's not even going to be an externally documented feature.
If it's important, I can update this if you think I should.
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.
Not important for me, just wanted to point out that it's a possibility, too.
...sources-http/src/main/java/org/gradle/internal/resource/transport/http/HttpClientHelper.java
Outdated
Show resolved
Hide resolved
...rg/gradle/integtests/tooling/r40/ProjectConfigurationChildrenProgressCrossVersionSpec.groovy
Show resolved
Hide resolved
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.
We should rollback the changes to ObjectConfigurationAction and the TextResources since this seems to ripple into a lot of different areas. In those cases, we should just always produce a warning/deprecation and not allow for an opt-out.
For script plugins applied over http, these should migrate to https (at least) or proper binary plugins or live with a warning. I don't think it's worth the confusion over having to do enable a flag.
For text resources being loaded over http, I think the argument is similar. Maybe it would be useful to have a fromInsecureUri(...)
, but let's see if that's actually onerous.
When we clamp down on HTTP, we can revisit this to see if we need to still allow some HTTP (with warnings) or provide more opt-in configuration options.
subprojects/base-services/src/main/java/org/gradle/internal/service/DefaultServiceRegistry.java
Show resolved
Hide resolved
subprojects/build-cache-http/src/main/java/org/gradle/caching/http/HttpBuildCache.java
Outdated
Show resolved
Hide resolved
* </a> | ||
* </b> | ||
*/ | ||
void allowInsecureProtocol(boolean allowInsecureProtocol); |
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.
I think this should either be setAllowInsecureProtocol(boolean)
(allow or disallow insecure protocols) or allowInsecureProtocol()
(allow insecure protocols to be used). I think we want the first option.
...sources-http/src/main/java/org/gradle/internal/resource/transport/http/HttpClientHelper.java
Outdated
Show resolved
Hide resolved
* master: (146 commits) Publish 5.5-20190701010031+0000 Enable Groovy compilation avoidance for Groovy template project (gradle#9816) Publish 5.5-20190630025152+0000 Publish 5.5-20190629014809+0000 Allow property replacement in version strings in the `plugins` block Update notes.md Publish 5.5 Polish comment Alter PULL_REQUEST_TEMPLATE to simplify issue resolution Address reviews Add member Github issue template for the build-cache team Cleanup contributor issue templates Add 'Fixes' to the PR template Rename compilePluginClasspath to astTransformationClasspath (gradle#9794) Enable compilation avoidance for Groovy performance tests Publish 5.5-20190628010030+0000 Fix example of generated resources Provide the line-number of the plugins block when invoking Remove unused `BuildScriptMetadata` Polish `InitialPassStatementTransformer` ...
@big-guy Looks like just performance failures. 🤔 |
This was reverted and introduced back as #10065 |
Reasoning
After a 4-month research project into the supply chain security of the JVM ecosystem I published this writeup Want to take over the Java ecosystem? All you need is a MITM!
The project details how some of the most popular projects in the JVM ecosystem were using HTTP instead of HTTPS to download their dependencies.
The goal of this PR is to help close this widespread vulnerability impacting a huge swath of the JVM ecosystem.
New API
This PR adds a few new API's to various places that allow Gradle to download code over HTTP in the cases where it's necessary.
Similar API's have been added to the
HttpBuildCache
and theTextResourceFactory
.Locations Not Covered By this PR
These should be handled in a follow-on PR.
Wrapper
taskContributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew <changed-subproject>:check
Gradle Core Team Checklist