pythongssapi / requests-gssapi

An authentication handler for using GSSAPI with Python Requests. Drop-in replacement for old requests-kerberos.
Other
32 stars 21 forks source link

Don't add the host to the target name if it wasn't given originally #23

Closed aiudirog closed 4 years ago

aiudirog commented 4 years ago

Currently, the target_name is updated to include the host the first time a request header is generated if the target_name is a string without an '@'. This locks the user into using only a single host, defeating the purpose of storing the contexts on a hostname basis.

I've updated the code to not update the target_name inplace and instead just use it to create the security context.

frozencemetery commented 4 years ago

Hmm. This is a bit scope creep, but I wonder if we ought to have some docs for how to use a context on multiple hosts, or maybe a test. Unfortunately I didn't have this use case in mind when porting, so target_name is poorly named - it should probably mention the behavior with respect to "@" for clarity.

Let me know if you'd prefer me to make those changes.

aiudirog commented 4 years ago

It's half designed already multiple hosts, so I would say it's probably best to support it completely. Feel free to make the changes when you have time, I'm definitely not an expert on that part.