-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
New HTTP framework to incorporate automatic insecure connection handling #2100
Conversation
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 mostly LGTM, I think others should take a look though since it seems like an important change.
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java
Show resolved
Hide resolved
jib-core/src/test/java/com/google/cloud/tools/jib/http/ConnectionTest.java
Outdated
Show resolved
Hide resolved
...src/test/java/com/google/cloud/tools/jib/http/TlsFailoverHttpClientProxyCredentialsTest.java
Outdated
Show resolved
Hide resolved
jib-core/src/test/java/com/google/cloud/tools/jib/http/WithServerTlsFailoverHttpClientTest.java
Outdated
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.
Still looking, but some early comments
jib-core/src/main/java/com/google/cloud/tools/jib/http/Connection.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/http/Connection.java
Outdated
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.
Sorry haven't finished. But some more things.
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.
Some more.
Introducing thread-safe
TlsFailoverHttpClient
(still namedConnection
for now) designed to be instantiated as a singleton stateful instance throughout the Jib build life cycle.The TLS failover feature is decoupled from
RegistryEndpointCaller
and integrated intoTlsFailoverHttpClient
. The new client provides a complete abstraction for taking care of all possible TLS failover scenarios and controlling whether to send credentials over plain-HTTP.RegistryAuthenticator
will make use of the new client, so this will fix #2074.In the future, this setup will allow
Connection
always creates a new HttpTransport for each HTTP call, creating a new connection pool each time. But this might be intended, I don't know. Not changing this behavior now.