Skip to content

[SCB-728] Decrypt/signature and adjust form in edge#810

Merged
liubao68 merged 4 commits intoapache:masterfrom
wujimin:decrypt-signature-adjustForm-in-edge
Jul 18, 2018
Merged

[SCB-728] Decrypt/signature and adjust form in edge#810
liubao68 merged 4 commits intoapache:masterfrom
wujimin:decrypt-signature-adjustForm-in-edge

Conversation

@wujimin
Copy link
Copy Markdown
Contributor

@wujimin wujimin commented Jul 16, 2018

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"}

@wujimin wujimin requested review from WillemJiang and liubao68 July 16, 2018 13:46
@wujimin wujimin changed the title [SCB-728] Decrypt signature adjust form in edge [SCB-728] Decrypt/signature and adjust form in edge Jul 16, 2018
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 16, 2018

Coverage Status

Coverage increased (+0.02%) to 87.069% when pulling f099ad6 on wujimin:decrypt-signature-adjustForm-in-edge into a18ab09 on apache:master.

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());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are not supposed to use System.out.println in the test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

}
Hcr hcr = encryptContext.getHcr();

// bad practice: it's better to set signature in response header
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it a stand request or just some specific user requirement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

License header please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@wujimin wujimin force-pushed the decrypt-signature-adjustForm-in-edge branch from ea4d8dc to b180285 Compare July 17, 2018 07:08
@wujimin wujimin force-pushed the decrypt-signature-adjustForm-in-edge branch from b180285 to f099ad6 Compare July 18, 2018 07:56
@liubao68 liubao68 merged commit f221653 into apache:master Jul 18, 2018
@wujimin wujimin deleted the decrypt-signature-adjustForm-in-edge branch August 21, 2018 15:23
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.

4 participants