feat(Talend/http): export http fetch to allow sending payload in delete request#5783
Open
VolodymyrKovalM wants to merge 2 commits intomasterfrom
Conversation
🦋 Changeset detectedLatest commit: bce32b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Storybook for this PR deployed on this github page |
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the problem this PR is trying to solve?
There is DELETE API in IAM which requires application names in request body
According to specification, it may not be perfect to have body in DELETE request, and may not be intended to do this way,
but, this API is used in TMC
It worked before with CMF http, as config was spread when calling interceptors https://github.com/Talend/ui/blob/master/packages/cmf/src/sagas/http.js#L179 , so, it was possible to pass payload in the config, and it would override undefined payload.
Probably this was not intended to pass payload in config and send body in delete request, most probably, it was kind of bug / "back door", but it worked for one API in TMC )
Now, as CMF has been removed from TMC, @talend/http package is used for now, and in @talend/http there is not such kind of "back door" to send body in delete request, so, the TMC part which call that API from IAM fails with error
What is the chosen solution to this problem?
For now I see few solutions
for now I went with option 4, to not impact existing code, but I'm opened to discussion, if needed
(maybe in future the DELETE API in IAM will be refactored, to accept application names as GET parameters instead of request body, in this case we will not need specific TMC implementation)
Please check if the PR fulfills these requirements
yarn changesetto a request a release from the CI if wanted.[ ] This PR introduces a breaking change