Skip to content

Breakout Requests Functionality to New Adapter Module #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 19, 2018
Merged
Prev Previous commit
Next Next commit
Add initial guide/documentation around new adapter module
  • Loading branch information
Jeffrey Hogan committed Jul 18, 2018
commit e4c49cfee2523c222d609b17082ae01cdf34e540
7 changes: 7 additions & 0 deletions docs/advanced_usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Advanced Usage
==============

Custom Requests / HTTP Adapter
------------------------------

In hvac version 0.6.3, calls to the requests module (which provides the methods hvac utilizes to send HTTP/HTTPS request to Vault instances) were extracted from the :class:`Client <hvac.v1.Client>` class and moved to a newly added :meth:`hvac.adapters` module. The :class:`Client <hvac.v1.Client>` class itself defaults to an instance of the :class:`Request <hvac.adapters.Request>` class for its :attr:`_adapter <hvac.v1.Client._adapter>` private attribute attribute if no adapter argument is provided to its :meth:`constructor <hvac.v1.Client.__init__>`. This attribute provides an avenue for modifying the manner in which hvac completes request. To enable this type of customization, implement a class of type :meth:`hvac.adapters.Adapter`, override its abstract methods, and pass an instance of this custom class to the adapter argument of the :meth:`Client constructor <hvac.v1.Client.__init__>`
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Source code repository hosted at `github.com/ianunruh/hvac`_.

Readme <readme>
Examples <examples/examples>
advanced_usage
source/hvac
contributing
changelog
Expand Down