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

[ENHANCEMENT] - ability to change credentials (type) for existing client #186

Open raybog opened 2 years ago

raybog commented 2 years ago

Is your feature request related to a problem? Please describe. Credentials are static and set when connection/client to ES is created.

Describe the solution you'd like It should be possible to change the Credentials on each API call e.g.: some_connection.transport().setCredentials(Credentials::Bearer(some_token)).get(GetParts::IndexId(&INDEX, &id)).pretty(true).send().await?

Describe alternatives you've considered Creating a new connection on each request when different Credentials has to be used.