From 699dee33600440f9f38bedc3f7484fa370a55542 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 18 Aug 2023 11:54:12 +0530 Subject: [PATCH 1/5] Fix removing pseudo headers (cherry picked from commit 35ad764aad2902f78cbf688c82206f6904382280) --- .../stdlib/http/transport/contract/Constants.java | 2 -- .../stdlib/http/transport/contractimpl/common/Util.java | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/native/src/main/java/io/ballerina/stdlib/http/transport/contract/Constants.java b/native/src/main/java/io/ballerina/stdlib/http/transport/contract/Constants.java index a07a73b630..a99caa264e 100644 --- a/native/src/main/java/io/ballerina/stdlib/http/transport/contract/Constants.java +++ b/native/src/main/java/io/ballerina/stdlib/http/transport/contract/Constants.java @@ -225,8 +225,6 @@ public final class Constants { public static final String AUTHORITY = "AUTHORITY"; public static final String HTTP2_METHOD = ":method"; public static final String HTTP2_PATH = ":path"; - public static final String HTTP2_AUTHORITY = ":authority"; - public static final String HTTP2_SCHEME = ":scheme"; public static final String HTTP2_STATUS = ":status"; public static final String HTTP_SOURCE_HANDLER = "SourceHandler"; diff --git a/native/src/main/java/io/ballerina/stdlib/http/transport/contractimpl/common/Util.java b/native/src/main/java/io/ballerina/stdlib/http/transport/contractimpl/common/Util.java index 8f64abba11..4c30db63c4 100644 --- a/native/src/main/java/io/ballerina/stdlib/http/transport/contractimpl/common/Util.java +++ b/native/src/main/java/io/ballerina/stdlib/http/transport/contractimpl/common/Util.java @@ -287,15 +287,13 @@ public static HttpRequest createHttpRequestFromHttp2Headers(Http2Headers http2He throws Http2Exception { String method = Constants.HTTP_GET_METHOD; if (http2Headers.method() != null) { - method = http2Headers.getAndRemove(Constants.HTTP2_METHOD).toString(); + method = http2Headers.get(Constants.HTTP2_METHOD).toString(); } String path = Constants.DEFAULT_BASE_PATH; if (http2Headers.path() != null) { - path = http2Headers.getAndRemove(Constants.HTTP2_PATH).toString(); + path = http2Headers.get(Constants.HTTP2_PATH).toString(); } - // Remove PseudoHeaderNames from headers - http2Headers.getAndRemove(Constants.HTTP2_AUTHORITY); - http2Headers.getAndRemove(Constants.HTTP2_SCHEME); + HttpVersion version = new HttpVersion(Constants.HTTP_VERSION_2_0, true); // Construct new HTTP Carbon Request From 77c817e5c5131c457436196f14947c4358d7fd5c Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 18 Aug 2023 12:31:28 +0530 Subject: [PATCH 2/5] Add test cases for http2 header binding (cherry picked from commit 163e1f00ab3e6d1469916facb18e81d7769a59f2) --- ..._dispatching_header_param_binding_test.bal | 849 ++++++++++++++++++ .../http2-tests/tests/test_service_ports.bal | 1 + 2 files changed, 850 insertions(+) create mode 100644 ballerina-tests/http2-tests/tests/http2_service_dispatching_header_param_binding_test.bal diff --git a/ballerina-tests/http2-tests/tests/http2_service_dispatching_header_param_binding_test.bal b/ballerina-tests/http2-tests/tests/http2_service_dispatching_header_param_binding_test.bal new file mode 100644 index 0000000000..a7e36ef880 --- /dev/null +++ b/ballerina-tests/http2-tests/tests/http2_service_dispatching_header_param_binding_test.bal @@ -0,0 +1,849 @@ +// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; +import ballerina/test; +import ballerina/http_test_common as common; + +listener http:Listener HeaderBindingEP = new (headerParamBindingTestPort); +final http:Client headerBindingClient = check new ("http://localhost:" + headerParamBindingTestPort.toString()); + +service /headerparamservice on HeaderBindingEP { + + resource function get .(@http:Header string foo, int bar, http:Request req) returns json { + json responseJson = {value1: foo, value2: bar}; + return responseJson; + } + + resource function post q1/[string go](@http:Header string[] foo, @http:Payload string a, string b) + returns json { + json responseJson = {xType: foo, path: go, payload: a, page: b}; + return responseJson; + } + + resource function get q2(@http:Header {name: "x-Type"} string foo, @http:Header {name: "x-Type"} string[] bar) + returns json { + json responseJson = {firstValue: foo, allValue: bar}; + return responseJson; + } + + resource function get q3(@http:Header string? foo, http:Request req, @http:Header string[]? bar, + http:Headers headerObj) returns json|error { + string[] err = ["bar header not found"]; + string header1 = foo ?: "foo header not found"; + string[] header2 = bar ?: err; + string header3 = check headerObj.getHeader("BAz"); + json responseJson = {val1: header1, val2: header2, val3: header3}; + return responseJson; + } + + resource function get q4(@http:Header string? foo, http:Headers headerObj) returns json { + string header1 = foo ?: "foo header not found"; + boolean headerBool = headerObj.hasHeader("foo"); + + string|error header2Val = headerObj.getHeader("baz"); + string header2 = header2Val is string ? header2Val : (header2Val.message()); + + string[]|error header3Val = headerObj.getHeaders("daz"); + string[] header3 = []; + if header3Val is string[] { + header3 = header3Val; + } else { + header3[0] = header3Val.message(); + } + string[] headerNames = headerObj.getHeaderNames(); + json responseJson = {val1: header1, val2: header2, val3: headerBool, val4: header3, val5: headerNames}; + return responseJson; + } + + resource function get q5(@http:Header string x\-Type) returns string { + return x\-Type; + } + + resource function get q6(@http:Header string? foo) returns string { + return foo ?: "empty"; + } +} + +public type RateLimitHeaders record {| + string x\-rate\-limit\-id; + int? x\-rate\-limit\-remaining; + string[]? x\-rate\-limit\-types; +|}; + +public type PureTypeHeaders record {| + string sid; + int iid; + float fid; + decimal did; + boolean bid; + string[] said; + int[] iaid; + float[] faid; + decimal[] daid; + boolean[] baid; +|}; + +public type NilableTypeHeaders record {| + string? sid; + int? iid; + float? fid; + decimal? did; + boolean? bid; + string[]? said; + int[]? iaid; + float[]? faid; + decimal[]? daid; + boolean[]? baid; +|}; + +public type ReadonlyTypeHeaders record {| + readonly & string[] sid; + readonly & int[]? iid; + readonly & string[]? said; + readonly & int[] iaid; +|}; + +service /headerRecord on HeaderBindingEP { + resource function get rateLimitHeaders(@http:Header RateLimitHeaders rateLimitHeaders) returns json { + return { + header1: rateLimitHeaders.x\-rate\-limit\-id, + header2: rateLimitHeaders.x\-rate\-limit\-remaining, + header3: rateLimitHeaders.x\-rate\-limit\-types + }; + } + + resource function post ofStringOfPost(@http:Header RateLimitHeaders rateLimitHeaders) returns json { + return { + header1: rateLimitHeaders.x\-rate\-limit\-id, + header2: rateLimitHeaders.x\-rate\-limit\-remaining, + header3: rateLimitHeaders.x\-rate\-limit\-types + }; + } + + resource function get rateLimitHeadersNilableRecord(@http:Header RateLimitHeaders? rateLimitHeaders) returns json { + RateLimitHeaders? headers = rateLimitHeaders; + if headers is RateLimitHeaders { + return {status: "non-nil", value: headers.x\-rate\-limit\-id}; + } else { + return {status: "nil"}; + } + } + + resource function get rateLimitHeadersReadOnly(@http:Header readonly & RateLimitHeaders rateLimitHeaders) returns json { + RateLimitHeaders headers = rateLimitHeaders; + if headers is readonly & RateLimitHeaders { + return {status: "readonly", value: headers.x\-rate\-limit\-id}; + } else { + return {status: "non-readonly", value: headers.x\-rate\-limit\-id}; + } + } + + resource function get ofPureTypeHeaders(@http:Header PureTypeHeaders headers) returns json { + return { + header1: headers.sid, + header2: headers.iid, + header3: headers.fid, + header4: headers.did, + header5: headers.bid, + header6: headers.said, + header7: headers.iaid, + header8: headers.faid, + header9: headers.daid, + header10: headers.baid + }; + } + + resource function get ofNilableTypeHeaders(@http:Header NilableTypeHeaders headers) returns json { + return { + header1: headers.sid, + header2: headers.iid, + header3: headers.fid, + header4: headers.did, + header5: headers.bid, + header6: headers.said, + header7: headers.iaid, + header8: headers.faid, + header9: headers.daid, + header10: headers.baid + }; + } + + resource function get ofReadonlyHeaders(@http:Header ReadonlyTypeHeaders rateLimitHeaders) returns json { + string[] stringId = rateLimitHeaders.sid; + json j1; + if stringId is readonly & string[] { + j1 = {status: "readonly", value: stringId}; + } else { + j1 = {status: "non-readonly", value: stringId}; + } + + int[]? intId = rateLimitHeaders.iid; + json j2; + if intId is readonly & int[]? { + j2 = {status: "readonly", value: intId}; + } else { + j2 = {status: "non-readonly", value: intId}; + } + + string[]? stringArrId = rateLimitHeaders.said; + json j3; + if stringArrId is readonly & string[]? { + j3 = {status: "readonly", value: stringArrId}; + } else { + j3 = {status: "non-readonly", value: stringArrId}; + } + + int[] intArrId = rateLimitHeaders.iaid; + json j4; + if intArrId is readonly & int[] { + j4 = {status: "readonly", value: intArrId}; + } else { + j4 = {status: "non-readonly", value: intArrId}; + } + + return {header1: j1, header2: j2, header3: j3, header4: j4}; + } + + resource function get ofOtherPureHeaders(@http:Header int iid, @http:Header float fid, + @http:Header decimal did, @http:Header boolean bid, @http:Header int[] iaid, @http:Header float[] faid, + @http:Header decimal[] daid, @http:Header boolean[] baid) returns json { + return { + header1: iid, + header2: fid, + header3: did, + header4: bid, + header5: iaid, + header6: faid, + header7: daid, + header8: baid + }; + } + + resource function get ofOtherNilableHeaders(@http:Header int? iid, @http:Header float? fid, + @http:Header decimal? did, @http:Header boolean? bid, @http:Header int[]? iaid, + @http:Header float[]? faid, @http:Header decimal[]? daid, @http:Header boolean[]? baid) returns json { + json j1 = iid is int ? iid : "no header iid"; + json j2 = fid is float ? fid : "no header fid"; + json j3 = did is decimal ? did : "no header did"; + json j4 = bid is boolean ? bid : "no header bid"; + json j5 = iaid is int[] ? iaid : "no header iaid"; + json j6 = faid is float[] ? faid : "no header faid"; + json j7 = daid is decimal[] ? daid : "no header daid"; + json j8 = baid is boolean[] ? baid : "no header baid"; + + return { + header1: j1, + header2: j2, + header3: j3, + header4: j4, + header5: j5, + header6: j6, + header7: j7, + header8: j8 + }; + } + + resource function get ofOtherHeaderTypesWithReadonly(@http:Header readonly & int[] iaid, + @http:Header readonly & float[]? faid, @http:Header readonly & decimal[]? daid, + @http:Header readonly & boolean[] baid) returns json { + int[] intId = iaid; + json j1; + if intId is readonly & int[] { + j1 = {status: "readonly", value: intId}; + } else { + j1 = {status: "non-readonly", value: intId}; + } + boolean[] booleanId = baid; + json j2; + if booleanId is readonly & boolean[] { + j2 = {status: "readonly", value: booleanId}; + } else { + j2 = {status: "non-readonly", value: booleanId}; + } + float[]? floatId = faid; + json j3; + if floatId is readonly & float[] { + j3 = {status: "readonly", value: floatId}; + } else { + j3 = {status: "non-readonly", value: "nil float"}; + } + decimal[]? decimalId = daid; + json j4; + if decimalId is readonly & decimal[] { + j4 = {status: "readonly", value: decimalId}; + } else { + j4 = {status: "non-readonly", value: "nil decimal"}; + } + return {header1: j1, header2: j2, header3: j3, header4: j4}; + } + + resource function post userAgentWithPayload(@http:Payload string payloadVal, + @http:Header {name: "user-agent"} string? userAgent) returns json { + return {"hello": userAgent}; + } + + resource function get userAgentWithRequest(http:Request req, + @http:Header {name: "user-agent"} string? userAgent) returns json { + return {"hello": userAgent}; + } + + resource function get host(@http:Header {name: "host"} string? host) returns json { + return {"hello": host ?: "nil"}; + } + + resource function get hostFromRequest(http:Request req) returns json { + string|error host = req.getHeader("host"); + if host is string { + return {"hello": host}; + } else { + return {"error": host.message()}; + } + } + + resource function get scheme(@http:Header {name: "x-http2-scheme"} string? scheme) returns json { + return {"hello": scheme ?: "nil"}; + } +} + +@test:Config {} +function testHeaderTokenBinding() { + http:Response|error response = headerBindingClient->get("/headerparamservice/?foo=WSO2&bar=56", {"foo": "Ballerina"}); + if response is http:Response { + common:assertJsonPayload(response.getJsonPayload(), {value1: "Ballerina", value2: 56}); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + response = headerBindingClient->get("/headerparamservice?foo=bal&bar=12", {"foo": "WSO2"}); + if response is http:Response { + common:assertJsonPayload(response.getJsonPayload(), {value1: "WSO2", value2: 12}); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +//Header params are not case sensitive +@test:Config {} +function testHeaderBindingCaseInSensitivity() { + http:Response|error response = headerBindingClient->get("/headerparamservice/?baz=WSO2&bar=56", {"FOO": "HTtP"}); + if response is http:Response { + common:assertJsonPayload(response.getJsonPayload(), {value1: "HTtP", value2: 56}); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderUnavailability() returns error? { + http:Response|error response = headerBindingClient->get("/headerparamservice/?foo=WSO2&bar=56"); + if response is http:Response { + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "no header value found for 'foo'", + "Bad Request", 400, "/headerparamservice/?foo=WSO2&bar=56", "GET"); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderArrayUnavailability() returns error? { + http:Request req = new; + req.setTextPayload("All in one"); + http:Response|error response = headerBindingClient->post("/headerparamservice/q1/hello?b=hi", req); + if response is http:Response { + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "no header value found for 'foo'", + "Bad Request", 400, "/headerparamservice/q1/hello?b=hi", "POST"); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testAllParamBinding() { + http:Request req = new; + req.addHeader("foo", "Hello"); + req.addHeader("Foo", "World"); + req.setTextPayload("All in one"); + http:Response|error response = headerBindingClient->post("/headerparamservice/q1/hello?b=hi", req); + if response is http:Response { + json expected = {xType: ["Hello", "World"], path: "hello", payload: "All in one", page: "hi"}; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderBindingArrayAndString() { + http:Response|error response = headerBindingClient->get("/headerparamservice/q2", {"X-Type": ["Hello", "World"]}); + if response is http:Response { + json expected = {firstValue: "Hello", allValue: ["Hello", "World"]}; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testNilableHeaderBinding() { + var headers1 = { + "X-Type": ["Hello", "Hello"], + "bar": ["Write", "Language"], + "Foo": "World", + "baaz": "All", + "baz": "Ballerina" + }; + http:Response|error response = headerBindingClient->get("/headerparamservice/q3", headers1); + if response is http:Response { + json expected = {val1: "World", val2: ["Write", "Language"], val3: "Ballerina"}; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + var headers2 = {"X-Type": ["Hello", "Hello"], "bar": ["Write", "All"], "baz": "Language"}; + response = headerBindingClient->get("/headerparamservice/q3", headers2); + if response is http:Response { + json expected = {val1: "foo header not found", val2: ["Write", "All"], val3: "Language"}; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + var headers3 = {"X-Type": "Hello", "Foo": ["Write", "All"], "baz": "Hello"}; + response = headerBindingClient->get("/headerparamservice/q3", headers3); + if response is http:Response { + json expected = {val1: "Write", val2: ["bar header not found"], val3: "Hello"}; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderObjectBinding() { + var headers = { + "X-Type": ["Hello", "Hello"], + "Foo": "World", + "baz": "Write", + "daz": ["All", "Ballerina"], + "bar": "Language" + }; + http:Response|error response = headerBindingClient->get("/headerparamservice/q4", headers); + if response is http:Response { + json expected = { + val1: "World", + val2: "Write", + val3: true, + val4: ["All", "Ballerina"], + val5: ["bar", "baz", "daz", "foo", "host", "user-agent", "x-http2-scheme", "x-http2-stream-id", "x-type"] + }; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + var headers2 = {"X-Type": ["Hello", "Hello"], "bar": "Language"}; + response = headerBindingClient->get("/headerparamservice/q4", headers2); + if response is http:Response { + json expected = { + val1: "foo header not found", + val2: "Http header does not exist", + val3: false, + val4: ["Http header does not exist"], + val5: ["bar", "host", "user-agent", "x-http2-scheme", "x-http2-stream-id", "x-type"] + }; + common:assertJsonPayloadtoJsonString(response.getJsonPayload(), expected); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderParamTokenWithEscapeChar() { + http:Response|error response = headerBindingClient->get("/headerparamservice/q5", {"x-Type": "test"}); + if response is http:Response { + common:assertTextPayload(response.getTextPayload(), "test"); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderBindingWithNoHeaderValue() { + string|error response = headerBindingClient->get("/headerparamservice/q6", {"foo": ""}); + if response is string { + test:assertEquals(response, "empty", msg = "Found unexpected output"); + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} + +@test:Config {} +function testHeaderRecordParam() returns error? { + json response = check headerBindingClient->get("/headerRecord/rateLimitHeaders", { + "x-rate-limit-id": "dwqfec", + "x-rate-limit-remaining": "23", + "x-rate-limit-types": ["weweq", "fefw"] + }); + common:assertJsonValue(response, "header1", "dwqfec"); + common:assertJsonValue(response, "header2", 23); + common:assertJsonValue(response, "header3", ["weweq", "fefw"]); +} + +@test:Config {} +function testHeaderRecordParamWithCastingError() returns error? { + http:Response response = check headerBindingClient->get("/headerRecord/rateLimitHeaders", { + "x-rate-limit-id": "dwqfec", + "x-rate-limit-remaining": "23xyz", + "x-rate-limit-types": ["weweq", "fefw"] + }); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'x-rate-limit-remaining'", + "Bad Request", 400, "/headerRecord/rateLimitHeaders", "GET"); +} + +@test:Config {} +function testHeaderRecordParamWithPost() returns error? { + http:Request req = new; + req.setHeader("x-rate-limit-id", "dwqfec"); + req.setHeader("x-rate-limit-remaining", "23"); + req.setHeader("x-rate-limit-types", "weweq"); + req.addHeader("x-rate-limit-types", "fefw"); + json response = check headerBindingClient->post("/headerRecord/ofStringOfPost", req); + common:assertJsonValue(response, "header1", "dwqfec"); + common:assertJsonValue(response, "header2", 23); + common:assertJsonValue(response, "header3", ["weweq", "fefw"]); +} + +@test:Config {} +function testHeaderRecordParamOfPureTypeHeaders() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofPureTypeHeaders", + { + "sid": "dwqfec", + "iid": "23", + "fid": "2.892", + "did": "2.8", + "bid": "true", + "said": ["dwqfec", "fnefbw"], + "iaid": ["23", "56"], + "faid": ["2.892", "3.564"], + "daid": ["2.8", "3.4"], + "baid": ["true", "false"] + }); + common:assertJsonValue(response, "header1", "dwqfec"); + common:assertJsonValue(response, "header2", 23); + common:assertJsonValue(response, "header3", 2.892d); + common:assertJsonValue(response, "header4", 2.8d); + common:assertJsonValue(response, "header5", true); + common:assertJsonValue(response, "header6", ["dwqfec", "fnefbw"]); + common:assertJsonValue(response, "header7", [23, 56]); + common:assertJsonValue(response, "header8", [2.892d, 3.564d]); + common:assertJsonValue(response, "header9", [2.8d, 3.4d]); + common:assertJsonValue(response, "header10", [true, false]); +} + +@test:Config {} +function testHeaderRecordParamOfPureTypeHeadersNegative() returns error? { + json|error response = headerBindingClient->get("/headerRecord/ofPureTypeHeaders", + { + "sid": "dwqfec", + "iid": "23", + "fid": "2.892" + }); + if response is http:ClientRequestError { + test:assertEquals(response.detail().statusCode, 400, msg = "Found unexpected output"); + common:assertErrorHeaderValue(response.detail().headers[common:CONTENT_TYPE], common:APPLICATION_JSON); + check common:assertJsonErrorPayload(response.detail().body, "no header value found for 'did'", + "Bad Request", 400, "/headerRecord/ofPureTypeHeaders", "GET"); + } else { + test:assertFail(msg = "Found unexpected output type"); + } +} + +@test:Config {} +function testHeaderRecordParamOfNilableTypeHeaders() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofNilableTypeHeaders", + { + "sid": "dwqfec", + "did": "2.8", + "fid": "2.892", + "bid": "true", + "iid": "23", + "said": ["dwqfec", "fnefbw"], + "iaid": ["23", "56"], + "faid": ["2.892", "3.564"], + "daid": ["2.8", "3.4"], + "baid": ["true", "false"] + }); + common:assertJsonValue(response, "header1", "dwqfec"); + common:assertJsonValue(response, "header2", 23); + common:assertJsonValue(response, "header3", 2.892d); + common:assertJsonValue(response, "header4", 2.8d); + common:assertJsonValue(response, "header5", true); + common:assertJsonValue(response, "header6", ["dwqfec", "fnefbw"]); + common:assertJsonValue(response, "header7", [23, 56]); + common:assertJsonValue(response, "header8", [2.892d, 3.564d]); + common:assertJsonValue(response, "header9", [2.8d, 3.4d]); + common:assertJsonValue(response, "header10", [true, false]); +} + +@test:Config {} +function testHeaderRecordParamOfNilableTypeHeadersWithMissingFields() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofNilableTypeHeaders", + { + "sid": "dwqfec", + "fid": "2.892", + "bid": "true", + "iaid": ["23", "56"], + "faid": ["2.892", "3.564"], + "daid": ["2.8", "3.4"] + }); + common:assertJsonValue(response, "header1", "dwqfec"); + common:assertJsonValue(response, "header2", null); + common:assertJsonValue(response, "header3", 2.892d); + common:assertJsonValue(response, "header4", null); + common:assertJsonValue(response, "header5", true); + common:assertJsonValue(response, "header6", null); + common:assertJsonValue(response, "header7", [23, 56]); + common:assertJsonValue(response, "header8", [2.892d, 3.564d]); + common:assertJsonValue(response, "header9", [2.8d, 3.4d]); + common:assertJsonValue(response, "header10", null); +} + +@test:Config {} +function testReadonlyTypeWithHeaderRecord() returns error? { + json response = check headerBindingClient->get("/headerRecord/rateLimitHeadersReadOnly", + {"x-rate-limit-id": "dwqfec", "x-rate-limit-remaining": "23", "x-rate-limit-types": ["weweq", "fefw"]}); + common:assertJsonValue(response, "status", "readonly"); + common:assertJsonValue(response, "value", "dwqfec"); +} + +@test:Config {} +function testNilableHeaderRecordSuccess() returns error? { + json response = check headerBindingClient->get("/headerRecord/rateLimitHeadersNilableRecord", + {"x-rate-limit-id": "dwqfec", "x-rate-limit-remaining": "23", "x-rate-limit-types": ["weweq", "fefw"]}); + common:assertJsonValue(response, "status", "non-nil"); + common:assertJsonValue(response, "value", "dwqfec"); +} + +@test:Config {} +function testNilableHeaderRecordNegative() returns error? { + json response = check headerBindingClient->get("/headerRecord/rateLimitHeadersNilableRecord", + {"x-rate-limit-types": ["weweq", "fefw"]}); + common:assertJsonValue(response, "status", "nil"); +} + +@test:Config {} +function testReadonlyHeaderRecordParam() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofReadonlyHeaders", + { + "sid": ["dwqfec"], + "iid": ["345"], + "said": ["fewnvw", "ceq"], + "iaid": ["23", "56"] + }); + common:assertJsonValue(response, "header1", {status: "readonly", value: ["dwqfec"]}); + common:assertJsonValue(response, "header2", {status: "readonly", value: [345]}); + common:assertJsonValue(response, "header3", {status: "readonly", value: ["fewnvw", "ceq"]}); + common:assertJsonValue(response, "header4", {status: "readonly", value: [23, 56]}); +} + +@test:Config {} +function testHeaderRecordOfPureTypeHeaders() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofOtherPureHeaders", + { + "sid": "dwqfec", + "did": "2.8", + "fid": "2.892", + "bid": "true", + "iid": "23", + "said": ["dwqfec", "fnefbw"], + "iaid": ["23", "56"], + "faid": ["2.892", "3.564"], + "daid": ["2.8", "3.4"], + "baid": ["true", "false"] + }); + common:assertJsonValue(response, "header1", 23); + common:assertJsonValue(response, "header2", 2.892d); + common:assertJsonValue(response, "header3", 2.8d); + common:assertJsonValue(response, "header4", true); + common:assertJsonValue(response, "header5", [23, 56]); + common:assertJsonValue(response, "header6", [2.892d, 3.564d]); + common:assertJsonValue(response, "header7", [2.8d, 3.4d]); + common:assertJsonValue(response, "header8", [true, false]); +} + +@test:Config {} +function testHeaderRecordOfPureTypeHeadersNegative() returns error? { + json|error response = headerBindingClient->get("/headerRecord/ofOtherPureHeaders", + { + "sid": "dwqfec", + "fid": "2.892", + "iid": "23", + "iaid": ["23", "56"], + "daid": ["2.8", "3.4"] + }); + if response is http:ClientRequestError { + test:assertEquals(response.detail().statusCode, 400, msg = "Found unexpected output"); + common:assertErrorHeaderValue(response.detail().headers[common:CONTENT_TYPE], common:APPLICATION_JSON); + check common:assertJsonErrorPayload(response.detail().body, "no header value found for 'did'", + "Bad Request", 400, "/headerRecord/ofOtherPureHeaders", "GET"); + } else { + test:assertFail(msg = "Found unexpected output type"); + } +} + +@test:Config {} +function testHeaderParamOfNilableTypeHeaders() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + { + "sid": "dwqfec", + "fid": "2.892", + "iid": "23", + "iaid": ["23", "56"], + "daid": ["2.8", "3.4"], + "baid": ["true", "false"] + }); + common:assertJsonValue(response, "header1", 23); + common:assertJsonValue(response, "header2", 2.892d); + common:assertJsonValue(response, "header3", "no header did"); + common:assertJsonValue(response, "header4", "no header bid"); + common:assertJsonValue(response, "header5", [23, 56]); + common:assertJsonValue(response, "header6", "no header faid"); + common:assertJsonValue(response, "header7", [2.8d, 3.4d]); + common:assertJsonValue(response, "header8", [true, false]); +} + +@test:Config {} +function testReadonlyHeaderParams() returns error? { + json response = check headerBindingClient->get("/headerRecord/ofOtherHeaderTypesWithReadonly", + { + "said": ["dwqfec", "fnefbw"], + "iaid": ["23", "56"], + "daid": ["2.8", "3.4"], + "baid": ["true", "false"] + }); + common:assertJsonValue(response, "header1", {status: "readonly", value: [23, 56]}); + common:assertJsonValue(response, "header2", {status: "readonly", value: [true, false]}); + common:assertJsonValue(response, "header3", {status: "non-readonly", value: "nil float"}); + common:assertJsonValue(response, "header4", {status: "readonly", value: [2.8d, 3.4d]}); +} + +@test:Config {} +function testHeaderParamsCastingError() returns error? { + http:Response response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"iid": "hello"}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'iid'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); + + response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"fid": "hello"}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'fid'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); + + response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"did": "hello"}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'did'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); + + response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"iaid": ["3", "5", "8", "hello"]}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'iaid'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); + + response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"faid": ["3.445", "hello", "5.667", "8.206"]}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'faid'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); + + response = check headerBindingClient->get("/headerRecord/ofOtherNilableHeaders", + {"daid": ["3.4", "5.6", "hello", "8"]}); + test:assertEquals(response.statusCode, 400); + check common:assertJsonErrorPayload(check response.getJsonPayload(), "header binding failed for parameter: 'daid'", + "Bad Request", 400, "/headerRecord/ofOtherNilableHeaders", "GET"); +} + +@test:Config {} +function userAgentHeaderBindingTest() returns error? { + json response = check headerBindingClient->post("/headerRecord/userAgentWithPayload", "world", + {"user-agent": "slbeta3"}); + common:assertJsonValue(response, "hello", "slbeta3"); + + response = check headerBindingClient->get("/headerRecord/userAgentWithRequest", {"user-agent": "slbeta4"}); + common:assertJsonValue(response, "hello", "slbeta4"); +} + +@test:Config {} +function hostHeaderBindingTest() returns error? { + http:Client clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), httpVersion = http:HTTP_1_1); + json response = check clientEP->/headerRecord/host; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString()); + response = check clientEP->/headerRecord/host; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + response = check clientEP->/headerRecord/host; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), http2Settings = {http2PriorKnowledge: true}); + response = check clientEP->/headerRecord/host; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); +} + +@test:Config {} +function hostHeaderFromRequestTest() returns error? { + http:Client clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), httpVersion = http:HTTP_1_1); + json response = check clientEP->/headerRecord/hostFromRequest; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString()); + response = check clientEP->/headerRecord/hostFromRequest; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + response = check clientEP->/headerRecord/hostFromRequest; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), http2Settings = {http2PriorKnowledge: true}); + response = check clientEP->/headerRecord/hostFromRequest; + common:assertJsonValue(response, "hello", "localhost:" + headerParamBindingTestPort.toString()); +} + +@test:Config {} +function schemeHeaderBindingTest() returns error? { + http:Client clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), httpVersion = http:HTTP_1_1); + json response = check clientEP->/headerRecord/scheme; + common:assertJsonValue(response, "hello", "nil"); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString()); + response = check clientEP->/headerRecord/scheme; + common:assertJsonValue(response, "hello", "http"); + + response = check clientEP->/headerRecord/scheme; + common:assertJsonValue(response, "hello", "http"); + + clientEP = check new("localhost:" + headerParamBindingTestPort.toString(), http2Settings = {http2PriorKnowledge: true}); + response = check clientEP->/headerRecord/scheme; + common:assertJsonValue(response, "hello", "http"); +} diff --git a/ballerina-tests/http2-tests/tests/test_service_ports.bal b/ballerina-tests/http2-tests/tests/test_service_ports.bal index 48b90073ea..9b23c48932 100644 --- a/ballerina-tests/http2-tests/tests/test_service_ports.bal +++ b/ballerina-tests/http2-tests/tests/test_service_ports.bal @@ -62,3 +62,4 @@ const int dirtyResponseTestPort = 9546; const int reuseRequestTestPort = 9528; const int connectionNativeTestPort = 9014; const int http2ClientContinueTestPort = 9630; +const int headerParamBindingTestPort = 9631; From 0bfd1cfde2e42b3afe0faaa6ab59990a07834da8 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 27 Sep 2023 08:21:47 +0530 Subject: [PATCH 3/5] Update changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index d44f0b8420..4c5f6aa6a1 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,12 @@ This file contains all the notable changes done to the Ballerina HTTP package th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- [Expose HTTP/2 pseudo headers as request headers](https://github.com/ballerina-platform/ballerina-standard-library/issues/4732) + ## [2.9.2] - 2023-08-10 ### Fixed From 233ccf09db9869db62028aa8126e2b557af80a97 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 27 Sep 2023 08:35:51 +0530 Subject: [PATCH 4/5] [Automated] Update the native jar versions --- ballerina-tests/http-advanced-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-advanced-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-client-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-client-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-misc-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-misc-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-security-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-security-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-service-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-service-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-test-common/Ballerina.toml | 2 +- ballerina-tests/http-test-common/Dependencies.toml | 2 +- ballerina-tests/http2-tests/Ballerina.toml | 6 +++--- ballerina-tests/http2-tests/Dependencies.toml | 6 +++--- 20 files changed, 56 insertions(+), 56 deletions(-) diff --git a/ballerina-tests/http-advanced-tests/Ballerina.toml b/ballerina-tests/http-advanced-tests/Ballerina.toml index 57a1af1f3f..7f1324ed29 100644 --- a/ballerina-tests/http-advanced-tests/Ballerina.toml +++ b/ballerina-tests/http-advanced-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_advanced_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-advanced-tests/Dependencies.toml b/ballerina-tests/http-advanced-tests/Dependencies.toml index b2f6524f89..4f61cfe022 100644 --- a/ballerina-tests/http-advanced-tests/Dependencies.toml +++ b/ballerina-tests/http-advanced-tests/Dependencies.toml @@ -72,7 +72,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -105,7 +105,7 @@ modules = [ [[package]] org = "ballerina" name = "http_advanced_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "file"}, @@ -125,7 +125,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-client-tests/Ballerina.toml b/ballerina-tests/http-client-tests/Ballerina.toml index 90969bf5fd..964ffa836b 100644 --- a/ballerina-tests/http-client-tests/Ballerina.toml +++ b/ballerina-tests/http-client-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_client_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-client-tests/Dependencies.toml b/ballerina-tests/http-client-tests/Dependencies.toml index 76603e631d..f92e6e5b75 100644 --- a/ballerina-tests/http-client-tests/Dependencies.toml +++ b/ballerina-tests/http-client-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_client_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-dispatching-tests/Ballerina.toml b/ballerina-tests/http-dispatching-tests/Ballerina.toml index bf47063437..896676e755 100644 --- a/ballerina-tests/http-dispatching-tests/Ballerina.toml +++ b/ballerina-tests/http-dispatching-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_dispatching_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-dispatching-tests/Dependencies.toml b/ballerina-tests/http-dispatching-tests/Dependencies.toml index 65149e9df4..80f445f8d4 100644 --- a/ballerina-tests/http-dispatching-tests/Dependencies.toml +++ b/ballerina-tests/http-dispatching-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_dispatching_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -124,7 +124,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-interceptor-tests/Ballerina.toml b/ballerina-tests/http-interceptor-tests/Ballerina.toml index f8d14b19eb..253b1b9e75 100644 --- a/ballerina-tests/http-interceptor-tests/Ballerina.toml +++ b/ballerina-tests/http-interceptor-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_interceptor_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-interceptor-tests/Dependencies.toml b/ballerina-tests/http-interceptor-tests/Dependencies.toml index 5ea506f318..3e9e0310d8 100644 --- a/ballerina-tests/http-interceptor-tests/Dependencies.toml +++ b/ballerina-tests/http-interceptor-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_interceptor_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -115,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-misc-tests/Ballerina.toml b/ballerina-tests/http-misc-tests/Ballerina.toml index 8a126e960c..dc19ad36b9 100644 --- a/ballerina-tests/http-misc-tests/Ballerina.toml +++ b/ballerina-tests/http-misc-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_misc_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-misc-tests/Dependencies.toml b/ballerina-tests/http-misc-tests/Dependencies.toml index d179c7f73f..90dc8e9622 100644 --- a/ballerina-tests/http-misc-tests/Dependencies.toml +++ b/ballerina-tests/http-misc-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_misc_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -118,7 +118,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-resiliency-tests/Ballerina.toml b/ballerina-tests/http-resiliency-tests/Ballerina.toml index 1830863379..ff6a27b7a9 100644 --- a/ballerina-tests/http-resiliency-tests/Ballerina.toml +++ b/ballerina-tests/http-resiliency-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_resiliency_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-resiliency-tests/Dependencies.toml b/ballerina-tests/http-resiliency-tests/Dependencies.toml index 0aab6aec9a..c650f16263 100644 --- a/ballerina-tests/http-resiliency-tests/Dependencies.toml +++ b/ballerina-tests/http-resiliency-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_resiliency_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -116,7 +116,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-security-tests/Ballerina.toml b/ballerina-tests/http-security-tests/Ballerina.toml index f00ae61169..4470b01501 100644 --- a/ballerina-tests/http-security-tests/Ballerina.toml +++ b/ballerina-tests/http-security-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_security_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-security-tests/Dependencies.toml b/ballerina-tests/http-security-tests/Dependencies.toml index f06bdab1fd..d0f9105bc1 100644 --- a/ballerina-tests/http-security-tests/Dependencies.toml +++ b/ballerina-tests/http-security-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_security_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "http"}, @@ -120,7 +120,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-service-tests/Ballerina.toml b/ballerina-tests/http-service-tests/Ballerina.toml index e8fe6bf394..3c91515e6f 100644 --- a/ballerina-tests/http-service-tests/Ballerina.toml +++ b/ballerina-tests/http-service-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_service_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http-service-tests/Dependencies.toml b/ballerina-tests/http-service-tests/Dependencies.toml index 145332254e..6999c125ad 100644 --- a/ballerina-tests/http-service-tests/Dependencies.toml +++ b/ballerina-tests/http-service-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_service_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-test-common/Ballerina.toml b/ballerina-tests/http-test-common/Ballerina.toml index cb7d40d3d0..143f6d7ab9 100644 --- a/ballerina-tests/http-test-common/Ballerina.toml +++ b/ballerina-tests/http-test-common/Ballerina.toml @@ -1,4 +1,4 @@ [package] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" diff --git a/ballerina-tests/http-test-common/Dependencies.toml b/ballerina-tests/http-test-common/Dependencies.toml index 9e265c2596..0c3f9b7dfb 100644 --- a/ballerina-tests/http-test-common/Dependencies.toml +++ b/ballerina-tests/http-test-common/Dependencies.toml @@ -10,7 +10,7 @@ distribution-version = "2201.7.0" [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "mime"}, diff --git a/ballerina-tests/http2-tests/Ballerina.toml b/ballerina-tests/http2-tests/Ballerina.toml index 8e4b4e8646..f4c0e69d95 100644 --- a/ballerina-tests/http2-tests/Ballerina.toml +++ b/ballerina-tests/http2-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http2_tests" -version = "2.9.3" +version = "2.9.4" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.3" +version = "2.9.4" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.3.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.4-SNAPSHOT.jar" diff --git a/ballerina-tests/http2-tests/Dependencies.toml b/ballerina-tests/http2-tests/Dependencies.toml index c0f292c5dc..c43cedf7ab 100644 --- a/ballerina-tests/http2-tests/Dependencies.toml +++ b/ballerina-tests/http2-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http2_tests" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.3" +version = "2.9.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, From 1fb53eb4a1efd0333e07960d85bb346bd1037614 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 27 Sep 2023 08:35:51 +0530 Subject: [PATCH 5/5] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 46ee651397..d4e4af8921 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" authors = ["Ballerina"] keywords = ["http", "network", "service", "listener", "client"] repository = "https://github.com/ballerina-platform/module-ballerina-http" @@ -16,8 +16,8 @@ graalvmCompatible = true [[platform.java11.dependency]] groupId = "io.ballerina.stdlib" artifactId = "http-native" -version = "2.9.3" -path = "../native/build/libs/http-native-2.9.3.jar" +version = "2.9.4" +path = "../native/build/libs/http-native-2.9.4-SNAPSHOT.jar" [[platform.java11.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 13e8b01bda..e829778485 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "http-compiler-plugin" class = "io.ballerina.stdlib.http.compiler.HttpCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/http-compiler-plugin-2.9.3.jar" +path = "../compiler-plugin/build/libs/http-compiler-plugin-2.9.4-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 51629790ca..66d982c33c 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -50,7 +50,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.4.0" +version = "2.4.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ modules = [ [[package]] org = "ballerina" name = "file" -version = "1.8.0" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -76,7 +76,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.9.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -240,7 +240,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.8.0" +version = "2.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"},