| 1 | # Static Callbacks Extension |
| 2 | |
| 3 | This extension priovides an implementation and configuration for static callbacks outlined in this [DecisionRecord](https://github.com/eclipse-edc/Connector/tree/main/docs/developer/decision-records/2023-02-28-processing-callbacks#static-endpoints) |
| 4 | The callacks are built on top of the EDC event system. When an event is fired in EDC all registered callacks will be invoked. |
| 5 | |
| 6 | ## Configuration |
| 7 | |
| 8 | | Parameter name | Description | Mandatory | Default value | |
| 9 | |---------------------------------------|-------------------------------------------------------------------------------------------------|-----------|---------------| |
| 10 | | `edc.callback.<name>.uri` | The address used to dispatch a callback notification | true | null | |
| 11 | | `edc.callback.<name>.events` | The comma separated events on which the callback should be invoked. | true | null | |
| 12 | | `edc.callback.<name>.transactional` | If the callback should be invoked inside the transactional boundaries of the configured events. | false | false | |
| 13 | | `edc.callback.<name>.auth-key` | Transport specific header to use for sending an authentication value. | false | null | |
| 14 | | `edc.callback.<name>.auth-code-id` | The id for the authorization value that will be resolved by the Vault. | false | null | |
| 15 | |
| 16 | |
| 17 | Example configuration with two callbacks: |
| 18 | |
| 19 | ```bash |
| 20 | edc.callback.endpoint1.uri=http://localhost:8080/hooks |
| 21 | edc.callback.endpoint1.events=contract.negotiation,transfer.process |
| 22 | edc.callback.endpoint1.transactional=true |
| 23 | |
| 24 | edc.callback.endpoint2.uri=http://localhost:8081/hooks |
| 25 | edc.callback.endpoint2.events=contract.negotiation.finalized,transfer.process.completed |
| 26 | edc.callback.endpoint2.transactional=false |
| 27 | edc.callback.endpoint2.auth-key=X-API-KEY |
| 28 | edc.callback.endpoint2.auth-code-id=mysecret |
| 29 | ``` |
| 30 | |
| 31 | The first one `endpoint1` will be invoked transactionally in all events emitted from the `ContractNegotiation` and `TransferProcess` state machines. |
| 32 | |
| 33 | The second one will only be invoked asynchronously only when a `ContractNegotiatin` is finalized and a `TransferProcess` is completed. |