Skip to content
This repository has been archived by the owner on Oct 8, 2018. It is now read-only.

Latest commit

 

History

History
57 lines (39 loc) · 2.55 KB

README.md

File metadata and controls

57 lines (39 loc) · 2.55 KB

Wat?

This service delegates POST requests to Orchestrate.io. The service endpoints are designed to make it somewhat feasible to set up AWS SNS HTTP(S) subscriptions to this service.

That way you can have all messages published to a topic...

Security?

Considered non-existent, don't trust this.

That said, as of this writing the least insecure way of running this would probably be:

  • Expose the service solely over HTTPS (using a proper certificate)
  • Use random UUIDs (or something equivalent) as values for {application}
    • For example: brew install uuid && heroku config:set $(uuid)=<orchestrate api key>

Service

General

  • JSON payload
    • Both endpoints requires a JSON request body
    • The path parameter {key-field} specifies the field whose value will be the key in {collection}
  • MIME content type
    • Endpoints require JSON payload which can be sent as...
      • ...application/json
      • ...text/plain (because that's what AWS SNS does)

Endpoints

All endpoints require three parameters:

  • {application} must map to a environment variable whose value is the Orchestrate API that grants write access to {collection}
  • {collection} is the Orchestrate.io collection
  • {key-field} is the field within the payload whose value will be used as key in {collection}

Saving and updating documents

POST /{application}/{collection}/{key-field}

  • Creates, or updates, the key specified by {key-field} in {collection}.

Appending events to documents

POST /{application}/{collection}/{key-field}/{event-type}

  • Creates an event of the given {event-type} on the key specified by {key-field} in {collection} with the current time as timestamp.

Running / Deploying

Made to run on Heroku or locally with foreman. Requires at least one environment variable for {application} that contains a valid API key for Orchestrate.io. To run locally without HTTPS; set the environment variable DO_NOT_FORCE_HTTPS to any value.

AWS SNS

Subscription configuration

  • HTTP or HTTPS subscription
  • Raw message delivery

Subscription confirmation

The service employes a filter (SnsSubscriptionRequestFilter) which intercepts and confirms any inbound SNS subscription request.