C# Class Webhooks.Consumer.SampleJsonProcessor

Exibir arquivo Open project: exzeo/webhooks-consumer-csharp-sample

Public Methods

Method Description
EnsureAuthenticatedPost ( String inboundHash, String inboundJson, String secretToken ) : bool

Verifies the inbound JSON message is a valid one or not

Handle ( ) : Response
SampleJsonProcessor ( Nancy.NancyModule module, IWebhookSettings settings ) : System
ToHexString ( byte array ) : string

Generates a hexadecimal formatted string for the given byte array

Private Methods

Method Description
GetMessageHash ( string value, string salt ) : byte[]

Generates a HMA SHA1 hexdigest for a given string using a salt

JsonPrettify ( string json ) : String

Method Details

EnsureAuthenticatedPost() public method

Verifies the inbound JSON message is a valid one or not
public EnsureAuthenticatedPost ( String inboundHash, String inboundJson, String secretToken ) : bool
inboundHash String Hash value sent through the HTTP header
inboundJson String JSON body HTTP posted
secretToken String Secret token set by the webhook
return bool

Handle() public method

public Handle ( ) : Response
return Nancy.Response

SampleJsonProcessor() public method

public SampleJsonProcessor ( Nancy.NancyModule module, IWebhookSettings settings ) : System
module Nancy.NancyModule
settings IWebhookSettings
return System

ToHexString() public static method

Generates a hexadecimal formatted string for the given byte array
public static ToHexString ( byte array ) : string
array byte Array of bytes
return string