From b0f155237decce101af8564e56cef75c82f4d3e9 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:54:14 -0800 Subject: [PATCH 1/9] Ensure authorization header is not added to BatchRequests --- CHANGELOG.md | 2 + .../core/content/BatchRequestContent.java | 17 +++--- .../core/content/BatchRequestContentTest.java | 60 +++++++++++++++++++ 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50395e115..b7ab01151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- 'Authorization' header should not be added to BatchRequest Json body. [#1483](https://github.com/microsoftgraph/msgraph-sdk-java-core/issues/1483) + ## [3.1.0] - 2024-02-07 ### Changed diff --git a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java index c382e3581..da8b7a10a 100644 --- a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java +++ b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java @@ -208,13 +208,16 @@ private void writeBatchRequestStep(BatchRequestStep requestStep, JsonWriter writ writer.value(rawBodyContent); } } - if(headers.size() != 0 || requestBody != null) { - writer.name(CoreConstants.BatchRequest.HEADERS); - writer.beginObject(); - for(int i = 0; i < headers.size(); i++) { - writer.name(headers.name(i)).value(headers.value(i)); - } - writer.endObject(); + // If 'authorization' header is the only header, do not include headers object + if(!(headers.names().size() == 1 && headers.names().contains("authorization")) && (headers.size() != 0 || requestBody != null)) { + writer.name(CoreConstants.BatchRequest.HEADERS); + writer.beginObject(); + for (int i = 0; i < headers.size(); i++) { + // If multiple headers exist, do not include 'authorization' header + if(!headers.name(i).equals("authorization")) + writer.name(headers.name(i)).value(headers.value(i)); + } + writer.endObject(); } writer.endObject(); } diff --git a/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java b/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java index 563eb6e45..5856f6900 100644 --- a/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java +++ b/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java @@ -6,9 +6,12 @@ import com.microsoft.graph.core.models.BatchRequestStep; import com.microsoft.graph.core.requests.IBaseClient; import com.microsoft.kiota.HttpMethod; +import com.microsoft.kiota.RequestHeaders; import com.microsoft.kiota.RequestInformation; import com.microsoft.kiota.authentication.AnonymousAuthenticationProvider; +import com.microsoft.kiota.authentication.AuthenticationProvider; +import com.microsoft.kiota.http.OkHttpRequestAdapter; import com.microsoft.kiota.http.middleware.UrlReplaceHandler; import okhttp3.*; import org.junit.jupiter.api.Assertions; @@ -25,6 +28,7 @@ import static com.microsoft.graph.core.CoreConstants.ReplacementConstants.USERS_ENDPOINT_WITH_REPLACE_TOKEN; import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; class BatchRequestContentTest { static final String requestUrl = "https://graph.microsoft.com/v1.0"+USERS_ENDPOINT_WITH_REPLACE_TOKEN; @@ -234,6 +238,61 @@ void BatchRequestContent_GetBatchRequestContentFromStepDoesNotModifyDateTimes() assertEquals(expectedJson, requestContentString); } @Test + void BatchRequestContent_DoNotAddAuthorizationHeader() throws Exception { + OkHttpRequestAdapter adapter = new OkHttpRequestAdapter(mock(AuthenticationProvider.class)); + + String expectedJson = "{\n" + + " \"requests\": [\n" + + " {\n" + + " \"id\": \"1\",\n" + + " \"url\": \"/me\",\n" + + " \"method\": \"GET\",\n" + + " \"headers\": {\n" + + " \"accept\": \"application/json\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"id\": \"2\",\n" + + " \"url\": \"/me\",\n" + + " \"method\": \"GET\"\n" + + " }\n" + + " ]\n" + + "}"; + //The following string is the same size as a token + String longBearerString = "bbcbbbcbccbbabbacbccccbccabbcacacaaabccbccbbbbaabbabcccccbcbcacbbccbcbcaaacaacccacccbabacccabbccbccacccabcbbbbbacaacccabaaacaabcbacbaabcacabcbaaaccaccbbaaaabbbabbcaabbacccccaabbcabbbbbbbaaababaaabbbbcbbbcacbaaccaccabbcbabbabacbcccacbaccacaacaaacbacbaaaacbcbbacbcaaaaabcababbbcaabaaaabaaccbaccaababcbccbbacbaaabcbcbcbaaabcccabcacbbcbbabcccaccbacaaccaaaabcaacaccababbcbcabbccbaaaaaacccbcbccbaaccabbacbaaaacaccabcbbbcaabccccbbabbccaaaccbbbabbabcbcabcbccabbaabaacaaabbacaaccbcabaaaabcaabbabccabbcabcabbbaaaacccbcbcbbaacbbbbbcbbabcbabcbbcbbbaacccaababaccbaabcccccabbcabcababacbcaacbbaabaaacaabbacabcbcabcaabcccccacbaaacccbcabacbcbbbcccaaabacccaabcbcaababaabbacacabcbccacbbcacbbcaaccbbbcccbaaaacbcacabbcaaaacbcaacaccccbbaaabcccaacbabbbcbbccbacabccabaabacbbbbbcbaaaaaccabcbccabcccbcccabababbbbcbbcbbcbcabaabaabccbabcbbbabaaacaaaabcbcabaccaaaaacbaaabcbaccbaccbabacbcabbcbcbbaabbbbccaacccaabacacbabbcacabcbaccbcacbccaabcbbacbacbacbbaaccaaaaccacbcababccccccbbcbacacaaabaaaccbaabaacccbaaabcbcaabaaaaabcabacbabcbbccccbacbaabccaaabcccbbacbbacacaccabbcaacbbbbcbcbbcaabaacbbbcbbcbaaacccbacbaabacacbbabcaaaacaabacbaacaaaabbcacbacbcccacbcabcccacacaaccbbbcaacabcccaaacbabaaccbcbaacacbacaababcabcbccabcabcccaacabacabccaacbbcabbcaacbccaababacccaccabacbbbaabaccbcabcaabbcccacccbcbcabbccabbabaaaccacccbcbacabcaabcaccbbcbaaacbaabbbbcbccbbcccaababababaabacccbbbcabbaaacbcaaabccbbbccabbbcccbcacacaaabbabcacbacaacbbbcbbbbbccabbbabcabbcbacccaaabaaacbaabbacabbabcbcbcacbbaabbabcbcaacbabbcccbabaaccabbacbcaaacabbbbcaacbccbbbbacbcabbbaabcacaaabaabbaaccabbcabcabbacaaaacacabbabccacbbabbbbcabbaaccabcccaabbaaaacaabcbacabbaacaccbbbbaaaaacbcbacbbaaaabbabcaacaaacbbaabcccbbcbaacabbbbcaccaaaabcacbcbaaabbbcabcabcbbbbacbaccaacbccaacbbcaccaaaaacbabbbcbcbacbacbaccaacbcbcbbcaaaabaaabaabccaaaabbcabaaabcbcccbbcbaacacbbacacbabbcbaccabacbabcbcaabbbaabccccccaaccbcbccccbbbbcabaaacbbbaacbbaccaabcbcaacaacaacacaababcccbacbbccccbcacbcbcaacaaaacccccccaccaababaacbaabbcbbbccaacbabbcbcaaabbccacbbaabbbbcbbccbcccbbcacabaaacbacacbcaaabcbccacacccbbaacbacbbcbabbcbbbbcaccbaaccbcbcaabcababcbbbcccbcbaababcacbacbbbacacacabbccabbbaaaaacaccbbccbccbabaababcbbccabcaaacaccacabbaabacacabaccabacbacabbccbabaccbabcccbbcbbbaaabbccabbcbbbacacbbbabbcbbacbcabacaccabbbcbabbcbcacbcbbabbbbcabcbbabbbcaaccbaaaaccbababbbaabcbbbaacabbbbcabcabbcabbacabbccccaabaaaaabbcbabacbacbabcabcccabbbccbbcccaacacaabbcbabcbabaaaababbbacabaacbabbabcbbbcbccbacbcbccbbbccccbacaccbaccaaabbaacbbaaabbbcaccbabbcccbbbbccacbbaaacabbbbaabbabcccabcbcbbccccbacccabbbaaabcacccaabbabaccccbbbcccccaacbbbccbcabbbcccababbbcacccccccabccbbcaabccbbbaaccabbcaabcacabbcbbabcccaccccaaacbbbccaaabcbacabbbacbaccaabcbabababbcbcacaabcaabcbcbbcaaacaacabaaababbbacaccababaccbacacacacacbcccbabcbabcabccbaabcccababcbacbccccccacacbbacccccbaccbacaacbacacbcccccaaaacbaaaaccbacbbcacccbbbaabaaaccaccbcabcccccacaaaabcbabbacbbbcaaababcbacccbabcbaaabbcbaaacaabbcaaccaaccbacbaaaaaaabbaacaaabacbbcaacaacabbcabaccaaacbaccccbcccbcbcaaacbacaacccaccaacabacaaaabbbbbbbcacacbabccacacabbbababbbbcbabaaacaaacbacbcabbccacaacccbbbcbbacaccbbbaaabababbcbaacbcabcabaaccbcaaacbbbaacacccbbcaabcbacabbccbcbbbabbbaabacacaccaabbcbbaccbaaabcabbababaccca"; + RequestInformation requestInfo = new RequestInformation(); + requestInfo.urlTemplate = "{+baseurl}/users/{user%2Did}{?%24expand,%24select}"; + HashMap pathParameters = new HashMap<>(); + pathParameters.put("baseurl", "https://graph.microsoft.com/v1.0"); + pathParameters.put("user%2Did", "TokenToReplace"); + requestInfo.pathParameters = pathParameters; + requestInfo.httpMethod = HttpMethod.GET; + // Only one header should be present in the headers object of the Json Body + requestInfo.headers.add("accept", "application/json"); + requestInfo.headers.add("authorization", longBearerString); + RequestInformation requestInfo2 = new RequestInformation(); + requestInfo2.urlTemplate = "{+baseurl}/users/{user%2Did}{?%24expand,%24select}"; + HashMap pathParameters2 = new HashMap<>(); + pathParameters2.put("baseurl", "https://graph.microsoft.com/v1.0"); + pathParameters2.put("user%2Did", "TokenToReplace"); + requestInfo2.pathParameters = pathParameters2; + requestInfo2.httpMethod = HttpMethod.GET; + // No headers object should be present in the Json body + requestInfo2.headers.add("authorization", longBearerString); + + BatchRequestContent batchRequestContent = new BatchRequestContent(client); + batchRequestContent.addBatchRequestStep(new BatchRequestStep("1",adapter.convertToNativeRequest(requestInfo))); + batchRequestContent.addBatchRequestStep(new BatchRequestStep("2",adapter.convertToNativeRequest(requestInfo2))); + + InputStream stream = batchRequestContent.getBatchRequestContent(); + String requestContentString = readInputStream(stream); + requestContentString = requestContentString.replace("\n", "").replaceAll("\\s", ""); + expectedJson = expectedJson.replace("\n", "").replaceAll("\\s", ""); + + assertNotNull(requestContentString); + assertEquals(expectedJson, requestContentString); + } + @Test void BatchRequestContent_AddBatchRequestStepWithHttpRequestMessage() { BatchRequestContent batchRequestContent = new BatchRequestContent(client); assertTrue(batchRequestContent.getBatchRequestSteps().isEmpty()); @@ -248,6 +307,7 @@ void BatchRequestContent_AddBatchRequestStepWithHttpRequestMessage() { Assertions.assertEquals(batchRequestContent.getBatchRequestSteps().get(requestId).getRequest().url().uri().toString(), request.url().uri().toString()); Assertions.assertEquals(batchRequestContent.getBatchRequestSteps().get(requestId).getRequest().method(), request.method()); } + @Test void BatchRequestContent_AddBatchRequestStepWithHttpRequestMessageToBatchRequestContentWithMaxSteps() { BatchRequestContent batchRequestContent = new BatchRequestContent(client); From f2023fd706f0f49ff3b78e6c8203a2308adff1f1 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:39:18 -0800 Subject: [PATCH 2/9] remove authorization header --- .../graph/core/content/BatchRequestContent.java | 11 ++++++----- .../graph/core/content/BatchRequestContentTest.java | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java index da8b7a10a..23d2c0b4b 100644 --- a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java +++ b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java @@ -178,6 +178,7 @@ public InputStream getBatchRequestContent() throws IOException { return in; } } + private static final String AUTHORIZATION_HEADER_KEY = "authorization"; private void writeBatchRequestStep(BatchRequestStep requestStep, JsonWriter writer) throws IOException { Request request = requestStep.getRequest(); writer.beginObject(); @@ -208,14 +209,14 @@ private void writeBatchRequestStep(BatchRequestStep requestStep, JsonWriter writ writer.value(rawBodyContent); } } - // If 'authorization' header is the only header, do not include headers object - if(!(headers.names().size() == 1 && headers.names().contains("authorization")) && (headers.size() != 0 || requestBody != null)) { + //Remove the header if it is some version of 'authorization' + //RemoveAll utilizes ignoreCase natively + headers = headers.newBuilder().removeAll(AUTHORIZATION_HEADER_KEY).build(); + if((headers.size() != 0 || requestBody != null)) { writer.name(CoreConstants.BatchRequest.HEADERS); writer.beginObject(); for (int i = 0; i < headers.size(); i++) { - // If multiple headers exist, do not include 'authorization' header - if(!headers.name(i).equals("authorization")) - writer.name(headers.name(i)).value(headers.value(i)); + writer.name(headers.name(i)).value(headers.value(i)); } writer.endObject(); } diff --git a/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java b/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java index 5856f6900..b944a189d 100644 --- a/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java +++ b/src/test/java/com/microsoft/graph/core/content/BatchRequestContentTest.java @@ -6,7 +6,6 @@ import com.microsoft.graph.core.models.BatchRequestStep; import com.microsoft.graph.core.requests.IBaseClient; import com.microsoft.kiota.HttpMethod; -import com.microsoft.kiota.RequestHeaders; import com.microsoft.kiota.RequestInformation; import com.microsoft.kiota.authentication.AnonymousAuthenticationProvider; @@ -278,7 +277,7 @@ void BatchRequestContent_DoNotAddAuthorizationHeader() throws Exception { requestInfo2.pathParameters = pathParameters2; requestInfo2.httpMethod = HttpMethod.GET; // No headers object should be present in the Json body - requestInfo2.headers.add("authorization", longBearerString); + requestInfo2.headers.add("AuthoriZation", longBearerString); // Test with strange casing BatchRequestContent batchRequestContent = new BatchRequestContent(client); batchRequestContent.addBatchRequestStep(new BatchRequestStep("1",adapter.convertToNativeRequest(requestInfo))); From 16ce583c64045517d23b15faf9479e32a86ad110 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:49:06 -0800 Subject: [PATCH 3/9] formating --- .../graph/core/content/BatchRequestContent.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java index 23d2c0b4b..2a0f511f2 100644 --- a/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java +++ b/src/main/java/com/microsoft/graph/core/content/BatchRequestContent.java @@ -212,13 +212,13 @@ private void writeBatchRequestStep(BatchRequestStep requestStep, JsonWriter writ //Remove the header if it is some version of 'authorization' //RemoveAll utilizes ignoreCase natively headers = headers.newBuilder().removeAll(AUTHORIZATION_HEADER_KEY).build(); - if((headers.size() != 0 || requestBody != null)) { - writer.name(CoreConstants.BatchRequest.HEADERS); - writer.beginObject(); - for (int i = 0; i < headers.size(); i++) { - writer.name(headers.name(i)).value(headers.value(i)); - } - writer.endObject(); + if(headers.size() != 0 || requestBody != null) { + writer.name(CoreConstants.BatchRequest.HEADERS); + writer.beginObject(); + for (int i = 0; i < headers.size(); i++) { + writer.name(headers.name(i)).value(headers.value(i)); + } + writer.endObject(); } writer.endObject(); } From c0d3fb2b8afdff9eee6e6734fd98e20dba7be29f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:17:20 +0000 Subject: [PATCH 4/9] chore(deps): bump the kiota-dependencies group with 7 updates Bumps the kiota-dependencies group with 7 updates: | Package | From | To | | --- | --- | --- | | [com.microsoft.kiota:microsoft-kiota-abstractions](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-authentication-azure](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-http-okHttp](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-serialization-json](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-serialization-text](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-serialization-form](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | | [com.microsoft.kiota:microsoft-kiota-serialization-multipart](https://github.com/microsoft/kiota-java) | `1.0.0` | `1.0.1` | Updates `com.microsoft.kiota:microsoft-kiota-abstractions` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-authentication-azure` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-http-okHttp` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-serialization-json` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-serialization-text` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-serialization-form` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) Updates `com.microsoft.kiota:microsoft-kiota-serialization-multipart` from 1.0.0 to 1.0.1 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: com.microsoft.kiota:microsoft-kiota-abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-authentication-azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-http-okHttp dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-text dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-form dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-multipart dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 8507533cf..cd2dad709 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -16,11 +16,11 @@ dependencies { api 'com.squareup.okhttp3:okhttp:4.12.0' api 'com.azure:azure-core:1.46.0' - api 'com.microsoft.kiota:microsoft-kiota-abstractions:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.0.0' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.0.0' + api 'com.microsoft.kiota:microsoft-kiota-abstractions:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.0.1' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.0.1' } From 7fa13837f212bc242900acace67f51ca515a9dd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:23:32 +0000 Subject: [PATCH 5/9] chore(deps): bump io.github.std-uritemplate:std-uritemplate Bumps [io.github.std-uritemplate:std-uritemplate](https://github.com/std-uritemplate/std-uritemplate) from 0.0.50 to 0.0.52. - [Commits](https://github.com/std-uritemplate/std-uritemplate/compare/0.0.50...0.0.52) --- updated-dependencies: - dependency-name: io.github.std-uritemplate:std-uritemplate dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index cd2dad709..8f4a89945 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -7,7 +7,7 @@ dependencies { testImplementation 'io.opentelemetry:opentelemetry-api:1.34.1' testImplementation 'io.opentelemetry:opentelemetry-context:1.34.1' testImplementation 'io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha' - testImplementation 'io.github.std-uritemplate:std-uritemplate:0.0.50' + testImplementation 'io.github.std-uritemplate:std-uritemplate:0.0.52' implementation 'com.google.code.gson:gson:2.10.1' From d11a65a1cd2482d3e82915cfa3257caab86f6b86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:34:35 +0000 Subject: [PATCH 6/9] chore(deps): bump io.opentelemetry:opentelemetry-api Bumps [io.opentelemetry:opentelemetry-api](https://github.com/open-telemetry/opentelemetry-java) from 1.34.1 to 1.35.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.1...v1.35.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 8f4a89945..45a4e3a23 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -4,7 +4,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' testImplementation 'org.mockito:mockito-inline:5.2.0' - testImplementation 'io.opentelemetry:opentelemetry-api:1.34.1' + testImplementation 'io.opentelemetry:opentelemetry-api:1.35.0' testImplementation 'io.opentelemetry:opentelemetry-context:1.34.1' testImplementation 'io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha' testImplementation 'io.github.std-uritemplate:std-uritemplate:0.0.52' From 1be2c3bb04656216841adfc79df15f19d8693a93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:38:54 +0000 Subject: [PATCH 7/9] chore(deps): bump io.opentelemetry:opentelemetry-context Bumps [io.opentelemetry:opentelemetry-context](https://github.com/open-telemetry/opentelemetry-java) from 1.34.1 to 1.35.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.1...v1.35.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-context dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 45a4e3a23..76cf070bf 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -5,7 +5,7 @@ dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' testImplementation 'org.mockito:mockito-inline:5.2.0' testImplementation 'io.opentelemetry:opentelemetry-api:1.35.0' - testImplementation 'io.opentelemetry:opentelemetry-context:1.34.1' + testImplementation 'io.opentelemetry:opentelemetry-context:1.35.0' testImplementation 'io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha' testImplementation 'io.github.std-uritemplate:std-uritemplate:0.0.52' From 10c1351511d54c6ea472fbf0198711c2ac1648aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:58:50 +0000 Subject: [PATCH 8/9] chore(deps): bump io.opentelemetry:opentelemetry-context in /android Bumps [io.opentelemetry:opentelemetry-context](https://github.com/open-telemetry/opentelemetry-java) from 1.34.1 to 1.35.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.1...v1.35.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-context dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 45a4e3a23..76cf070bf 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -5,7 +5,7 @@ dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' testImplementation 'org.mockito:mockito-inline:5.2.0' testImplementation 'io.opentelemetry:opentelemetry-api:1.35.0' - testImplementation 'io.opentelemetry:opentelemetry-context:1.34.1' + testImplementation 'io.opentelemetry:opentelemetry-context:1.35.0' testImplementation 'io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha' testImplementation 'io.github.std-uritemplate:std-uritemplate:0.0.52' From 849b96392c7f094115d09328d0225dc0d4fd3f94 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:53:20 -0800 Subject: [PATCH 9/9] bump to 3.1.2 --- CHANGELOG.md | 6 +++++- gradle.properties | 2 +- src/main/java/com/microsoft/graph/core/CoreConstants.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b5a58d52..6ec67b6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- 'Authorization' header should not be added to BatchRequest Json body. [#1483](https://github.com/microsoftgraph/msgraph-sdk-java-core/issues/1483) +## [3.1.2] - 2024-02-12 + +### Changed + +- Fixes bug where 'Authorization' header was being added leading to long delays in writing BatchRequests. [#1483](https://github.com/microsoftgraph/msgraph-sdk-java-core/issues/1483) ## [3.1.1] - 2024-02-09 diff --git a/gradle.properties b/gradle.properties index 2cbe5716f..97509fd1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph mavenArtifactId = microsoft-graph-core mavenMajorVersion = 3 mavenMinorVersion = 1 -mavenPatchVersion = 1 +mavenPatchVersion = 2 mavenArtifactSuffix = #These values are used to run functional tests diff --git a/src/main/java/com/microsoft/graph/core/CoreConstants.java b/src/main/java/com/microsoft/graph/core/CoreConstants.java index b31b20952..67e611d89 100644 --- a/src/main/java/com/microsoft/graph/core/CoreConstants.java +++ b/src/main/java/com/microsoft/graph/core/CoreConstants.java @@ -14,7 +14,7 @@ private CoreConstants() {} private static class VersionValues { private static final int MAJOR = 3; private static final int MINOR = 1; - private static final int PATCH = 0; + private static final int PATCH = 2; } /**