elastic / elasticsearch-rs

Official Elasticsearch Rust Client
https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/index.html
Apache License 2.0
705 stars 72 forks source link

Extract credentials passed in Url #147

Closed russcam closed 1 month ago

russcam commented 4 years ago

This commit extracts the credentials passed in a Url and uses them to pass Basic Credentials when constructing the single node Transport, as well as constructing a client for elasticsearch integration tests.

Leaving the credentials in the Url and also configuring credentials through .auth() fn, results in reqwest sending two Authorization headers.

russcam commented 4 years ago

I think it might be good to expose a function somewhere that accepts a Url and returns a (Url, Option<Credentials>), as this operation may need to be performed for all Uris passed to construct a multi node connection pool when #139 lands.