Skip to content

Commit 8199113

Browse files
authored
Updated vulnerable dependencies (#243)
* Updated vulnerable dependencies * Bump Gradle version
1 parent d7801ac commit 8199113

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id 'jacoco'
66
id 'signing'
77
id 'maven-publish'
8-
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
8+
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
99
id "com.github.hierynomus.license" version "0.16.1"
1010
}
1111

@@ -24,13 +24,17 @@ repositories {
2424
dependencies {
2525
testImplementation 'junit:junit:4.13.2'
2626
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0'
27+
testImplementation 'commons-fileupload:commons-fileupload:1.5'
28+
testImplementation 'net.minidev:json-smart:2.4.11'
29+
testImplementation 'com.google.guava:guava:32.0.1-jre'
30+
2731
implementation 'commons-lang:commons-lang:2.6'
28-
implementation 'commons-validator:commons-validator:1.7'
32+
implementation 'commons-codec:commons-codec:1.16.0'
33+
implementation 'io.netty:netty-codec-http:4.1.94.Final'
34+
implementation 'io.netty:netty-handler:4.1.94.Final'
2935
implementation 'org.asynchttpclient:async-http-client:2.12.3'
3036
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
31-
implementation 'commons-codec:commons-codec:1.15'
3237
implementation 'org.bitbucket.b_c:jose4j:0.9.3'
33-
implementation 'io.netty:netty-handler:4.1.93.Final'
3438
}
3539

3640
task sourcesJar(type: Jar) {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Mon Apr 05 14:22:26 EDT 2021
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists

src/main/java/com/opentok/SessionProperties.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
package com.opentok;
99

1010
import com.opentok.exception.InvalidArgumentException;
11-
import org.apache.commons.validator.routines.InetAddressValidator;
1211

12+
import java.net.Inet4Address;
13+
import java.net.InetAddress;
14+
import java.net.UnknownHostException;
1315
import java.util.*;
1416

1517

@@ -52,12 +54,20 @@ public static class Builder {
5254
* situate the session in its global network. If you do not set a location hint,
5355
* the OpenTok servers will be based on the first client connecting to the session.
5456
*
55-
* @param location The IP address to serve as the locaion hint.
57+
* @param location The IP address to serve as the location hint.
5658
*
5759
* @return The SessionProperties.Builder object with the location hint setting.
5860
*/
5961
public Builder location(String location) throws InvalidArgumentException {
60-
if (!InetAddressValidator.getInstance().isValidInet4Address(location)) {
62+
boolean valid;
63+
try {
64+
InetAddress ip = InetAddress.getByName(location);
65+
valid = ip instanceof Inet4Address && ip.getHostAddress().equals(location);
66+
}
67+
catch (UnknownHostException ex) {
68+
valid = false;
69+
}
70+
if (!valid) {
6171
throw new InvalidArgumentException("Location must be a valid IPv4 address. location = " + location);
6272
}
6373
this.location = location;

0 commit comments

Comments
 (0)