Skip to content

Fix up the interface we present to mention SPNEGO #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 14, 2017

Conversation

frozencemetery
Copy link
Member

(It's probably easiest to look at README.rst after the changes. Most of these were performed with sed and as such aren't very interesting.)

New auth provider is named "HTTPSPNEGOAuth". If there are suggestions., I am happy to modify the API to be more than a bare shim. If they're breaking backward compat, now is the time to offer them before we merge this :)

@frozencemetery frozencemetery added this to the 0.12.0 milestone Nov 22, 2017
@frozencemetery frozencemetery requested a review from simo5 November 22, 2017 22:36
@simo5
Copy link

simo5 commented Nov 23, 2017

I think we should deprecate principal and hostname_override and instead allow to pass in GSS-Names, although hostname_override is relatively neutral, principal applies only to kerberos as a concept, and I do not think it expresses the richness it could (does it support enterprise names as is ?)

@simo5
Copy link

simo5 commented Nov 23, 2017

force_preemptive is a strange name, the strategy is normally called "opportunistic auth", maybe we should also deprecate that old name and introduce a better one here.

@simo5
Copy link

simo5 commented Nov 23, 2017

I think it may also be nice to let delegate have mutliple values given we have 2 delegate flags that means two different things.

@simo5
Copy link

simo5 commented Nov 23, 2017

another thing we may want to consider is the ability to pass in a python-gssapi credential instead of havin request-gssapi always find it itself, this is better than passing in principal as it allows to use a MEMORY creadential we just created and is not in the defaul cache collection used by the system. Otherwise we'd have to set the process ccache and this will impact other threads/functions unnecessarily. Bad especially in systems that deal with multiple users as proxies of some kind (that use delegation for example).

@frozencemetery
Copy link
Member Author

I think it may also be nice to let delegate have mutliple values given we have 2 delegate flags that means two different things.

GSSAPI only has GSS_C_DELEG_FLAG; I'm not sure what second one you mean? (Stream cross with gssproxy conversation perhaps?)

@simo5
Copy link

simo5 commented Nov 28, 2017

GSS_C_DELEG_POLICY_FLAG

@frozencemetery
Copy link
Member Author

frozencemetery commented Nov 28, 2017 via email

@simo5
Copy link

simo5 commented Nov 29, 2017

Can we have conditional support in this code until python-gssapi gets it, or should we rather wait and fix it later?

@frozencemetery
Copy link
Member Author

I'd rather wait until it at least lands in python-gssapi master, but I am working on that as well.

For the interface, because python, we can reuse the delegate parameter, and give it a other options besides True and False - "if_permitted" or something, and that all works out.

What I'm not clear on is how that would behave, and moreover what behaviors we want to support. The Heimdal doc defines four behaviors based on the two flags being set or not; I'm not clear which are desirable here, and how to handle the new two cases in the code.

@frozencemetery
Copy link
Member Author

Four new commits, hopefully addressing your API suggestions @simo5 (except delegate; see above).

Copy link

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

nitpicks :)

@@ -83,13 +83,13 @@ class HTTPSPNEGOAuth(AuthBase):
def __init__(self, mutual_authentication=REQUIRED, service="HTTP",
delegate=False, force_preemptive=False, principal=None,
hostname_override=None, sanitize_mutual_error_response=True,
creds=None):
creds=None, opportunistic_auth=False):
Copy link

Choose a reason for hiding this comment

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

I was thinking we shouldn't retain force_preemptive, but provide a translation from that flag to opportunistic_auth in the wrapper that respondes to the old class name (HTTPKerberosAuth)

@@ -97,6 +97,9 @@ def __init__(self, mutual_authentication=REQUIRED, service="HTTP",

if self.creds and self.principal:
raise RuntimeError("creds and principal are mutually exclusive")
if type(service) == gssapi.names.Name and hostname_override != None:
Copy link

Choose a reason for hiding this comment

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

should we retain hostname_override at all ?
shouldn't we just deal it in the compat wrapper for the old class to translate it into a gssapi service name before calling into the HTTPSPNEGOAuth initializer ?

Copy link

Choose a reason for hiding this comment

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

If we want to make it easy to pass in a string instead of a gssapi name type then we could change the service string to allow to pass in "HTTP@hostname", it sounds silly to have a "hostname_pverride as a separate argument when you can easily use the "service", which I would perhaps rename to "target", but that may be going too far.

@frozencemetery frozencemetery force-pushed the shim branch 2 times, most recently from 7c701c2 to 90982b2 Compare December 7, 2017 21:50
@frozencemetery
Copy link
Member Author

Pushed up a new version with a stricter shim that hopefully behaves more in line with your suggestion.

@frozencemetery
Copy link
Member Author

@simo5 please re-review, thanks!

Copy link

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

/lgtm

@frozencemetery frozencemetery merged commit 68bada2 into pythongssapi:master Dec 14, 2017
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.

2 participants