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

Add parameter option to Request #494

Merged
merged 16 commits into from
Aug 18, 2021
Merged

Conversation

kmeinh
Copy link
Contributor

@kmeinh kmeinh commented Aug 10, 2021

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.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@kmeinh kmeinh requested a review from a team as a code owner August 10, 2021 10:55
Auth0/Request.swift Outdated Show resolved Hide resolved
Auth0/Request.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@Widcket Widcket left a 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.

@kmeinh
Copy link
Contributor Author

kmeinh commented Aug 14, 2021

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 😄

Auth0/Request.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

Thank you!

@Widcket Widcket merged commit a69f21d into auth0:master Aug 18, 2021
@Widcket Widcket mentioned this pull request Sep 1, 2021
@Widcket
Copy link
Contributor

Widcket commented Sep 2, 2021

This is now out in version 1.36.0.

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.

None yet

2 participants