diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af9b0e..a831ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Changes in Medidata.MAuth +## v5.1.7 +- **[Core]** Fix preprocessor for sync methods + ## v5.1.6 - **[Core]** Fix bug in MAuth verification. diff --git a/src/Medidata.MAuth.Core/HttpRequestMessageExtensions.cs b/src/Medidata.MAuth.Core/HttpRequestMessageExtensions.cs index 2be15ef..32f5482 100644 --- a/src/Medidata.MAuth.Core/HttpRequestMessageExtensions.cs +++ b/src/Medidata.MAuth.Core/HttpRequestMessageExtensions.cs @@ -14,7 +14,7 @@ public async static Task GetRequestContentAsBytesAsync(this HttpRequestM : await request.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } -#if NET5_0 +#if NET5_0_OR_GREATER public static byte[] GetRequestContentAsBytes(this HttpRequestMessage request) { using var memoryStream = new MemoryStream(); diff --git a/src/Medidata.MAuth.Core/IMAuthCore.cs b/src/Medidata.MAuth.Core/IMAuthCore.cs index cd5560c..005ca2e 100644 --- a/src/Medidata.MAuth.Core/IMAuthCore.cs +++ b/src/Medidata.MAuth.Core/IMAuthCore.cs @@ -13,7 +13,7 @@ internal interface IMAuthCore (string mAuthHeaderKey, string mAuthTimeHeaderKey) GetHeaderKeys(); -#if NET5_0 +#if NET5_0_OR_GREATER HttpRequestMessage SignSync(HttpRequestMessage request, MAuthSigningOptions options); #endif } diff --git a/src/Medidata.MAuth.Core/MAuthCore.cs b/src/Medidata.MAuth.Core/MAuthCore.cs index 4df6b6c..18b5b54 100644 --- a/src/Medidata.MAuth.Core/MAuthCore.cs +++ b/src/Medidata.MAuth.Core/MAuthCore.cs @@ -153,7 +153,7 @@ internal string CalculatePayload(HttpRequestMessage request, PrivateKeyAuthentic return (Constants.MAuthHeaderKey, Constants.MAuthTimeHeaderKey); } -#if NET5_0 +#if NET5_0_OR_GREATER public HttpRequestMessage SignSync(HttpRequestMessage request, MAuthSigningOptions options) { var authInfo = new PrivateKeyAuthenticationInfo() diff --git a/src/Medidata.MAuth.Core/MAuthCoreV2.cs b/src/Medidata.MAuth.Core/MAuthCoreV2.cs index bf6d62c..2f19a79 100644 --- a/src/Medidata.MAuth.Core/MAuthCoreV2.cs +++ b/src/Medidata.MAuth.Core/MAuthCoreV2.cs @@ -165,7 +165,7 @@ internal string CalculatePayload( return (Constants.MAuthHeaderKeyV2, Constants.MAuthTimeHeaderKeyV2); } -#if NET5_0 +#if NET5_0_OR_GREATER /// /// Signs an HTTP request with the MAuth-specific authentication information. /// diff --git a/src/Medidata.MAuth.Core/MAuthSigningHandler.cs b/src/Medidata.MAuth.Core/MAuthSigningHandler.cs index 8d3a748..d110414 100644 --- a/src/Medidata.MAuth.Core/MAuthSigningHandler.cs +++ b/src/Medidata.MAuth.Core/MAuthSigningHandler.cs @@ -68,7 +68,7 @@ protected override async Task SendAsync( .ConfigureAwait(continueOnCapturedContext: false); } -#if NET5_0 +#if NET5_0_OR_GREATER /// /// Signs an HTTP request with the MAuth-specific authentication information and sends the request to the /// inner handler to send to the server a synchronous operation. diff --git a/tests/Medidata.MAuth.CoreTests/MAuthAuthenticatorTests.cs b/tests/Medidata.MAuth.CoreTests/MAuthAuthenticatorTests.cs index e8914b8..5633f20 100644 --- a/tests/Medidata.MAuth.CoreTests/MAuthAuthenticatorTests.cs +++ b/tests/Medidata.MAuth.CoreTests/MAuthAuthenticatorTests.cs @@ -416,7 +416,7 @@ public static async Task AuthenticateRequest_WithMWSV2Request_AfterNumberOfAttem Assert.Equal(HttpStatusCode.ServiceUnavailable, innerException.Responses.First().StatusCode); } - #if NET5_0 + #if NET5_0_OR_GREATER [Theory] [InlineData("GET")] [InlineData("DELETE")] diff --git a/tests/Medidata.MAuth.CoreTests/MAuthSigningHandlerTests.cs b/tests/Medidata.MAuth.CoreTests/MAuthSigningHandlerTests.cs index e5a8676..f04b083 100644 --- a/tests/Medidata.MAuth.CoreTests/MAuthSigningHandlerTests.cs +++ b/tests/Medidata.MAuth.CoreTests/MAuthSigningHandlerTests.cs @@ -94,7 +94,7 @@ public static async Task SendAsync_WithSignVersionsMWSAndMWSV2_WillSignWithBothM Assert.Equal(testData.SignedTime, long.Parse(actual.MAuthTimeHeaderV2).FromUnixTimeSeconds()); } -#if NET5_0 +#if NET5_0_OR_GREATER [Theory] [InlineData("GET")] [InlineData("DELETE")] diff --git a/version.props b/version.props index bf48726..ad274b1 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@  - 5.1.6 + 5.1.7