Skip to content

Replace PyKerberos dependency with python-gssapi - #35

Open
svmhdvn wants to merge 1 commit into
deshaw:masterfrom
svmhdvn:python-gssapi
Open

Replace PyKerberos dependency with python-gssapi#35
svmhdvn wants to merge 1 commit into
deshaw:masterfrom
svmhdvn:python-gssapi

Conversation

@svmhdvn

@svmhdvn svmhdvn commented Apr 18, 2024

Copy link
Copy Markdown

Replace PyKerberos dependency with python-gssapi

This patch comprises the following changes:

  • Replace 'kerberos' with 'gssapi'
  • Remove lingering python2 support
  • Use a real kerberos realm for running tests (i.e. remove mock calls)

@svmhdvn
svmhdvn marked this pull request as ready for review April 18, 2024 16:52
@svmhdvn svmhdvn changed the title WIP: replace PyKerberos dependency with python-gssapi Replace PyKerberos dependency with python-gssapi Apr 18, 2024
@svmhdvn

svmhdvn commented Apr 18, 2024

Copy link
Copy Markdown
Author

Please test this PR and let me know of any feedback/fixes. All existing tests are passing with a real kerberos realm instead of mock calls now.

@mkomitee

mkomitee commented May 7, 2024

Copy link
Copy Markdown
Collaborator

I think in principle, we're on board with a change from the kerberos library to the gssapi library, but since you coupled that with a restructuring of the repository, it's quite difficult to review. Would you be willing to separate the changes related to the library replacement out into its own PR?

@svmhdvn

svmhdvn commented May 7, 2024

Copy link
Copy Markdown
Author

For sure! I'll do that and submit a couple separated PRs soon.

This patch comprises the following changes:
* Replace 'kerberos' with 'gssapi'
* Remove lingering python2 support
* Use a real kerberos realm for running tests (i.e. remove mock calls)
@svmhdvn

svmhdvn commented Jun 2, 2024

Copy link
Copy Markdown
Author

Updated the patch to only make the switch to the 'gssapi' python library. Let me know if you need clarification on any of the changes and I can explain in detail. I tried to make the diff as small as possible, but the test changes are still large since the testing methodology is changed in this patch.

Comment thread wsgi_kerberos.py
import socket
import sys

__version__ = '1.0.2'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes setup.py fail

Comment thread wsgi_kerberos.py
else:
LOG.debug('KerberosAuthMiddleware is identifying as %s', principal)
self.service = None
if hostname:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe default to socket.gethostname()?

Suggested change
if hostname:
if not hostname:
hostname = socket.gethostname()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants