Skip to content

Commit

Permalink
Merge pull request #1681 from ballerina-platform/2201.6.x-netty-fix
Browse files Browse the repository at this point in the history
[2201.6.x] Update vulnerable netty version
  • Loading branch information
TharmiganK committed Jun 26, 2023
2 parents db78b25 + a4116f5 commit 7df8b5a
Show file tree
Hide file tree
Showing 40 changed files with 425 additions and 131 deletions.
6 changes: 3 additions & 3 deletions ballerina-tests/http-advanced-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_advanced_tests"
version = "2.8.0"
version = "2.8.1"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.8.0"
version = "2.8.1"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.8.0.jar"
path = "../../test-utils/build/libs/http-test-utils-2.8.1-SNAPSHOT.jar"
12 changes: 6 additions & 6 deletions ballerina-tests/http-advanced-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -104,7 +104,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_advanced_tests"
version = "2.8.0"
version = "2.8.1"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "file"},
Expand All @@ -124,7 +124,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down Expand Up @@ -311,7 +311,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.6.0"
version = "1.6.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -321,7 +321,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "task"
version = "2.3.2"
version = "2.3.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -343,7 +343,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.2.4"
version = "2.2.5"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-client-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_client_tests"
version = "2.8.0"
version = "2.8.1"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.8.0"
version = "2.8.1"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.8.0.jar"
path = "../../test-utils/build/libs/http-test-utils-2.8.1-SNAPSHOT.jar"
12 changes: 6 additions & 6 deletions ballerina-tests/http-client-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -101,7 +101,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_client_tests"
version = "2.8.0"
version = "2.8.1"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "http"},
Expand All @@ -120,7 +120,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down Expand Up @@ -307,7 +307,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.6.0"
version = "1.6.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -317,7 +317,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "task"
version = "2.3.2"
version = "2.3.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -339,7 +339,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.2.4"
version = "2.2.5"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-dispatching-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_dispatching_tests"
version = "2.8.0"
version = "2.8.1"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.8.0"
version = "2.8.1"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.8.0.jar"
path = "../../test-utils/build/libs/http-test-utils-2.8.1-SNAPSHOT.jar"
12 changes: 6 additions & 6 deletions ballerina-tests/http-dispatching-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -101,7 +101,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_dispatching_tests"
version = "2.8.0"
version = "2.8.1"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "http"},
Expand All @@ -123,7 +123,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down Expand Up @@ -346,7 +346,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.6.0"
version = "1.6.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -356,7 +356,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "task"
version = "2.3.2"
version = "2.3.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -378,7 +378,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.2.4"
version = "2.2.5"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,66 @@ function testHeaderParamBindingCase9() returns error? {
http:Response res = check resourceHeaderParamBindingClient->/header/case9(headers);
test:assertEquals(res.statusCode, 400);
}

@test:Config {}
function testHeaderParamBindingCase10() returns error? {
int:Signed32 resPayload = check resourceHeaderParamBindingClient->/header/case10({header: "32"});
test:assertEquals(resPayload, 32);

resPayload = check resourceHeaderParamBindingClient->/header/case10({header: "-32"});
test:assertEquals(resPayload, -32);

http:Response res = check resourceHeaderParamBindingClient->/header/case10({header: "5000000000"});
test:assertEquals(res.statusCode, 400);
}

@test:Config {}
function testHeaderParamBindingCase11() returns error? {
int:Unsigned32 resPayload = check resourceHeaderParamBindingClient->/header/case11({header: "32"});
test:assertEquals(resPayload, 32);

http:Response res = check resourceHeaderParamBindingClient->/header/case11({header: "-32"});
test:assertEquals(res.statusCode, 400);

res = check resourceHeaderParamBindingClient->/header/case11({header: "5000000000"});
test:assertEquals(res.statusCode, 400);
}

@test:Config {}
function testHeaderParamBindingCase12() returns error? {
int:Signed8[] resPayload = check resourceHeaderParamBindingClient->/header/case12({header: ["32", "-38", "1", "-43"]});
test:assertEquals(resPayload, [32, -38, 1, -43]);

http:Response res = check resourceHeaderParamBindingClient->/header/case12({header: ["32", "-38", "1", "-43", "-50000000"]});
test:assertEquals(res.statusCode, 400);
}

@test:Config {}
function testHeaderParamBindingCase13() returns error? {
string:Char resPayload = check resourceHeaderParamBindingClient->/header/case13({header: "a"});
test:assertEquals(resPayload, "a");

resPayload = check resourceHeaderParamBindingClient->/header/case13({header: "*"});
test:assertEquals(resPayload, "*");

http:Response res = check resourceHeaderParamBindingClient->/header/case13({header: "ab"});
test:assertEquals(res.statusCode, 400);
}

@test:Config {}
function testHeaderParamBindingCase14() returns error? {
[StringCharacter, SmallInt] resPayload = check resourceHeaderParamBindingClient->/header/case14({header1: "a", header2: "32"});
test:assertEquals(resPayload, ["a", 32]);

resPayload = check resourceHeaderParamBindingClient->/header/case14({header1: "*", header2: "-32"});
test:assertEquals(resPayload, ["*", -32]);

http:Response res = check resourceHeaderParamBindingClient->/header/case14({header1: "ab", header2: "32"});
test:assertEquals(res.statusCode, 400);

res = check resourceHeaderParamBindingClient->/header/case14({header1: "a", header2: "5000000000"});
test:assertEquals(res.statusCode, 400);

res = check resourceHeaderParamBindingClient->/header/case14({header1: "ab", header2: "5000000000"});
test:assertEquals(res.statusCode, 400);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import ballerina/test;
import ballerina/http;
import ballerina/http_test_common as common;
import ballerina/url;

final http:Client resourcePathParamBindingClient = check new("http://localhost:" + resourceParamBindingTestPort.toString());

Expand Down Expand Up @@ -145,3 +146,69 @@ function testPathParamBindingCase10() returns error? {
http:Response res = check resourcePathParamBindingClient->/path/case10/value1/value9/value3;
test:assertEquals(res.statusCode, 404, "Status code mismatched");
}

@test:Config {}
function testPathParamBindingCase11() returns error? {
int:Signed32 resPayload = check resourcePathParamBindingClient->/path/case11/'32;
test:assertEquals(resPayload, 32, "Payload mismatched");

resPayload = check resourcePathParamBindingClient->/path/case11/\-32;
test:assertEquals(resPayload, -32, "Payload mismatched");

http:Response res = check resourcePathParamBindingClient->/path/case11/'5000000000;
test:assertEquals(res.statusCode, 400, "Status code mismatched");
}

@test:Config {}
function testPathParamBindingCase12() returns error? {
int:Unsigned32 resPayload = check resourcePathParamBindingClient->/path/case12/'32;
test:assertEquals(resPayload, 32, "Payload mismatched");

http:Response res = check resourcePathParamBindingClient->/path/case12/\-32;
test:assertEquals(res.statusCode, 400, "Status code mismatched");

res = check resourcePathParamBindingClient->/path/case12/'5000000000;
test:assertEquals(res.statusCode, 400, "Status code mismatched");
}

@test:Config {}
function testPathParamBindingCase13() returns error? {
int:Signed8[] resPayload = check resourcePathParamBindingClient->/path/case13/'32/\-38/'1/\-43;
test:assertEquals(resPayload, [32, -38, 1, -43], "Payload mismatched");

http:Response res = check resourcePathParamBindingClient->/path/case13/'32/\-38/'1/\-43/'5000000000;
test:assertEquals(res.statusCode, 400, "Status code mismatched");
}

@test:Config {}
function testPathParamBindingCase14() returns error? {
string:Char resPayload = check resourcePathParamBindingClient->/path/case14/a;
test:assertEquals(resPayload, "a", "Payload mismatched");

resPayload = check resourcePathParamBindingClient->/path/case14/[check url:encode("*", "UTF-8")];
test:assertEquals(resPayload, "*", "Payload mismatched");

resPayload = check resourcePathParamBindingClient->/path/case14/[check url:encode(" ", "UTF-8")];
test:assertEquals(resPayload, " ", "Payload mismatched");

http:Response res = check resourcePathParamBindingClient->/path/case14/abc;
test:assertEquals(res.statusCode, 400, "Status code mismatched");
}

@test:Config {}
function testPathParamBindingCase15() returns error? {
[StringCharacter, SmallInt] resPayload = check resourcePathParamBindingClient->/path/case15/[check url:encode("*", "UTF-8")]/'34;
test:assertEquals(resPayload, ["*", 34], "Payload mismatched");

resPayload = check resourcePathParamBindingClient->/path/case15/[check url:encode(" ", "UTF-8")]/\-34;
test:assertEquals(resPayload, [" ", -34], "Payload mismatched");

http:Response res = check resourcePathParamBindingClient->/path/case15/a/'5000000;
test:assertEquals(res.statusCode, 400, "Status code mismatched");

res = check resourcePathParamBindingClient->/path/case15/ab/'32;
test:assertEquals(res.statusCode, 400, "Status code mismatched");

res = check resourcePathParamBindingClient->/path/case15/abc/'5000000;
test:assertEquals(res.statusCode, 400, "Status code mismatched");
}
Loading

0 comments on commit 7df8b5a

Please sign in to comment.