Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Improve error handling if Http Response has no content

We did get a NPE when an artifact repository returned `304`.

This should never happen but with this error handling we

at least see what went wrong.

  1. … 1 more file in changeset.
Close HttpResponse in finally block

GRADLE-3518

REVIEW-6201

Close responses from httpclient

Since Apache HttpClient 4.3 `(Closable)HttpResponse`s

need to be closed. Gradle has not been doing that after

the upgrade to HttpClient 4.4. This probably caused some

resource problems.

GRADLE-3518

  1. … 3 more files in changeset.
Merge pull request #690 from kiddouk:story/S3-repository-can-be-configured-to-authenticate-using-AWS-EC2-instance-metadata

S3 repository can authenticate using AWS EC2 instance metadata

* This is related to https://github.com/gradle/gradle/blob/c2dc9979706e6b3beca13f1de860834e9255fb1b/design-docs/finding-and-using-credentials.md#story-an-s3-repository-can-be-configured-to-authenticate-using-awss-ec2-instance-metadata

* Note that the AWS S3 Client implementation will now use the following

credentials (in this specific order)

- Environment (AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY,

AWS_SESSION_TOKEN)

- Java System Properties - aws.accessKeyId and aws.secretKey

- Credential profiles file at the default

location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

- Instance Profile Credentials - delivered through the Amazon EC2

metadata service

* The implementation assumes that only ONE authentication can be used

per s3-resource at a time

* This patch enforces that each Authentication now declares

`requiresCredentials` to be explicit

Integration tests:

Note that we cannot mock the instance meta data since it uses the ip

169.254.169.254 so we mock the system properties that the client

CredentialsProviderChain will look for.

  1. … 21 more files in changeset.
Replace usage of `String#format` with good old string concatenation

The rationale behind this change is that while `String#format` is usually admitted as good for readability (this is arguable),

in practice it is very bad for performance. Since Java 6, the JVM (the JIT, to be correct) does a pretty good job at optimizing

string concatenation. However, it is only capable to do so if we're using "dirty" string concatenations (using `+`), or `StringBuilder`.

However, usage of `StringBuilder` is not recommended either for 2 reasons:

1. it significantly decreases code readability

2. in Java 9, String concatenation is even more optimized thanks to `invokedynamic`, and code using `StringBuilder` will *not* benefit

from this optimization.

There are sill leftover `String#format` calls in the code, in the following cases:

- the call is used to generate an exception message. That's 90% of the remaining calls.

- the call is obviously a debug message, often used in `toString` (because as we all know, `toString` should only be used for debugging)

- the format includes specific number formatting patterns

- I missed it

  1. … 225 more files in changeset.
GRADLE-3424 Enable default httpclient retry handler

* GRADLE-3424 Enable default httpclient retry handler

  1. … 1 more file in changeset.
GRADLE-3424 Enable default httpclient retry handler

* GRADLE-3424 Enable default httpclient retry handler

  1. … 1 more file in changeset.
Add ability to revalidate external resource requests

The argument allows Cache-Control: max-age=0 to be added in cases where it's desirable for artifact repositories or caching proxies to revalidate requests:

- Listing version metadata

- Resource has exceeded it's cache lifetime on disk, such as dynamic/snapshot dependencies or when --refresh-dependencies is specified

  1. … 22 more files in changeset.
Merged internal `ResourceException` into public `ResourceException`.

  1. … 36 more files in changeset.
Renamed `o.g.internal.resource.Resource` to `TextResource`.

  1. … 34 more files in changeset.
Cleaned out a bunch of TODOs

  1. … 30 more files in changeset.
Use system default route planner when configuring http client

- This change will now use the appropriate proxy depending on the target URL

- This means HTTP proxy with be used for nonsecure connections and HTTPS proxy for secure connections, exclusively

- The old implementation used the HTTPS proxy for all connections if one was configured

Disable https tests for now.

+review REVIEW-5736

  1. … 1 more file in changeset.
Use fully-qualified @o.g.a.Incubating in packages

This is a less verbose, less awkward syntax and allows for simpler

programmatic addition / removal when neccessary.

    • -3
    • +1
    ./authentication/http/package-info.java
  1. … 35 more files in changeset.
Synchronize calls to close() as well

+review REVIEW-5736

Revert "Only synchronize client access when initializing"

This reverts commit d3c545239c9c810f659e398443cb3d2a020fde9e.

Only synchronize client access when initializing

+review REVIEW-5736

Fix potential thread safety issue

+review REVIEW-5736

Defer creating an http client until making an HTTP request.

+review REVIEW-5736

Add caching of ssl contexts

+review REVIEW-5736

    • -0
    • +23
    ./internal/resource/transport/http/SslContextFactory.java
  1. … 3 more files in changeset.
Make proxy configuration more explicit

- No longer rely on HttpClient to inspect system properties for proxy settings

- Use configuration attained from `JavaSystemPropertiesProxySettings` to configure HttpClient

- Prefer HTTPS proxy if one is defined otherwise we fallback to unsecure

+review REVIEW-5736

Update HttpClient to 4.4.1

- This bumps httpclient to 4.4.1 and httpcore to 4.4.4

- Update ':docs' subproject to use same httpclient version to avoid duplicate libraries in IntelliJ

- Incorporated fix for GRADLE-3029 by synchronizing access to 'java.home' system property

- This commit also resolves GRADLE-3250 since SNI support was added in httpclient 4.3.2

+review REVIEW-5736

  1. … 11 more files in changeset.
Revert "Update HttpClient to 4.4.1"

This reverts commit cbafb10057af801054f22f5ebd42853bc9e8817a.

  1. … 11 more files in changeset.
Update HttpClient to 4.4.1

- This bumps httpclient to 4.4.1 and httpcore to 4.4.4

- Update ':docs' subproject to use same httpclient version to avoid duplicate libraries in IntelliJ

- Incorporated fix for GRADLE-3029 by synchronizing access to 'java.home' system property

- This commit also resolves GRADLE-3250 since SNI support was added in httpclient 4.3.2

+review REVIEW-5736

  1. … 11 more files in changeset.
fix log statement formatting to use {} when applicable

+review REVIEW-5646

  1. … 16 more files in changeset.
Address review items for Authentication types

+review REVIEW-5569

    • -0
    • +2
    ./authentication/http/BasicAuthentication.java
    • -0
    • +2
    ./authentication/http/DigestAuthentication.java
  1. … 16 more files in changeset.
Close uploaded file quietly after publishing

+review REVIEW-5590

GRADLE-3333 - close files after reading for publishing via HTTP

Always try preemptive basic if basic auth is added

+review REVIEW-5574

  1. … 1 more file in changeset.
Check authentication types attempted with HttpServer

+review REVIEW-5574

  1. … 2 more files in changeset.
fix checkstyle

  1. … 1 more file in changeset.