[SCB-728] Decrypt/signature and adjust form in edge#810
Merged
liubao68 merged 4 commits intoapache:masterfrom Jul 18, 2018
Merged
[SCB-728] Decrypt/signature and adjust form in edge#810liubao68 merged 4 commits intoapache:masterfrom
liubao68 merged 4 commits intoapache:masterfrom
Conversation
WillemJiang
reviewed
Jul 17, 2018
| result.remove("signature"); | ||
|
|
||
| String expected = "{name=userName, age=10, userId=serviceTokenTest-userId, body1=b1, body2=b2, body3=b3}"; | ||
| System.out.println("encrypt result: " + result.toString()); |
Member
There was a problem hiding this comment.
We are not supposed to use System.out.println in the test.
WillemJiang
reviewed
Jul 17, 2018
| } | ||
| Hcr hcr = encryptContext.getHcr(); | ||
|
|
||
| // bad practice: it's better to set signature in response header |
Member
There was a problem hiding this comment.
Is it a stand request or just some specific user requirement.
Contributor
Author
There was a problem hiding this comment.
it's a demo for one specific user
it's a demo, not product.
| @@ -0,0 +1,4 @@ | |||
| org.apache.servicecomb.demo.edge.service.encrypt.filter.EdgeSignatureRequestFilter | |||
ea4d8dc to
b180285
Compare
WillemJiang
approved these changes
Jul 18, 2018
b180285 to
f099ad6
Compare
liubao68
approved these changes
Jul 18, 2018
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.
1.add "decrypt“ logic, decrypt field named "body" in form, generate new multiple fields to form by "body"
2.move "signature" to edge, and only signature for one operation
3.request with form-data or x-www-form-urlencoded, edge convert to json automatically
4.query userId by serviceToken, and put userId back to form
5.calc signature from response buffer, and add "signature" field to response body, eg:
before: {"k":"v"}
after: {"k":"v","signature":"xxxxx"}