aws / aws/aws-sdk-java-v2

DataSync - Provided HttpClient not used in default sts client

Aperta
#2,271 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
bug needs-discussion p3 proxy
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Traccia la configurazione del builder di DataSyncAsyncClient e WebIdentityTokenFileCredentialsProvider per trovare dove viene creato il client STS sincrono predefinito. Riproduci il caso con un HttpClient personalizzato configurato per un proxy; il lavoro è completato quando la configurazione del client fornito viene rispettata dal percorso STS oppure viene supportato uno StsClient fornito dal chiamante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend, cloud, networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.