Skip to content
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

memoize user's credentials and refactoring #7

Closed

Conversation

dodikk
Copy link

@dodikk dodikk commented Jul 27, 2018

Basically, the reviewer may ignore the contents of the Pods directory.

Alexander Dodatko added 7 commits July 27, 2018 16:05
* assert() ==> NSParameterAssert()
* using _cmd instead of selector literals where appropriate
* JAHPQNSURLSessionDemuxTaskInfo extracted to a separate file
* a few typedefs introduced for convenience
* a few local variables extracted
* Extracted some invariants as local variables
* Removed some duplicated calls
Pods directory is not included to .gitignore
So I’m not ignoring these changes and committing them.
…iption to the readme.

Added some pitfalls I’ve faced to the readme too.
Copy link
Collaborator

@hborders hborders left a comment

Choose a reason for hiding this comment

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

A lot of the PR refactors the example code, which I explicitly don't want, as I explained in #3.
Also, a lot of the PR changes existing formatting strategies. Please keep the original formatting.

self.authAlertView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
[self.authAlertView show];

// JAHPDidCancelAuthenticationChallengeHandler logCancelEvent =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you comment this out?

Copy link
Author

Choose a reason for hiding this comment

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

That's what I've introduced before noticing the #define USE_PROTOCOL_FOR_CANCELLATION 0 . Forgot to delete. Will fix that.

-(void)handleAuthChallenge:(NSURLAuthenticationChallenge*)challenge
forProtocol:(JAHPAuthenticatingHTTPProtocol*)authenticatingHTTPProtocol
{
// TODO: maybe fix leaking `self`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the leaking self?

Copy link
Author

Choose a reason for hiding this comment

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

Same thing. Old irrelevant comment I've written before the refactoring happened. Will delete that.

self.authAlertView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
[self.authAlertView show];

return nil;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm fine with adding a logging challenge handler. I think that would make exploration a little simpler.

Copy link
Author

Choose a reason for hiding this comment

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

I believe, if this function returns non-nil, the authenticatingHTTPProtocol:didCancelAuthenticationChallenge: method will end up not being called. Which is unwanted for the #if USE_PROTOCOL_FOR_CANCELLATION demo branch.

@hborders
Copy link
Collaborator

I'll have to do a more in-depth review later tonight.

@hborders
Copy link
Collaborator

There's still a ton of noise in this PR from reformatting that isn't strictly necessary. If you want different formatting for this project, I'm fine with it, but let's make that a separate PR.

@dodikk
Copy link
Author

dodikk commented Jul 30, 2018

There's still a ton of noise in this PR from reformatting that isn't strictly necessary. If you want different formatting for this project, I'm fine with it, but let's make that a separate PR.

Ok. I understand. I'll try to split the changes later.

@dodikk
Copy link
Author

dodikk commented Jul 30, 2018

Reverted original formatting in #9

Tested with

  • original example
  • NTLM and "needs authorization video"

@dodikk
Copy link
Author

dodikk commented Jul 30, 2018

Closing this since a more recent PR is available #9

@dodikk dodikk closed this Jul 30, 2018
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