aws / aws/aws-sdk-java-v2

DataSync - Provided HttpClient not used in default sts client

Offen
#2,271 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug needs-discussion p3 proxy
Vorherrschende Sprache
Java
Sterne
2.6k
Forks
1k
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
51

Beschreibung

Okay, so I think this is a bug, because it doesn't make a lot of sense.
I need to use proxy, so when creating DataSyncAsyncClient I'm providing my custom httpClient, where I set proxy configuration.
I'm also using WebIdentityTokenFileCredentialsProvider. Code is something like that:
```
DataSyncAsyncClient.builder()
.httpClient(NettyNioAsyncHttpClient.builder()
.proxyConfiguration(ProxyConfiguration.builder()
...)
...)
.credentialsProvider(WebIdentityTokenFileCredentialsProvider.create())
.build();
```
Now the problem is that later, somewhere down the line, the `DefaultStsClient` is created beneath, but it doesn't use the proxy settings at all.
I had to do a workaround of setting program arguments like `http(s).proxy(Host, Port, Set)` - those seem to be respected across sdk.
But I would really prefer not to do that, because of a couple of reasons, which aren't that important here.

An additional issue, I think, is that created `DataSyncAsyncClient` uses a sync `DefaultStsClient` client beneath, while everything in my configuration is async.

I'd expect the http client that I'm passing to be used, including it being async + the configuration that I've set. Alternatively, just provide my own implementation of StsClient to DataSyncAsyncClient.

I'm running aws sdk version `2.15.69` on mac `Catalina 10.15.7` running on java `graalvm-ce-java11-20.3.0` but I encounter the same issue running it on rhel with openjdk 11.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Verfolge die Builder-Konfiguration von DataSyncAsyncClient und WebIdentityTokenFileCredentialsProvider, um herauszufinden, wo der standardmäßige synchrone STS-Client erstellt wird. Reproduziere den Fall mit einem benutzerdefinierten, für einen Proxy konfigurierten HttpClient; abgeschlossen ist die Aufgabe, wenn die Konfiguration des bereitgestellten Clients vom STS-Pfad berücksichtigt wird oder ein vom Aufrufer bereitgestellter StsClient unterstützt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
backend, cloud, networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.