Skip to content

Commit 0d481ce

Browse files
Rename to requests_gssapi
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1 parent 5e9fcf7 commit 0d481ce

File tree

9 files changed

+89
-94
lines changed

9 files changed

+89
-94
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
env/
44
build/
55
dist/
6-
requests_kerberos.egg-info/
6+
requests_gssapi.egg-info/
77

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ python:
66

77
install:
88
- pip install .
9-
script: py.test test_requests_kerberos.py
9+
script: py.test test_requests_gssapi.py

README.rst

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
requests Kerberos/GSSAPI authentication library
1+
requests GSSAPI authentication library
22
===============================================
33

44
Requests is an HTTP library, written in Python, for human beings. This library
5-
adds optional Kerberos/GSSAPI authentication support and supports mutual
5+
adds optional GSSAPI authentication support and supports mutual
66
authentication. Basic GET usage:
77

88

99
.. code-block:: python
1010
1111
>>> import requests
12-
>>> from requests_kerberos import HTTPKerberosAuth
12+
>>> from requests_gssapi import HTTPKerberosAuth
1313
>>> r = requests.get("http://example.org", auth=HTTPKerberosAuth())
1414
...
1515
@@ -29,7 +29,7 @@ REQUIRED
2929

3030
By default, ``HTTPKerberosAuth`` will require mutual authentication from the
3131
server, and if a server emits a non-error response which cannot be
32-
authenticated, a ``requests_kerberos.errors.MutualAuthenticationError`` will
32+
authenticated, a ``requests_gssapi.errors.MutualAuthenticationError`` will
3333
be raised. If a server emits an error which cannot be authenticated, it will
3434
be returned to the user but with its contents and headers stripped. If the
3535
response content is more important than the need for mutual auth on errors,
@@ -39,9 +39,9 @@ setting ``sanitize_mutual_error_response=False``:
3939
.. code-block:: python
4040
4141
>>> import requests
42-
>>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
43-
>>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, sanitize_mutual_error_response=False)
44-
>>> r = requests.get("https://windows.example.org/wsman", auth=kerberos_auth)
42+
>>> from requests_gssapi import HTTPKerberosAuth, REQUIRED
43+
>>> gssapi_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, sanitize_mutual_error_response=False)
44+
>>> r = requests.get("https://windows.example.org/wsman", auth=gssapi_auth)
4545
...
4646
4747
@@ -54,12 +54,12 @@ preference when constructing your ``HTTPKerberosAuth`` object:
5454
.. code-block:: python
5555
5656
>>> import requests
57-
>>> from requests_kerberos import HTTPKerberosAuth, OPTIONAL
58-
>>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
59-
>>> r = requests.get("http://example.org", auth=kerberos_auth)
57+
>>> from requests_gssapi import HTTPKerberosAuth, OPTIONAL
58+
>>> gssapi_auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
59+
>>> r = requests.get("http://example.org", auth=gssapi_auth)
6060
...
6161
62-
This will cause ``requests_kerberos`` to attempt mutual authentication if the
62+
This will cause ``requests_gssapi`` to attempt mutual authentication if the
6363
server advertises that it supports it, and cause a failure if authentication
6464
fails, but not if the server does not support it at all.
6565

@@ -72,44 +72,44 @@ authentication, you can do that as well:
7272
.. code-block:: python
7373
7474
>>> import requests
75-
>>> from requests_kerberos import HTTPKerberosAuth, DISABLED
76-
>>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
77-
>>> r = requests.get("http://example.org", auth=kerberos_auth)
75+
>>> from requests_gssapi import HTTPKerberosAuth, DISABLED
76+
>>> gssapi_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
77+
>>> r = requests.get("http://example.org", auth=gssapi_auth)
7878
...
7979
8080
Preemptive Authentication
8181
-------------------------
8282

83-
``HTTPKerberosAuth`` can be forced to preemptively initiate the Kerberos
84-
GSS exchange and present a Kerberos ticket on the initial request (and all
83+
``HTTPKerberosAuth`` can be forced to preemptively initiate the GSSAPI
84+
exchange and present a token on the initial request (and all
8585
subsequent). By default, authentication only occurs after a
86-
``401 Unauthorized`` response containing a Kerberos or Negotiate challenge
86+
``401 Unauthorized`` response containing a Negotiate challenge
8787
is received from the origin server. This can cause mutual authentication
8888
failures for hosts that use a persistent connection (eg, Windows/WinRM), as
89-
no Kerberos challenges are sent after the initial auth handshake. This
89+
no GSSAPI challenges are sent after the initial auth handshake. This
9090
behavior can be altered by setting ``force_preemptive=True``:
9191

9292
.. code-block:: python
9393
9494
>>> import requests
95-
>>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
96-
>>> kerberos_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, force_preemptive=True)
97-
>>> r = requests.get("https://windows.example.org/wsman", auth=kerberos_auth)
95+
>>> from requests_gssapi import HTTPKerberosAuth, REQUIRED
96+
>>> gssapi_auth = HTTPKerberosAuth(mutual_authentication=REQUIRED, force_preemptive=True)
97+
>>> r = requests.get("https://windows.example.org/wsman", auth=gssapi_auth)
9898
...
9999
100100
Hostname Override
101101
-----------------
102102

103103
If communicating with a host whose DNS name doesn't match its
104-
kerberos hostname (eg, behind a content switch or load balancer),
105-
the hostname used for the Kerberos GSS exchange can be overridden by
104+
hostname (eg, behind a content switch or load balancer),
105+
the hostname used for the GSSAPI exchange can be overridden by
106106
setting the ``hostname_override`` arg:
107107

108108
.. code-block:: python
109109
110110
>>> import requests
111-
>>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
112-
>>> kerberos_auth = HTTPKerberosAuth(hostname_override="internalhost.local")
111+
>>> from requests_gssapi import HTTPKerberosAuth, REQUIRED
112+
>>> gssapi_auth = HTTPKerberosAuth(hostname_override="internalhost.local")
113113
>>> r = requests.get("https://externalhost.example.org/", auth=kerberos_auth)
114114
...
115115
@@ -119,34 +119,29 @@ Explicit Principal
119119
``HTTPKerberosAuth`` normally uses the default principal (ie, the user for
120120
whom you last ran ``kinit`` or ``kswitch``, or an SSO credential if
121121
applicable). However, an explicit principal can be specified, which will
122-
cause Kerberos to look for a matching credential cache for the named user.
123-
This feature depends on OS support for collection-type credential caches,
124-
as well as working principal support in PyKerberos (it is broken in many
125-
builds). An explicit principal can be specified with the ``principal`` arg:
122+
cause GSSAPI to look for a matching credential cache for the named user.
123+
This feature depends on OS support for collection-type credential caches.
124+
An explicit principal can be specified with the ``principal`` arg:
126125

127126
.. code-block:: python
128127
129128
>>> import requests
130-
>>> from requests_kerberos import HTTPKerberosAuth, REQUIRED
131-
>>> kerberos_auth = HTTPKerberosAuth(principal="user@REALM")
132-
>>> r = requests.get("http://example.org", auth=kerberos_auth)
129+
>>> from requests_gssapi import HTTPKerberosAuth, REQUIRED
130+
>>> gssapi_auth = HTTPKerberosAuth(principal="user@REALM")
131+
>>> r = requests.get("http://example.org", auth=gssapi_auth)
133132
...
134133
135-
On Windows, WinKerberos is used instead of PyKerberos. WinKerberos allows the
136-
use of arbitrary principals instead of a credential cache. Passwords can be
137-
specified by following the form ``user@realm:password`` for ``principal``.
138-
139134
Delegation
140135
----------
141136

142-
``requests_kerberos`` supports credential delegation (``GSS_C_DELEG_FLAG``).
137+
``requests_gssapi`` supports credential delegation (``GSS_C_DELEG_FLAG``).
143138
To enable delegation of credentials to a server that requests delegation, pass
144139
``delegate=True`` to ``HTTPKerberosAuth``:
145140

146141
.. code-block:: python
147142
148143
>>> import requests
149-
>>> from requests_kerberos import HTTPKerberosAuth
144+
>>> from requests_gssapi import HTTPKerberosAuth
150145
>>> r = requests.get("http://example.org", auth=HTTPKerberosAuth(delegate=True))
151146
...
152147
@@ -158,10 +153,10 @@ Logging
158153

159154
This library makes extensive use of Python's logging facilities.
160155

161-
Log messages are logged to the ``requests_kerberos`` and
162-
``requests_kerberos.kerberos_`` named loggers.
156+
Log messages are logged to the ``requests_gssapi`` and
157+
``requests_gssapi.gssapi`` named loggers.
163158

164159
If you are having difficulty we suggest you configure logging. Issues with the
165-
underlying kerberos libraries will be made apparent. Additionally, copious debug
160+
underlying GSSAPI libraries will be made apparent. Additionally, copious debug
166161
information is made available which may assist in troubleshooting if you
167162
increase your log level all the way up to debug.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
"""
2-
requests Kerberos/GSSAPI authentication library
2+
requests GSSAPI authentication library
33
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
55
Requests is an HTTP library, written in Python, for human beings. This library
6-
adds optional Kerberos/GSSAPI authentication support and supports mutual
6+
adds optional GSSAPI authentication support and supports mutual
77
authentication. Basic GET usage:
88
99
>>> import requests
10-
>>> from requests_kerberos import HTTPKerberosAuth
10+
>>> from requests_gssapi import HTTPKerberosAuth
1111
>>> r = requests.get("http://example.org", auth=HTTPKerberosAuth())
1212
1313
The entire `requests.api` should be supported.
1414
"""
1515
import logging
1616

17-
from .kerberos_ import HTTPKerberosAuth, REQUIRED, OPTIONAL, DISABLED
17+
from .gssapi_ import HTTPKerberosAuth, REQUIRED, OPTIONAL, DISABLED
1818
from .exceptions import MutualAuthenticationError
1919
from .compat import NullHandler
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
requests_kerberos.exceptions
2+
requests_gssapi.exceptions
33
~~~~~~~~~~~~~~~~~~~
44
55
This module contains the set of exceptions.

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
hist_fd = os.path.join(path, 'HISTORY.rst')
1010

1111
long_desc = ''
12-
short_desc = 'A Kerberos authentication handler for python-requests'
12+
short_desc = 'A GSSAPI authentication handler for python-requests'
1313

1414
if os.path.isfile(desc_fd):
1515
with open(desc_fd) as fd:
@@ -25,25 +25,25 @@ def get_version():
2525
Simple function to extract the current version using regular expressions.
2626
"""
2727
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
28-
with open('requests_kerberos/__init__.py') as fd:
28+
with open('requests_gssapi/__init__.py') as fd:
2929
matches = list(filter(lambda x: x, map(reg.match, fd)))
3030

3131
if not matches:
3232
raise RuntimeError(
33-
'Could not find the version information for requests_kerberos'
33+
'Could not find the version information for requests_gssapi'
3434
)
3535

3636
return matches[0].group(1)
3737

3838

3939
setup(
40-
name='requests-kerberos',
40+
name='requests-gssapi',
4141
description=short_desc,
4242
long_description=long_desc,
43-
author='Ian Cordasco, Cory Benfield, Michael Komitee',
44-
author_email='graffatcolmingov@gmail.com',
45-
url='https://github.com/requests/requests-kerberos',
46-
packages=['requests_kerberos'],
43+
author='Ian Cordasco, Cory Benfield, Michael Komitee, Robbie Harwood',
44+
author_email='rharwood@redhat.com',
45+
url='https://github.com/frozencemetery/requests-gssapi',
46+
packages=['requests_gssapi'],
4747
package_data={'': ['LICENSE', 'AUTHORS']},
4848
include_package_data=True,
4949
version=get_version(),
@@ -54,6 +54,6 @@ def get_version():
5454
':sys_platform=="win32"': ['winkerberos>=0.5.0'],
5555
':sys_platform!="win32"': ['pykerberos>=1.1.8,<2.0.0'],
5656
},
57-
test_suite='test_requests_kerberos',
57+
test_suite='test_requests_gssapi',
5858
tests_require=['mock'],
5959
)

0 commit comments

Comments
 (0)