Replies: 2 comments 3 replies
-
Hello! My use case: I maintain a library that uses |
Beta Was this translation helpful? Give feedback.
-
OK, I have dissected the HVAC adapter system while trying to understand and fix the cert auth code I wrote 2 years ago. I think I was the last one to make significantly meaningful changes with adapter.py. So I guess I use the default adapter but only after changing it for my own use case. I still don't think that the requests adapter that sits under our adapter is handling certs to the point of persistence. Without rewriting the client class to hold the auth certs and passing them back down when a new requests session is created I'm not sure that that issue can really be resolved fully. The other half of the issue is that the requests adapter "should" only need to have the certs attached for the duration of getting a token and use that from then on during the lifetime of that client instance. So while I don't have a love for the current system I also don't have any solutions for fixing the issues that it has either. I think the current system is a workable solution that does allow for customization but there is really no need to do so and you will likely break everything trying to fix it to your needs as I did. |
Beta Was this translation helpful? Give feedback.
-
While not thoroughly documented,
hvac
uses an "Adapter" system for the various API methods to interact with Vault's REST API:https://hvac.readthedocs.io/en/stable/advanced_usage.html#custom-requests-http-adapter
The idea is that you can pass an instance of any compliant Adapter to the
Client
.It defaults to an adapter called
JSONAdapter
, which is a subclass ofRawAdapter
(which usesrequests
).In theory, you can create your own Adapters by subclassing either of the above, or directly subclassing the abstract
Adapter
base class.https://hvac.readthedocs.io/en/stable/_modules/hvac/adapters.html
In practice, we've found that a number of assumptions are made in the API methods that do not make this as useful or flexible as it would seem.
I have a number of ideas in flight for changes and improvements to the Adapter system, but given the current state of things, it seems unlikely that we can do much of anything without making breaking changes in some places.
How you can help
hvac
has no telemetry, and so we have very little insight into exactly how people use it.I'm looking to get feedback on the Adapter system and how it's used by
hvac
's users, to help us determine the direction for library.Please choose the poll option that most closely resembles an accurate response.
In addition to the poll, please take the opportunity to write below with details!
I'd love to know:
Thank you!
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions