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

feat(orders): add support for Hubble ordering system #17

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Yoronex
Copy link
Member

@Yoronex Yoronex commented Nov 24, 2024

Description

This PR adds a new module that implements the ordering system for Hubble. It's goal is to receive order numbers and show them for a certain amount of time on all screen clients. New orders are sent to Aurora using an HTTP endpoint. Then, every time an order is added or manually removed, Aurora sends a SocketIO message to all screen clients with the complete list of all order numbers. Each order number also includes the creation time and after how many seconds the order should be hidden. Note that Aurora Core does not send a message when an order number is expired: the screen clients should hide these themselves after their expiry (to save network resources and server side complexity).

The list of orders is not persistent: it is stored in memory.

Related issues/external references

Types of changes

  • New feature (non-breaking change which adds functionality)

@Yoronex Yoronex requested a review from SuperVK November 24, 2024 13:27
@Yoronex
Copy link
Member Author

Yoronex commented Nov 24, 2024

@PimVanLeeuwen and @SuperVK please let me know whether the endpoints described in the OpenAPI spec are something you can work with!

@PimVanLeeuwen
Copy link

I have asked Christiaan from Hubble who will implement the API on the register side and he will take a look at this PR for it.

@christiaangoossens
Copy link

I have asked Christiaan from Hubble who will implement the API on the register side and he will take a look at this PR for it.

I will still do that, it's just stalled on the todo list at the moment due to starting a new job.

@christiaangoossens
Copy link

The documentation you need is now available at https://docs.starcommunity.app/docs/webhooks/hooks/food-order-completed. For authentication, I settled on using the same system for all webhooks that we send: RSA-SHA256 (https://docs.starcommunity.app/docs/webhooks/signatures).

For Aurora this means:

  • Aurora can either be hosted within the network or on the internet
  • There is no explicit need to firewall the webhook endpoint
  • We do not need to configure shared keys / JWT secrets / keep environment variables etc
  • Aurora verifies the signature on any webhook it processes and rejects it (with logging) if the signature fails
  • All webhooks sent in Hubble will use the production key available at https://api.starcommunity.app/.well-known/webhooks.key (after this is in production). You should cache that key, but not indefinitely, to allow for key rollover (which will only happen if it's leaked/compromised).

You can test your implementation without any webhooks by using the example webhook body/signature header against your implementation.

@Yoronex Is this enough to finish the implementation? I tested the example code on the docs as well and it all verified for me.

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