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 message origin checking for SMART Web Messaging #126

Merged
merged 7 commits into from
Apr 1, 2020

Conversation

barabo
Copy link

@barabo barabo commented Dec 20, 2019

I've added a filter to enforce origin checking, causing the sandbox to ignore messages that don't match the expected origin. I've also updated the unit test to pass.

@barabo barabo changed the title add message origin checking for SMART Web Messaging WIP: add message origin checking for SMART Web Messaging Dec 20, 2019
@barabo barabo changed the title WIP: add message origin checking for SMART Web Messaging add message origin checking for SMART Web Messaging Dec 20, 2019
@barabo
Copy link
Author

barabo commented Mar 13, 2020

@jmandel, @dennispatterson - PTAL

Comment on lines 105 to 106
// TODO: convert this to a stack so newer messages are on top.
this.setState({ messages: [...this.state.messages, message] });
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to swap the order of array elements here, so the splice comes in later? Otherwise, maybe remove the TODO or convert to a github issue.

Suggested change
// TODO: convert this to a stack so newer messages are on top.
this.setState({ messages: [...this.state.messages, message] });
this.setState({ messages: [message, ...this.state.messages] });

... but this probably needs additional tests, too. So, your call on how to incorporate.

Copy link
Author

Choose a reason for hiding this comment

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

I've created a separate issue here: #129

Referencing the issue created to change the message ordering.
Copy link
Member

@jmandel jmandel left a comment

Choose a reason for hiding this comment

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

Looks good to me! @dennispatterson do you want to take a look too, or are you happy to merge?

Copy link
Collaborator

@dennispatterson dennispatterson left a comment

Choose a reason for hiding this comment

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

Apologies for the delay. Looks good, @barabo!

@jmandel jmandel merged commit 2ff8644 into cds-hooks:master Apr 1, 2020
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.

3 participants