Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preprocessor symbols for sync methods #100

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/Medidata.MAuth.Core/HttpRequestMessageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public async static Task<byte[]> 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();
Expand Down
2 changes: 1 addition & 1 deletion src/Medidata.MAuth.Core/IMAuthCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/Medidata.MAuth.Core/MAuthCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Medidata.MAuth.Core/MAuthCoreV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ internal string CalculatePayload(
return (Constants.MAuthHeaderKeyV2, Constants.MAuthTimeHeaderKeyV2);
}

#if NET5_0
#if NET5_0_OR_GREATER
/// <summary>
/// Signs an HTTP request with the MAuth-specific authentication information.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Medidata.MAuth.Core/MAuthSigningHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
.ConfigureAwait(continueOnCapturedContext: false);
}

#if NET5_0
#if NET5_0_OR_GREATER
/// <summary>
/// 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.
Expand Down
2 changes: 1 addition & 1 deletion tests/Medidata.MAuth.CoreTests/MAuthAuthenticatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion tests/Medidata.MAuth.CoreTests/MAuthSigningHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>5.1.6</Version>
<Version>5.1.7</Version>
</PropertyGroup>
</Project>
Loading