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

Implement authentication schemes and connection proxy #27

Closed russcam closed 4 years ago

russcam commented 4 years ago

This commit implements Basic, Bearer and Client Certificate authentication for the client, as well as the ability to specify a proxy for requests.

The different authentication schemes are modelled as a Credential enum with three variants. A ConnectionBuilder is introduced, to manage the complexity in building a Connection. Since the ConnectionBuilder provides a way to set appropriate values for the connection that will be built, it replaces the ConnectionSettings struct.

A follow up commit will introduce tests for these, once #26 is merged, which will allow inspection of HTTP headers.

Closes #15