-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
265 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
_* | ||
handler.so | ||
handler.zip | ||
server | ||
main | ||
main.zip |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rm main | ||
rm main.zip | ||
GOOS=linux go build -o main main.go | ||
zip main.zip main |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import ( | |
|
||
func main() { | ||
data := []byte(`{"event":"audit","audit":{"id":"1011112222333344445555666"}}`) | ||
data = []byte(`{"event":"audit","audit":{"id":"6514922586902400152","audit_action":"update","created_at":"2018-01-25T09:46:59.257Z","interesting":true,"user":{"id":"6355516420883588191","name":"John Wang","email":"[email protected]","created_at":"2016-11-21T20:09:39.022Z","updated_at":"2018-01-24T23:50:12.097Z"},"auditable_type":"note","auditable_id":"6499593214164077189","description":"updated feature RCGG-112 User feedback collection","auditable_url":"https://ringcentral.aha.io/features/RCGG-112","changes":[{"field_name":"Description","value":"\u003cp\u003eBesides Google Chrome store reviews, we should provide user way to submit their feedback from within our Google app\u003c/p\u003e\u003cp\u003e\u003cb\u003eRequirement\u003c/b\u003e\u003c/p\u003e\u003col\u003e\n\u003cli\u003eThere should be a menu item 'Feedback' on Settings page\u003c/li\u003e\n\u003cli\u003eWhen user clicks 'Feedback', user shall be navigated to a new page with following content\u003cblockquote\u003e\n\u003cp\u003e\u003cb\u003eContact Customer Support\u003c/b\u003e\u003cbr\u003e Your feedback is valuable for us. If you have problems using the app, want to request a feature, or report a bug, we’re more than happy to help. Please fill in the form below and click \u003ci\u003eSend Your Feedback\u003c/i\u003e, or directly use your mailbox and send your request to [email protected].\u003c/p\u003e\n\u003cp\u003eYour email address (so we can reply to you)\u003cbr\u003e [Input box: [email protected]]\u003c/p\u003e\n\u003cp\u003eFeedback topic\u003cbr\u003e [Dropdown: Please select an option]\u003c/p\u003e\n\u003cp\u003eSubject\u003cbr\u003e [Input box: Let us know how we can help you]\u003c/p\u003e\n\u003cp\u003eFull description\u003cbr\u003e [Input box: Please include as much information as possible]\u003c/p\u003e\n\u003cp\u003e\u003cstrike\u003eAttachment\u003c/strike\u003e \u003cbr\u003e \u003cstrike\u003e[Drag and drop area]\u003c/strike\u003e\u003c/p\u003e\n\u003cp\u003e[Button: Send Your Feedback]\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/li\u003e\n\u003cli\u003eFeedback topic options in the dropdown list: Please select an option (default) | Bug report | Feature request | Others\u003c/li\u003e\n\u003cli\u003eThere should be back icon on the page by clicking which user can be navigated back to Settings page.\u003c/li\u003e\n\u003cli\u003eWe should leverage an Email server and send the feedback including all the information/\u003cstrike\u003eattachment\u003c/strike\u003e user submitted to team alias \u003ci\[email protected]\u003c/i\u003e with title 'Google User Feedback'.\u003cul\u003e\u003cli\u003eEmail content example\u003cblockquote\u003e\n\u003cp\u003eHi Integration Team,\u003c/p\u003e\n\u003cp\u003eYou've got feedback from customer on RingCentral for Google extension. This customer could be contacted via email [customer's email address].\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eCustomer Feedback Topic\u003c/b\u003e\u003cbr\u003e *****\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eSubject\u003c/b\u003e\u003cbr\u003e ******\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003cbr\u003e ********\u003c/p\u003e\n\u003cp\u003eRegards,\u003cbr\u003e RingCentral for Google Extension\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/li\u003e\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\u003cp\u003ePlease note that the feedback email should support rebranding, to avoid us using wrong words when reaching back to the customers.\u003c/p\u003e"}]}}`) | ||
|
||
msg, err := aha.AhaOutMessageFromBytes(data) | ||
if err != nil { | ||
|
@@ -19,13 +20,14 @@ func main() { | |
val := msg.Audit.Changes[0].Value | ||
fmt.Println(val) | ||
|
||
fmt.Println("---") | ||
val2 := html.UnescapeString(val) | ||
fmt.Println(val2) | ||
|
||
fmt.Println("---") | ||
//p := bluemonday.UGCPolicy() | ||
p := bluemonday.StrictPolicy() | ||
val3 := p.Sanitize(val2) | ||
fmt.Println(val3) | ||
val = p.Sanitize(val) | ||
fmt.Println(val) | ||
|
||
fmt.Println("===") | ||
val = html.UnescapeString(val) | ||
fmt.Println(val) | ||
|
||
} |
Oops, something went wrong.