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

Keeping shared information (such as categories) in-sync within the network #249

Open
almasaeed2010 opened this issue Feb 27, 2019 · 2 comments
Assignees

Comments

@almasaeed2010
Copy link
Contributor

almasaeed2010 commented Feb 27, 2019

Now that we are enabling sharing of categories and fields, how can we keep that information in sync across websites within our network?

Web Hooks

My suggestion would be to create a web hooks mechanism where a site that has information changed would call a specific url for each of its partner websites to inform them that a change has occurred. Once the sites become aware of the change, they can simply request the new information whenever resources are available.

Security Risk

This presents the risk of DDoS attack with a propagating effect. To solve this problem, we should create a handshake method that gets triggered when a connection between sites is requested. When a connection is established, by adding a new remote host, the client receives an API token from the server that is then used to trigger any webhooks.

@almasaeed2010
Copy link
Contributor Author

Implementation Details

  • The API key must be crypto-secure. Therefore, support of random_bytes must be available (php 7+)
  • The web hooks should be easy to register programatically. That is, we should provide a namespace specifically for web-hooks (e.g, elasticsearch/api/v1/web-hooks/{resource}?api_key={key}).
  • Web hooks that require time to execute (such as pulling info about categories from other sites), should run in the queue or as a tripal job.

@almasaeed2010
Copy link
Contributor Author

Additional Notes

By implementing api_key based authentication, we present the possibility of collecting simple stats such as how much search traffic are we getting from each site.

@almasaeed2010 almasaeed2010 changed the title Keeping shared information (such as categories) in sync within the network Keeping shared information (such as categories) in-sync within the network Feb 27, 2019
@almasaeed2010 almasaeed2010 self-assigned this Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant