-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add parameter option to Request
#494
Conversation
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.
Thank you for raising this PR. Looks great, just some little details.
Please add some tests in CredentialsManagerSpec
.
Hi @Widcket, thanks for your feedback. I modified the Code according to your comments and added a Test that refreshes the Token with a custom parameter. The test would fail if that Parameter is not present. I'm not too familiar with the HTTP Library therefore I don't know if my test could be improved. I'm very open for feedback again 😄 |
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.
Thank you!
This is now out in version 1.36.0. |
Changes
This PR adds the functionality to add parameters on a token-renew.
In
Request.swift
I added a function (parameters(_ payload: [String: Any])
) that returns a copy of self.The returned object will contain all fields from before, but with an updated payload.
The functionality is very similar to
BaseWebAuth.parameters(_:)
This functionality is also exposed via
CredentialsManager.credentials()
.References
Linked to #493
Testing
Changes in this PR have been tested in a real-world Product.
Unit Tests have been written to verify that
Request.parameters(_:)
work as expected.Checklist