stellar / django-polaris

An extendable Django app for building modular Stellar services
https://django-polaris.readthedocs.io
Apache License 2.0
94 stars 66 forks source link

CLI command for callback requests #648

Open JakeUrban opened 1 year ago

JakeUrban commented 1 year ago

What problem does your feature solve?

Polaris makes callback requests to remote servers when requested in SEP-6 & 24 transactions. Callbacks have now been added to SEP-12 & SEP-31, and on top of that, the standards now recommend that anchors include a header with their signature to verify authenticity.

Polaris needs to be updated to support these changes, but as the use of callbacks increase (and the need for polling decreases), Polaris should have a long-running CLI command to make these requests outside the web server's request & response cycle.

This will ensure that making these callback requests does not slow down the response time of the web server while creating a most resilient system for making the requests asynchronous.

What would you like to see?

A new CLI command that reads from the DB for queued callback requests to be made and makes them, marking them as complete when the callback was successfully received, retrying on connection failure, and marking as error if an unexpected response was returned.