PKG-INFO 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. Metadata-Version: 1.0
  2. Name: requests-kerberos
  3. Version: 0.12.0
  4. Summary: A Kerberos authentication handler for python-requests
  5. Home-page: https://github.com/requests/requests-kerberos
  6. Author: Ian Cordasco, Cory Benfield, Michael Komitee
  7. Author-email: graffatcolmingov@gmail.com
  8. License: UNKNOWN
  9. Description-Content-Type: UNKNOWN
  10. Description: requests Kerberos/GSSAPI authentication library
  11. ===============================================
  12. .. image:: https://travis-ci.org/requests/requests-kerberos.svg?branch=master
  13. :target: https://travis-ci.org/requests/requests-kerberos
  14. .. image:: https://coveralls.io/repos/github/requests/requests-kerberos/badge.svg?branch=master
  15. :target: https://coveralls.io/github/requests/requests-kerberos?branch=master
  16. Requests is an HTTP library, written in Python, for human beings. This library
  17. adds optional Kerberos/GSSAPI authentication support and supports mutual
  18. authentication. Basic GET usage:
  19. .. code-block:: python
  20. >>> import requests
  21. >>> from requests_kerberos import HTTPKerberosAuth
  22. >>> r = requests.get("http://example.org", auth=HTTPKerberosAuth())
  23. ...
  24. The entire ``requests.api`` should be supported.
  25. Authentication Failures
  26. -----------------------
  27. Client authentication failures will be communicated to the caller by returning
  28. the 401 response.
  29. Mutual Authentication
  30. ---------------------
  31. REQUIRED
  32. ^^^^^^^^
  33. By default, ``HTTPKerberosAuth`` will require mutual authentication from the
  34. server, and if a server emits a non-error response which cannot be
  35. authenticated, a ``requests_kerberos.errors.MutualAuthenticationError`` will
  36. be raised. If a server emits an error which cannot be authenticated, it will
  37. be returned to the user but with its contents and headers stripped. If the
  38. response content is more important than the need for mutual auth on errors,
  39. (eg, for certain WinRM calls) the stripping behavior can be suppressed by
  40. setting ``sanitize_mutual_error_response=False``:
  41. .. code-block:: python
  42. >>> import requests
  43. >>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
  44. >>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, sanitize_mutual_error_response=False)
  45. >>> r = requests.get("https://windows.example.org/wsman", auth=kerberos_auth)
  46. ...
  47. OPTIONAL
  48. ^^^^^^^^
  49. If you'd prefer to not require mutual authentication, you can set your
  50. preference when constructing your ``HTTPKerberosAuth`` object:
  51. .. code-block:: python
  52. >>> import requests
  53. >>> from requests_kerberos import HTTPKerberosAuth, OPTIONAL
  54. >>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
  55. >>> r = requests.get("http://example.org", auth=kerberos_auth)
  56. ...
  57. This will cause ``requests_kerberos`` to attempt mutual authentication if the
  58. server advertises that it supports it, and cause a failure if authentication
  59. fails, but not if the server does not support it at all.
  60. DISABLED
  61. ^^^^^^^^
  62. While we don't recommend it, if you'd prefer to never attempt mutual
  63. authentication, you can do that as well:
  64. .. code-block:: python
  65. >>> import requests
  66. >>> from requests_kerberos import HTTPKerberosAuth, DISABLED
  67. >>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
  68. >>> r = requests.get("http://example.org", auth=kerberos_auth)
  69. ...
  70. Preemptive Authentication
  71. -------------------------
  72. ``HTTPKerberosAuth`` can be forced to preemptively initiate the Kerberos
  73. GSS exchange and present a Kerberos ticket on the initial request (and all
  74. subsequent). By default, authentication only occurs after a
  75. ``401 Unauthorized`` response containing a Kerberos or Negotiate challenge
  76. is received from the origin server. This can cause mutual authentication
  77. failures for hosts that use a persistent connection (eg, Windows/WinRM), as
  78. no Kerberos challenges are sent after the initial auth handshake. This
  79. behavior can be altered by setting ``force_preemptive=True``:
  80. .. code-block:: python
  81. >>> import requests
  82. >>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
  83. >>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, force_preemptive=True)
  84. >>> r = requests.get("https://windows.example.org/wsman", auth=kerberos_auth)
  85. ...
  86. Hostname Override
  87. -----------------
  88. If communicating with a host whose DNS name doesn't match its
  89. kerberos hostname (eg, behind a content switch or load balancer),
  90. the hostname used for the Kerberos GSS exchange can be overridden by
  91. setting the ``hostname_override`` arg:
  92. .. code-block:: python
  93. >>> import requests
  94. >>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
  95. >>> kerberos_auth = HTTPKerberosAuth(hostname_override="internalhost.local")
  96. >>> r = requests.get("https://externalhost.example.org/", auth=kerberos_auth)
  97. ...
  98. Explicit Principal
  99. ------------------
  100. ``HTTPKerberosAuth`` normally uses the default principal (ie, the user for
  101. whom you last ran ``kinit`` or ``kswitch``, or an SSO credential if
  102. applicable). However, an explicit principal can be specified, which will
  103. cause Kerberos to look for a matching credential cache for the named user.
  104. This feature depends on OS support for collection-type credential caches,
  105. as well as working principal support in PyKerberos (it is broken in many
  106. builds). An explicit principal can be specified with the ``principal`` arg:
  107. .. code-block:: python
  108. >>> import requests
  109. >>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
  110. >>> kerberos_auth = HTTPKerberosAuth(principal="user@REALM")
  111. >>> r = requests.get("http://example.org", auth=kerberos_auth)
  112. ...
  113. On Windows, WinKerberos is used instead of PyKerberos. WinKerberos allows the
  114. use of arbitrary principals instead of a credential cache. Passwords can be
  115. specified by following the form ``user@realm:password`` for ``principal``.
  116. Delegation
  117. ----------
  118. ``requests_kerberos`` supports credential delegation (``GSS_C_DELEG_FLAG``).
  119. To enable delegation of credentials to a server that requests delegation, pass
  120. ``delegate=True`` to ``HTTPKerberosAuth``:
  121. .. code-block:: python
  122. >>> import requests
  123. >>> from requests_kerberos import HTTPKerberosAuth
  124. >>> r = requests.get("http://example.org", auth=HTTPKerberosAuth(delegate=True))
  125. ...
  126. Be careful to only allow delegation to servers you trust as they will be able
  127. to impersonate you using the delegated credentials.
  128. Logging
  129. -------
  130. This library makes extensive use of Python's logging facilities.
  131. Log messages are logged to the ``requests_kerberos`` and
  132. ``requests_kerberos.kerberos_`` named loggers.
  133. If you are having difficulty we suggest you configure logging. Issues with the
  134. underlying kerberos libraries will be made apparent. Additionally, copious debug
  135. information is made available which may assist in troubleshooting if you
  136. increase your log level all the way up to debug.
  137. History
  138. =======
  139. 0.12.0: 2017-12-20
  140. ------------------------
  141. - Add support for channel binding tokens (assumes pykerberos support >= 1.2.1)
  142. - Add support for kerberos message encryption (assumes pykerberos support >= 1.2.1)
  143. - Misc CI/test fixes
  144. 0.11.0: 2016-11-02
  145. ------------------
  146. - Switch dependency on Windows from kerberos-sspi/pywin32 to WinKerberos.
  147. This brings Custom Principal support to Windows users.
  148. 0.10.0: 2016-05-18
  149. ------------------
  150. - Make it possible to receive errors without having their contents and headers
  151. stripped.
  152. - Resolve a bug caused by passing the ``principal`` keyword argument to
  153. kerberos-sspi on Windows.
  154. 0.9.0: 2016-05-06
  155. -----------------
  156. - Support for principal, hostname, and realm override.
  157. - Added support for mutual auth.
  158. 0.8.0: 2016-01-07
  159. -----------------
  160. - Support for Kerberos delegation.
  161. - Fixed problems declaring kerberos-sspi on Windows installs.
  162. 0.7.0: 2015-05-04
  163. -----------------
  164. - Added Windows native authentication support by adding kerberos-sspi as an
  165. alternative backend.
  166. - Prevent infinite recursion when a server returns 401 to an authorization
  167. attempt.
  168. - Reduce the logging during successful responses.
  169. 0.6.1: 2014-11-14
  170. -----------------
  171. - Fix HTTPKerberosAuth not to treat non-file as a file
  172. - Prevent infinite recursion when GSSErrors occurs
  173. 0.6: 2014-11-04
  174. ---------------
  175. - Handle mutual authentication (see pull request 36_)
  176. All users should upgrade immediately. This has been reported to
  177. oss-security_ and we are awaiting a proper CVE identifier.
  178. **Update**: We were issued CVE-2014-8650
  179. - Distribute as a wheel.
  180. .. _36: https://github.com/requests/requests-kerberos/pull/36
  181. .. _oss-security: http://www.openwall.com/lists/oss-security/
  182. 0.5: 2014-05-14
  183. ---------------
  184. - Allow non-HTTP service principals with HTTPKerberosAuth using a new optional
  185. argument ``service``.
  186. - Fix bug in ``setup.py`` on distributions where the ``compiler`` module is
  187. not available.
  188. - Add test dependencies to ``setup.py`` so ``python setup.py test`` will work.
  189. 0.4: 2013-10-26
  190. ---------------
  191. - Minor updates in the README
  192. - Change requirements to depend on requests above 1.1.0
  193. 0.3: 2013-06-02
  194. ---------------
  195. - Work with servers operating on non-standard ports
  196. 0.2: 2013-03-26
  197. ---------------
  198. - Not documented
  199. 0.1: Never released
  200. -------------------
  201. - Initial Release
  202. Platform: UNKNOWN