Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nullstyle committed Oct 12, 2016
1 parent bf8a718 commit d4be2ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions config_bridge_example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ port = 8001
horizon = "https://horizon-testnet.stellar.org"
network_passphrase = "Test SDF Network ; September 2015"
api_key = ""
mac_key = ""

[[assets]]
code="USD"
Expand Down
7 changes: 7 additions & 0 deletions readme_bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The `config_bridge.toml` file must be present in a working directory. Here is an
* `receive` - URL of the webhook where requests will be sent when a new payment is sent to the receiving account. The bridge server will keep calling the receive callback indefinitely until 200 OK status is returned by it. **WARNING** The bridge server can send multiple requests to this webhook for a single payment! You need to be prepared for it. See: [Security](#security).
* `error` - URL of the webhook where requests will be sent when there is an error with an incoming payment
* `log_format` - set to `json` for JSON logs
* `mac_key` - a stellar secret key used to add MAC headers to a payment notification.

Check [`config_bridge_example.toml`](./config_bridge_example.toml).

Expand Down Expand Up @@ -393,6 +394,12 @@ name | description

Respond with `200 OK` when processing succeeded. Any other status code will be considered an error.

#### Payload Authentication

When the `mac_key` configuration value is set, the bridge server will attach HTTP headers to each payment notification that allow the receiver to verify that the notification is not forged. A header named `X_PAYLOAD_MAC` that contains a base64-encoded MAC value will be included. This MAC is derived by calculating the HMAC-SHA256 of the raw request body using the decoded value of the `mac_key` configuration option as the key.

This MAC can be used on the receiving side of the notification to verify that the payment notifications was generated from the bridge server, rather than from some other actor, to increase security.

## Security

* This server must be set up in an isolated environment (ex. AWS VPC). Please make sure your firewall is properly configured
Expand Down

0 comments on commit d4be2ef

Please sign in to comment.