elasticsearch-rs
elasticsearch-rs copied to clipboard
[ENHANCEMENT] - ability to change credentials (type) for existing client
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.