harrystech / cronut

[DEPRECATED] A dead man's switch server implementation in Rails. (We @harrystech have moved to a full-featured "job monitoring as a service" vendors and have retired Cronut.)
24 stars 6 forks source link

JobsController: Accept base64 encoded payloads #18

Closed pjambet closed 7 years ago

pjambet commented 7 years ago

Pings can now be base64 encoded. Simply base 64 encode the public id and pass the ?use_base64=true query string parameter.

This is useful when using RSA encryption and sending a publicly encrypted payload.

Dealing with base64 encoded payload simplifies integration with other platforms (such as the JVM) since we're not relying on some internal ruby byte representation like the default implementation does.

pjambet commented 7 years ago

19 is interesting, but as long as we have clients relying on the current behavior we can't easily remove the whole encryption layer.

I suggest merging this and removing the whole unnecessary encryption handling later on.

pjambet commented 7 years ago

You're faster than me!

pjambet commented 7 years ago

I just created a v1.0 tag https://github.com/harrystech/cronut/tree/v1.0 that we can use as a reference later on when we remove encryption support.

pjambet commented 7 years ago

I added a puts statement for e.message in main rescue block, it'll be helpful to see what happened in the logs.

Also added a note to the README and changed the rescue from Exception to StandardError

pjambet commented 7 years ago

Both routes use the same endpoint, and you could pass ?use_base64=false to v2/ping, which I think is fine and doesn't need to be documented since the use_base64 flag is just used internally.

tvogels01 commented 7 years ago

BTW ... don't let my silly comments distract you from merging.