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 a way to pass custom headers directly to the request [SDK-2908] #562

Merged
merged 7 commits into from
Dec 2, 2021

Conversation

adamjmcgrath
Copy link
Contributor

@adamjmcgrath adamjmcgrath commented Dec 1, 2021

Changes

Add the headers(_: [String: String]) method to the Request type, which allows the developer to pass arbitrary HTTP headers to a given request.

Auth0
    .authentication()
    .renew(withRefreshToken: refreshToken)
    .headers(["key": "value"])
    .start { result in
        switch result {
        case .success(let credentials): dump(credentials)
        case .failure(let error): print(error)
        }
    }

added a headers: [String: String] = [:] parameter to the credentials(withScope:minTTL:parameters:callback:) and the revoke(:_) public methods of the Credentials Manager which use the new headers(_: [String: String]) method to add the headers to the Request.

Testing

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

Checklist

@adamjmcgrath adamjmcgrath added the review:medium Medium review label Dec 1, 2021
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner December 1, 2021 17:14
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.

Looking good, left a few comments.

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.

LGTM

@Widcket Widcket merged commit 11d31d5 into beta Dec 2, 2021
@Widcket Widcket deleted the custom-headers branch December 2, 2021 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants