Skip to content

Instantly share code, notes, and snippets.

@dbarkol
Created January 20, 2020 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbarkol/047dbe488aec9d128c0ceb977efad4b1 to your computer and use it in GitHub Desktop.
Save dbarkol/047dbe488aec9d128c0ceb977efad4b1 to your computer and use it in GitHub Desktop.
CloudEvents validation with APIM
<inbound>
<base />
<!-- Get the WebHook-Request-Origin -->
<set-variable value="@(context.Request.Headers.GetValueOrDefault("WebHook-Request-Origin"))"
name="webhookRequestOrigin" />
<!--
Return the response with the allowed origin
and allowed rate to confirm the subscription.
-->
<return-response>
<set-status code="200" reason="OK" />
<set-header name="WebHook-Allowed-Origin" exists-action="override">
<value>@((string)context.Variables["webhookRequestOrigin"])</value>
</set-header>
<set-header name="WebHook-Allowed-Rate" exists-action="override">
<value>*</value>
</set-header>
<set-body />
</return-response>
</inbound>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment