-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
91 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[*.cs] | ||
|
||
# SA1101: Prefix local calls with this | ||
dotnet_diagnostic.SA1101.severity = none | ||
|
||
# SA1309: Field names should not begin with underscore | ||
dotnet_diagnostic.SA1309.severity = none | ||
|
||
# SA1623: Property summary documentation should match accessors | ||
dotnet_diagnostic.SA1623.severity = none | ||
|
||
# SA1642: Constructor summary documentation should begin with standard text | ||
dotnet_diagnostic.SA1642.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <copyright file="IMailgunSignature.cs" company="Balazs Keresztury"> | ||
// Copyright (c) Balazs Keresztury. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
using System; | ||
|
||
namespace Mailgun.Models.SignedEvent | ||
{ | ||
public interface IMailgunSignature | ||
{ | ||
string Signature { get; set; } | ||
|
||
string Timestamp { get; set; } | ||
|
||
string Token { get; set; } | ||
|
||
/// <summary> | ||
/// Checks if the signature is valid based on the provided API key with a maximum allowed time skew of 10 minutes. | ||
/// https://documentation.mailgun.com/en/latest/user_manual.html#webhooks. | ||
/// </summary> | ||
/// <param name="apiKey">malgun API key.</param> | ||
/// <returns>True if the signature is valid.</returns> | ||
bool IsValid(string apiKey); | ||
|
||
/// <summary> | ||
/// Checks if the signature is valid based on the provided API key. | ||
/// https://documentation.mailgun.com/en/latest/user_manual.html#webhooks. | ||
/// </summary> | ||
/// <param name="apiKey">mailgun API key.</param> | ||
/// <param name="tolerance">Maximum acceptable time difference between the creation of the signature and now.</param> | ||
/// <returns>True if the signature is valid.</returns> | ||
bool IsValid(string apiKey, TimeSpan tolerance); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters