-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
Bugfix/restore cookie auth #1201
Conversation
636dda6
to
d0b160f
Compare
I just installed your patch and tried authenticating with a jira instance. The session could be established. 👍 |
@mruessler sorry don't suppose you could explain what code snippet you used to test this? It sounds like you may be using the wrong class? I would expect this snippet to work: import jira
cookie_auth_jira = jira.client.JIRA(
server="your_url",
auth=("your user", "your_pass"),
)
cookie_auth_jira.myself()
cookie_auth_jira.search_issues(...) # this should work fine with the right arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the above API breaking change is known and intentionally then its good to go
""" | ||
|
||
def __init__( | ||
self, session: ResilientSession, _get_session: Callable, auth: Tuple[str, str] | ||
self, session: ResilientSession, session_api_url: str, auth: Tuple[str, str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not aware why this got broken but just a reminder that this breaks the API as probably mentioned here #1201 (comment) by @mruessler .
maybe this should become a private class if we dont want people to interact with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait for @mruessler to respond to my earlier comment. I agree this is private. I can't imagine why a user would directly interact with this class, all these 'AuthBase' subclasses need to be in a separate module file with a module docstring describing them as an implementation detail for the main client.
Hi @adehad You’re right. I assumed that you’d have the same experience than me but that is obviously not the case. So here is my extended comment. I used your branch for my project to test.
In order to have a minimal and better comparable example I used your code snippet afterwards. This is the backtrace: Click to expand
I am using |
Perfect, thanks. I've seen this reported in #681. There is a genuine 401 error but we just retry this forever... I've added some logic that aims to prevent this loop. I couldn't add a test for this, as it triggered the CAPTCHA challenge on the user and then breaks all the tests run afterwards. But if @mruessler you could give this a check and see if you get a HTTP exception raised instead of a recursion error that would be great. |
Hi @adehad, I still get the Click to expand
|
damn, that is strange. I'll try make a test that uses https://httpstat.us/ - and see if I can reproduce this. Thanks. |
for more information, see https://pre-commit.ci
Was able to reproduce the Can you give this another try @mruessler ? |
This looks better. I get the expected error:
|
Great, @mruessler - are you happy with this branch then? (I am assuming the login failure is a genuine failure on your side rather than a problem with the cookie auth implementation ?) |
I would think so. The login failure is independent of the authentication. |
In addition, I can now confirm that the login works and that I am able to use the Jira object just as before with basic authentication. |
Fixes #1035
As this is technically a regression
@tevert do let me know if you can confirm this works
pip install git+https://github.com/pycontribs/jira.git@bugfix/restore_cookie_auth