{ "info": { "author": "Ian Cordasco, Cory Benfield, Michael Komitee, Robbie Harwood", "author_email": "rharwood@redhat.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: ISC License (ISCL)" ], "description": "requests GSSAPI authentication library\n===============================================\n\nRequests is an HTTP library, written in Python, for human beings. This library\nadds optional GSSAPI authentication support and supports mutual\nauthentication.\n\nIt provides a fully backward-compatible shim for the old\npython-requests-kerberos library: simply replace ``import requests_kerberos``\nwith ``import requests_gssapi``. A more powerful interface is provided by the\nHTTPSPNEGOAuth component, but this is of course not guaranteed to be\ncompatible. Documentation below is written toward the new interface.\n\nBasic GET usage:\n\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth\n >>> r = requests.get(\"http://example.org\", auth=HTTPSPNEGOAuth())\n ...\n\nThe entire ``requests.api`` should be supported.\n\nAuthentication Failures\n-----------------------\n\nClient authentication failures will be communicated to the caller by returning\nthe 401 response.\n\nMutual Authentication\n---------------------\n\nMutual authentication is a poorly-named feature of the GSSAPI which doesn't\nprovide any additional security benefit to most possible uses of\nrequests_gssapi. Practically speaking, in most mechanism implementations\n(including krb5), it requires another round-trip between the client and server\nduring the authentication handshake. Many clients and servers do not properly\nhandle the authentication handshake taking more than one round-trip. If you\nencounter a MutualAuthenticationError, this is probably why.\n\nSo long as you're running over a TLS link whose security guarantees you trust,\nthere's no benefit to mutual authentication. If you don't trust the link at\nall, mutual authentication won't help (since it's not tamper-proof, and GSSAPI\nisn't being used post-authentication. There's some middle ground between the\ntwo where it helps a small amount (e.g., passive adversary over\nencrypted-but-unverified channel), but for Negotiate (what we're doing here),\nit's not generally helpful.\n\nFor a more technical explanation of what mutual authentication actually\nguarantees, I refer you to rfc2743 (GSSAPIv2), rfc4120 (krb5 in GSSAPI),\nrfc4178 (SPNEGO), and rfc4559 (HTTP Negotiate).\n\n\nDISABLED\n^^^^^^^^\n\nBy default, there's no need to explicitly disable mutual authentication.\nHowever, for compatability with older versions of request_gssapi or\nrequests_kerberos, you can explicitly request it not be attempted:\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, DISABLED\n >>> gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED)\n >>> r = requests.get(\"https://example.org\", auth=gssapi_auth)\n ...\n\nREQUIRED\n^^^^^^^^\n\nThis was historically the default, but no longer is. If requested,\n``HTTPSPNEGOAuth`` will require mutual authentication from the server, and if\na server emits a non-error response which cannot be authenticated, a\n``requests_gssapi.errors.MutualAuthenticationError`` will be raised. (See\nabove for what this means.) If a server emits an error which cannot be\nauthenticated, it will be returned to the user but with its contents and\nheaders stripped. If the response content is more important than the need for\nmutual auth on errors, (eg, for certain WinRM calls) the stripping behavior\ncan be suppressed by setting ``sanitize_mutual_error_response=False``:\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, REQUIRED\n >>> gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=REQUIRED, sanitize_mutual_error_response=False)\n >>> r = requests.get(\"https://windows.example.org/wsman\", auth=gssapi_auth)\n ...\n\nOPTIONAL\n^^^^^^^^\n\nThis will cause ``requests_gssapi`` to attempt mutual authentication if the\nserver advertises that it supports it, and cause a failure if authentication\nfails, but not if the server does not support it at all. This is probably not\nwhat you want: link tampering will either cause hard failures, or silently\ncause it to not happen at all. It is retained for compatability.\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, OPTIONAL\n >>> gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=OPTIONAL)\n >>> r = requests.get(\"https://example.org\", auth=gssapi_auth)\n ...\n\nOpportunistic Authentication\n----------------------------\n\n``HTTPSPNEGOAuth`` can be forced to preemptively initiate the GSSAPI\nexchange and present a token on the initial request (and all\nsubsequent). By default, authentication only occurs after a\n``401 Unauthorized`` response containing a Negotiate challenge\nis received from the origin server. This can cause mutual authentication\nfailures for hosts that use a persistent connection (eg, Windows/WinRM), as\nno GSSAPI challenges are sent after the initial auth handshake. This\nbehavior can be altered by setting ``opportunistic_auth=True``:\n\n.. code-block:: python\n \n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, REQUIRED\n >>> gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=REQUIRED, opportunistic_auth=True)\n >>> r = requests.get(\"https://windows.example.org/wsman\", auth=gssapi_auth)\n ...\n\nHostname Override\n-----------------\n\nIf communicating with a host whose DNS name doesn't match its\nhostname (eg, behind a content switch or load balancer),\nthe hostname used for the GSSAPI exchange can be overridden by\npassing in a custom name (string or ``gssapi.Name``):\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, REQUIRED\n >>> gssapi_auth = HTTPSPNEGOAuth(target_name=\"internalhost.local\")\n >>> r = requests.get(\"https://externalhost.example.org/\", auth=gssapi_auth)\n ...\n\nExplicit Principal\n------------------\n\n``HTTPSPNEGOAuth`` normally uses the default principal (ie, the user for whom\nyou last ran ``kinit`` or ``kswitch``, or an SSO credential if\napplicable). However, an explicit credential can be in instead, if desired.\n\n.. code-block:: python\n\n >>> import gssapi\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth, REQUIRED\n >>> name = gssapi.Name(\"user@REALM\", gssapi.NameType.hostbased_service)\n >>> creds = gssapi.Credentials(name=name, usage=\"initiate\")\n >>> gssapi_auth = HTTPSPNEGOAuth(creds=creds)\n >>> r = requests.get(\"http://example.org\", auth=gssapi_auth)\n ...\n\nDelegation\n----------\n\n``requests_gssapi`` supports credential delegation (``GSS_C_DELEG_FLAG``).\nTo enable delegation of credentials to a server that requests delegation, pass\n``delegate=True`` to ``HTTPSPNEGOAuth``:\n\n.. code-block:: python\n\n >>> import requests\n >>> from requests_gssapi import HTTPSPNEGOAuth\n >>> r = requests.get(\"http://example.org\", auth=HTTPSPNEGOAuth(delegate=True))\n ...\n\nBe careful to only allow delegation to servers you trust as they will be able\nto impersonate you using the delegated credentials.\n\nLogging\n-------\n\nThis library makes extensive use of Python's logging facilities.\n\nLog messages are logged to the ``requests_gssapi`` and\n``requests_gssapi.gssapi`` named loggers.\n\nIf you are having difficulty we suggest you configure logging. Issues with the\nunderlying GSSAPI libraries will be made apparent. Additionally, copious debug\ninformation is made available which may assist in troubleshooting if you\nincrease your log level all the way up to debug.\n\n\nHistory\n=======\n\n1.1.0: 2019-05-21\n-----------------\n\n- Disable mutual authentication by default\n- Add more documentation on MutualAuthenticationError\n\n1.0.1: 2019-04-10\n-----------------\n\n- Fix example in README\n- Fix license detection for PyPI\n- Fix a problem with regex escaping\n- Add COPR Makefile target\n\n1.0.0: 2017-12-14\n-----------------\n\n- Fork project to requests-gssapi\n- Replace pykerberos with python-gssapi\n- Add HTTPSPNEGOAuth interface. HTTPKerberosAuth is retained as a shim, but\n bump the major version anyway for clarity.\n\n0.11.0: 2016-11-02\n------------------\n\n- Switch dependency on Windows from kerberos-sspi/pywin32 to WinKerberos.\n This brings Custom Principal support to Windows users.\n\n0.10.0: 2016-05-18\n------------------\n\n- Make it possible to receive errors without having their contents and headers\n stripped.\n- Resolve a bug caused by passing the ``principal`` keyword argument to\n kerberos-sspi on Windows.\n\n0.9.0: 2016-05-06\n-----------------\n\n- Support for principal, hostname, and realm override.\n\n- Added support for mutual auth.\n\n0.8.0: 2016-01-07\n-----------------\n\n- Support for Kerberos delegation.\n\n- Fixed problems declaring kerberos-sspi on Windows installs.\n\n0.7.0: 2015-05-04\n-----------------\n\n- Added Windows native authentication support by adding kerberos-sspi as an\n alternative backend.\n\n- Prevent infinite recursion when a server returns 401 to an authorization\n attempt.\n\n- Reduce the logging during successful responses.\n\n0.6.1: 2014-11-14\n-----------------\n\n- Fix HTTPKerberosAuth not to treat non-file as a file\n\n- Prevent infinite recursion when GSSErrors occurs\n\n0.6: 2014-11-04\n---------------\n\n- Handle mutual authentication (see pull request 36_)\n\n All users should upgrade immediately. This has been reported to\n oss-security_ and we are awaiting a proper CVE identifier.\n\n **Update**: We were issued CVE-2014-8650\n\n- Distribute as a wheel.\n\n.. _36: https://github.com/requests/requests-kerberos/pull/36\n.. _oss-security: http://www.openwall.com/lists/oss-security/\n\n0.5: 2014-05-14\n---------------\n\n- Allow non-HTTP service principals with HTTPKerberosAuth using a new optional\n argument ``service``.\n\n- Fix bug in ``setup.py`` on distributions where the ``compiler`` module is\n not available.\n\n- Add test dependencies to ``setup.py`` so ``python setup.py test`` will work.\n\n0.4: 2013-10-26\n---------------\n\n- Minor updates in the README\n- Change requirements to depend on requests above 1.1.0\n\n0.3: 2013-06-02\n---------------\n\n- Work with servers operating on non-standard ports\n\n0.2: 2013-03-26\n---------------\n\n- Not documented\n\n0.1: Never released\n-------------------\n\n- Initial Release\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pythongssapi/requests-gssapi", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "requests-gssapi", "package_url": "https://pypi.org/project/requests-gssapi/", "platform": "", "project_url": "https://pypi.org/project/requests-gssapi/", "project_urls": { "Homepage": "https://github.com/pythongssapi/requests-gssapi" }, "release_url": "https://pypi.org/project/requests-gssapi/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "A GSSAPI authentication handler for python-requests", "version": "1.1.0" }, "last_serial": 5298255, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "faa9a682bcc5a72adc70c3ba92f6fa22", "sha256": "15303e2580fcaa196cd758142efb97764d55bdfabb14f6fdd1020990f8652d17" }, "downloads": -1, "filename": "requests-gssapi-1.0.0.tar.gz", "has_sig": false, "md5_digest": "faa9a682bcc5a72adc70c3ba92f6fa22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11879, "upload_time": "2017-12-19T17:32:22", "url": "https://files.pythonhosted.org/packages/4d/e7/2c9e77a58e2b00ff434434bd95818c8f93d6913cc1e053c424cd80e053e0/requests-gssapi-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b7f59521f77b8fd20c8dc021bcd4ffe9", "sha256": "6eda82bbbcc1bea0ab1bdd9a428fb41c335847a2c807ae176c27bc1664bfbada" }, "downloads": -1, "filename": "requests-gssapi-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b7f59521f77b8fd20c8dc021bcd4ffe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12056, "upload_time": "2019-04-10T19:46:23", "url": "https://files.pythonhosted.org/packages/0b/e4/b2c27003a1507c8732945a2e5aab9d2be8b8f5bcdbdcf2c921a23e5ac1b6/requests-gssapi-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "1320a8d7f3ece39486ffd232401e3f34", "sha256": "1a847802af95541668c84c1534a80cf7ab4b2c3136526459f23830234f996caf" }, "downloads": -1, "filename": "requests-gssapi-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1320a8d7f3ece39486ffd232401e3f34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13385, "upload_time": "2019-05-21T14:52:10", "url": "https://files.pythonhosted.org/packages/c0/bb/74701d88f7a58be3e7a0bd0254b50d9483ca572f0aacd88fc50d671107c3/requests-gssapi-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1320a8d7f3ece39486ffd232401e3f34", "sha256": "1a847802af95541668c84c1534a80cf7ab4b2c3136526459f23830234f996caf" }, "downloads": -1, "filename": "requests-gssapi-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1320a8d7f3ece39486ffd232401e3f34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13385, "upload_time": "2019-05-21T14:52:10", "url": "https://files.pythonhosted.org/packages/c0/bb/74701d88f7a58be3e7a0bd0254b50d9483ca572f0aacd88fc50d671107c3/requests-gssapi-1.1.0.tar.gz" } ] }