oasis-open / cti-taxii-client

OASIS TC Open Repository: TAXII 2 Client Library Written in Python
https://taxii2client.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
107 stars 54 forks source link

Basic Auth #119

Open patrick-kinsella-rf opened 3 months ago

patrick-kinsella-rf commented 3 months ago

Possible to update to support basic auth?

Token would need to be Basic: https://github.com/oasis-open/cti-taxii-client/blob/54dabadf1a67517e99e6a8f2961614a2a4f5ad2c/taxii2client/common.py#L143

andrewbeard commented 3 weeks ago

You don't need to add it, it's already there. The TokenAuth object implements an authentication type that isn't supported by the underlying requests library, but the HTTPBasicAuth module (already part of requests) does exactly what you want. https://requests.readthedocs.io/en/latest/user/authentication/

You can even see it being used as part of the existing code here: https://github.com/oasis-open/cti-taxii-client/blob/54dabadf1a67517e99e6a8f2961614a2a4f5ad2c/taxii2client/common.py#L267