mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
Integrate Engine Proxy into E2E (#10808)
* add it in * support jwt secret * fix it * fix Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -31,14 +31,7 @@ func (e Endpoint) HttpClient() *http.Client {
|
||||
if e.Auth.Method != authorization.Bearer {
|
||||
return http.DefaultClient
|
||||
}
|
||||
authTransport := &jwtTransport{
|
||||
underlyingTransport: http.DefaultTransport,
|
||||
jwtSecret: []byte(e.Auth.Value),
|
||||
}
|
||||
return &http.Client{
|
||||
Timeout: DefaultRPCHTTPTimeout,
|
||||
Transport: authTransport,
|
||||
}
|
||||
return NewHttpClientWithSecret(e.Auth.Value)
|
||||
}
|
||||
|
||||
// Equals compares two authorization data objects for equality.
|
||||
@@ -70,3 +63,16 @@ func Method(auth string) authorization.AuthorizationMethod {
|
||||
}
|
||||
return authorization.None
|
||||
}
|
||||
|
||||
// NewHttpClientWithSecret returns a http client that utilizes
|
||||
// jwt authentication.
|
||||
func NewHttpClientWithSecret(secret string) *http.Client {
|
||||
authTransport := &jwtTransport{
|
||||
underlyingTransport: http.DefaultTransport,
|
||||
jwtSecret: []byte(secret),
|
||||
}
|
||||
return &http.Client{
|
||||
Timeout: DefaultRPCHTTPTimeout,
|
||||
Transport: authTransport,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user