-
Notifications
You must be signed in to change notification settings - Fork 121
REST API: Custom cookie nonce authenticator #8659
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
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
44dcfbe
Rename RequestProcessor to ApplicationPasswordRequestProcessor
itsmeichigo cecb4dc
Rename RequestAuthenticator to ApplicationPasswordRequestAuthenticator
itsmeichigo b08222b
Rename DefaultRequestAuthenticator to DefaultApplicationPasswordReque…
itsmeichigo 3461885
Rename RequestAuthenticatorError to ApplicationPasswordRequestAuthent…
itsmeichigo 09c047a
Fix line limit for tests
itsmeichigo c8900ff
Add custom CookieNonceAuthenticator
itsmeichigo 01b921b
Update initializer for WordPressOrgNetwork to use configuration
itsmeichigo eabb34e
Make CookieNonceAuthenticator final and internal
itsmeichigo 4613f4a
Shorten name for ApplicationPasswordAuthenticator
itsmeichigo c203662
Update tests for WordPressOrgCredentialsAuthenticator
itsmeichigo af89ac0
Remove redundant self
itsmeichigo 3be18f8
Add comment explaining CookieNonceAuthenticator
itsmeichigo 7a7b28e
Remove misleading comment for canRetry
itsmeichigo 3b6b192
Use modern guard let syntax
itsmeichigo 67ec443
Add comment regarding nonce retrieval method
itsmeichigo 22c6ef0
Simplify nonce check
itsmeichigo d820410
Rename RequestProcessorTests with the ApplicationPassword prefix
itsmeichigo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe @selanthiraiyan can confirm the renaming of these classes since you created them? I didn't know they're only used in the application password context when I reviewed the previous PR on these classes.
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.
The processor triggers generating application passwords when retrying requests, so it is specific to application password authentication only. I renamed this to avoid confusion with any other authentication method.
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 am afraid that using ApplicationPassword as a prefix wouldn't make sense here.
The
RequestProcessorhandles authentication for both WPCOM token and application password cases.RequestProcessorusesDefaultRequestAuthenticatorto perform the authentication hereExtra info: Only REST requests are retried, and errors from other requests are just passed through. Due to this method in
AlamofireNetwork