Webhook
This commit is contained in:
Stef Heyenrath
2021-03-24 18:15:31 +01:00
committed by GitHub
parent cee73023c7
commit d758301e4f
38 changed files with 1206 additions and 338 deletions

View File

@@ -0,0 +1,17 @@
namespace WireMock.Settings
{
/// <summary>
/// HttpClientSettings
/// </summary>
public class HttpClientSettings : IHttpClientSettings
{
/// <inheritdoc cref="IHttpClientSettings.ClientX509Certificate2ThumbprintOrSubjectName"/>
public string ClientX509Certificate2ThumbprintOrSubjectName { get; set; }
/// <inheritdoc cref="IHttpClientSettings.WebProxySettings"/>
public IWebProxySettings WebProxySettings { get; set; }
/// <inheritdoc cref="IHttpClientSettings.AllowAutoRedirect"/>
public bool? AllowAutoRedirect { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
namespace WireMock.Settings
{
/// <summary>
/// IHttpClientSettings
/// </summary>
public interface IHttpClientSettings
{
/// <summary>
/// The clientCertificate thumbprint or subject name fragment to use.
/// Example thumbprint : "D2DBF135A8D06ACCD0E1FAD9BFB28678DF7A9818". Example subject name: "www.google.com""
/// </summary>
string ClientX509Certificate2ThumbprintOrSubjectName { get; set; }
/// <summary>
/// Defines the WebProxySettings.
/// </summary>
IWebProxySettings WebProxySettings { get; set; }
/// <summary>
/// Proxy requests should follow redirection (30x).
/// </summary>
bool? AllowAutoRedirect { get; set; }
}
}

View File

@@ -5,7 +5,7 @@ namespace WireMock.Settings
/// <summary>
/// IProxyAndRecordSettings
/// </summary>
public interface IProxyAndRecordSettings
public interface IProxyAndRecordSettings : IHttpClientSettings
{
/// <summary>
/// The URL to proxy.
@@ -29,12 +29,6 @@ namespace WireMock.Settings
/// </summary>
bool SaveMappingToFile { get; set; }
/// <summary>
/// The clientCertificate thumbprint or subject name fragment to use.
/// Example thumbprint : "D2DBF135A8D06ACCD0E1FAD9BFB28678DF7A9818". Example subject name: "www.google.com""
/// </summary>
string ClientX509Certificate2ThumbprintOrSubjectName { get; set; }
/// <summary>
/// Defines a list from headers which will be excluded from the saved mappings.
/// </summary>
@@ -44,15 +38,5 @@ namespace WireMock.Settings
/// Defines a list of cookies which will be excluded from the saved mappings.
/// </summary>
string[] ExcludedCookies { get; set; }
/// <summary>
/// Defines the WebProxySettings.
/// </summary>
IWebProxySettings WebProxySettings { get; set; }
/// <summary>
/// Proxy requests should follow redirection (30x).
/// </summary>
bool? AllowAutoRedirect { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Settings
{
/// <summary>
/// IWebhookSettings
/// </summary>
public interface IWebhookSettings : IHttpClientSettings
{
}
}

View File

@@ -186,5 +186,11 @@ namespace WireMock.Settings
/// </summary>
[PublicAPI]
bool CustomCertificateDefined { get; }
/// <summary>
/// Defines the global IWebhookSettingsto use
/// </summary>
[PublicAPI]
IWebhookSettings WebhookSettings { get; set; }
}
}

View File

@@ -5,7 +5,7 @@ namespace WireMock.Settings
/// <summary>
/// ProxyAndRecordSettings
/// </summary>
public class ProxyAndRecordSettings : IProxyAndRecordSettings
public class ProxyAndRecordSettings : HttpClientSettings, IProxyAndRecordSettings
{
/// <summary>
/// The URL to proxy.
@@ -32,13 +32,6 @@ namespace WireMock.Settings
[PublicAPI]
public string SaveMappingForStatusCodePattern { get; set; } = "*";
/// <summary>
/// The clientCertificate thumbprint or subject name fragment to use.
/// Example thumbprint : "D2DBF135A8D06ACCD0E1FAD9BFB28678DF7A9818". Example subject name: "www.google.com""
/// </summary>
[PublicAPI]
public string ClientX509Certificate2ThumbprintOrSubjectName { get; set; }
/// <inheritdoc cref="IProxyAndRecordSettings.ExcludedHeaders"/>
[PublicAPI]
public string[] ExcludedHeaders { get; set; }
@@ -46,13 +39,5 @@ namespace WireMock.Settings
/// <inheritdoc cref="IProxyAndRecordSettings.ExcludedCookies"/>
[PublicAPI]
public string[] ExcludedCookies { get; set; }
/// <inheritdoc cref="IProxyAndRecordSettings.WebProxySettings"/>
[PublicAPI]
public IWebProxySettings WebProxySettings { get; set; }
/// <inheritdoc cref="IProxyAndRecordSettings.AllowAutoRedirect"/>
[PublicAPI]
public bool? AllowAutoRedirect { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Settings
{
/// <summary>
/// WebhookSettings
/// </summary>
public class WebhookSettings : HttpClientSettings, IWebhookSettings
{
}
}

View File

@@ -129,5 +129,9 @@ namespace WireMock.Settings
/// <inheritdoc cref="IWireMockServerSettings.CustomCertificateDefined"/>
[PublicAPI]
public bool CustomCertificateDefined => CertificateSettings?.IsDefined == true;
/// <inheritdoc cref="IWireMockServerSettings.WebhookSettings"/>
[PublicAPI]
public IWebhookSettings WebhookSettings { get; set; }
}
}