C# Class Webhooks.Consumer.SampleJsonProcessor

Afficher le fichier Open project: exzeo/webhooks-consumer-csharp-sample

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat bool

Handle() public méthode

public Handle ( ) : Response
Résultat Nancy.Response

SampleJsonProcessor() public méthode

public SampleJsonProcessor ( Nancy.NancyModule module, IWebhookSettings settings ) : System
module Nancy.NancyModule
settings IWebhookSettings
Résultat System

ToHexString() public static méthode

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