-
Notifications
You must be signed in to change notification settings - Fork 619
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
Add wsclient library to ecs-agent module #3690
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,11 @@ import ( | |
"time" | ||
|
||
"github.com/aws/amazon-ecs-agent/agent/config" | ||
"github.com/aws/amazon-ecs-agent/agent/utils" | ||
"github.com/aws/amazon-ecs-agent/agent/utils/cipher" | ||
"github.com/aws/amazon-ecs-agent/agent/wsclient/wsconn" | ||
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. Shouldn't imports of "github.com/aws/amazon-ecs-agent/agent/wsclient/wsconn" be updated to "github.com/aws/amazon-ecs-agent/ecs-agent/wsclient/wsconn" then we can remove the unused files in 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. I do not think it makes sense to switch just wsconn imports to ecs-agent/wsclient. The plan is to plug in the ecs-agent/wsclient with ecs-agent/tcs and ecs-agent/acs, and once we have the confidence in testing, we would completely remove the agent/wsclient package. It made sense to move the utils to avoid the cyclic dependency issue between agent and ecs-agent. 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. I was just thinking since the files in 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.
do we have a TODO for this anywhere (in code or in a tracking ticket)? Reply from RichaGangwar: |
||
"github.com/aws/amazon-ecs-agent/ecs-agent/logger" | ||
"github.com/aws/amazon-ecs-agent/ecs-agent/utils" | ||
"github.com/aws/amazon-ecs-agent/ecs-agent/utils/cipher" | ||
"github.com/aws/amazon-ecs-agent/ecs-agent/utils/httpproxy" | ||
|
||
"github.com/aws/aws-sdk-go/aws/credentials" | ||
"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" | ||
|
@@ -192,7 +193,7 @@ func (cs *ClientServerImpl) Connect() error { | |
ReadBufferSize: readBufSize, | ||
WriteBufferSize: writeBufSize, | ||
TLSClientConfig: tlsConfig, | ||
Proxy: utils.Proxy, | ||
Proxy: httpproxy.Proxy, | ||
NetDial: timeoutDialer.Dial, | ||
HandshakeTimeout: wsHandshakeTimeout, | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
// not use this file except in compliance with the License. A copy of the | ||
// License is located at | ||
// | ||
// http://aws.amazon.com/apache2.0/ | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
// Package cipher provides customized cipher configuration for agent client | ||
package cipher | ||
|
||
import ( | ||
"crypto/tls" | ||
) | ||
|
||
// Only support a subset of ciphers, corresponding cipher suite names can be found here: https://golang.org/pkg/crypto/tls/#Config | ||
var SupportedCipherSuites = []uint16{ | ||
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | ||
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, | ||
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, | ||
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, | ||
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | ||
tls.TLS_RSA_WITH_AES_128_GCM_SHA256, | ||
tls.TLS_RSA_WITH_AES_128_CBC_SHA256, | ||
tls.TLS_RSA_WITH_AES_128_CBC_SHA, | ||
tls.TLS_RSA_WITH_AES_256_GCM_SHA384, | ||
tls.TLS_RSA_WITH_AES_256_CBC_SHA, | ||
} | ||
|
||
func WithSupportedCipherSuites(config *tls.Config) { | ||
config.CipherSuites = SupportedCipherSuites | ||
} |
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.
will we be able to remove https://github.com/aws/amazon-ecs-agent/blob/master/agent/utils/httpproxy in a future pr?
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.
So, agent/utils/httpproxy is already moved to ecs-agent/utils/httpproxy as part of this PR. Is that what you are referring to Ray?