Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Issue-281: Updates dependencies version to fix CVE-2023-2976 #282

Merged
merged 11 commits into from
Sep 27, 2023
Merged
10 changes: 1 addition & 9 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
<module name="AvoidNestedBlocks"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocStyle">
<property name="scope" value="protected"/>
<property name="checkFirstSentence" value="true"/>
<property name="checkEmptyJavadoc" value="true"/>
<property name="checkHtml" value="true"/>
Expand All @@ -124,16 +123,9 @@
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="validateThrows" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingThrowsTags" value="false"/>
<property name="validateThrows" value="false"/>
<property name="allowMissingParamTags" value="false"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingJavadoc" value="true"/> <!--TODO: this should be enabled at one point. -->
<property name="ignoreMethodNamesRegex" value="^get.*$"/> <!--It would be nice if we could allow checking that the doc exists without also verifying the @returns is there also, but checkstyle does not allow that. -->
<property name="ignoreMethodNamesRegex" value="^has.*$"/> <!-- accessor for boolean e.g. hasVersion -->
<property name="suppressLoadErrors" value="false"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these javaDocsMethod checkstyle properties removed?

Copy link
Contributor Author

@a6dulaleem a6dulaleem Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all are deprecated in new checkStyle version

</module>
</module>
</module>
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dockerExecutable=/usr/bin/docker
#3rd party Versions
apacheCommonsCsvVersion=1.5
apacheCommonsCompressVersion=1.21
checkstyleToolVersion=8.23
checkstyleToolVersion=10.12.3
commonsBeanutilsVersion=1.9.4
commonsioVersion=2.11.0
commonsLang3Version=3.7
Expand All @@ -24,7 +24,7 @@ spotbugsPluginVersion=4.4.4
gradleDockerPlugin=3.1.0
gradleLombokPluginVersion=4.0.0
gradleSshPluginVersion=2.9.0
guavaVersion=30.1-jre
guavaVersion=32.0.1-jre
javaxServletApiVersion=4.0.0
jacksonVersion=2.14.1
everitVersion=1.12.1
Expand All @@ -39,10 +39,10 @@ nettyBoringSSLVersion=2.0.54.Final
jacocoVersion=0.8.5
protobufGradlePlugin=0.8.15
protobufProtocVersion=3.21.7
protobufUtilVersion=3.19.4
protobufUtilVersion=3.24.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there is a PR on Pravega too for similar issue. Can we check the versions and try to keep them in sync just in order to avoid backward-forward incompatibility issue at a later stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protobufUtilVersion is not being used in pravega.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protobufGradlePlugin=0.8.15
protobufProtocVersion=3.21.7

already syncing

qosLogbackVersion=1.2.10
shadowGradlePlugin=4.0.2
swaggerJersey2JaxrsVersion=1.6.2
swaggerJersey2JaxrsVersion=1.6.11
slf4jApiVersion=1.7.25
gradleGitPluginVersion=4.1.1
avroVersion=1.11.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private JSONSchema(SchemaInfo schemaInfo, String schemaString, Class<T> derived)
*
* @param tClass Class whose object's schema is used.
* @param <T> Type of the Java class.
* @return {@link JSONSchema} with generic type T that extracts and captures the json schema.
* @return {@link JSONSchema} with generic type T that extracts and captures the json schema.
Copy link
Contributor Author

@a6dulaleem a6dulaleem Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Ignore these spaces are automatically removed by IntelliJ.

*/
public static <T> JSONSchema<T> of(Class<T> tClass) {
Preconditions.checkNotNull(tClass);
Expand All @@ -96,7 +96,7 @@ public static <T> JSONSchema<T> of(Class<T> tClass) {
* @param schema Schema to use.
* @param tClass class for the type of object
* @param <T> Type of object
* @return Returns an JSONSchema with {@link Object} type.
* @return Returns an JSONSchema with {@link Object} type.
*/
public static <T> JSONSchema<T> of(String type, JsonSchema schema, Class<T> tClass) {
Preconditions.checkNotNull(type);
Expand Down Expand Up @@ -132,7 +132,7 @@ public static <T> JSONSchema<T> of(String type, String schemaString, Class<T> tC
*
* @param tBase Base class whose type is used in the JSON schema object.
* @param tDerived Class whose schema should be used.
* @param <T> Type of base class.
* @param <T> Type of base class.
* @return Returns an JsonSchema of type T.
*/
public static <T> JSONSchema<T> ofBaseType(Class<? extends T> tDerived, Class<T> tBase) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public org.everit.json.schema.Schema getJsonSchema() {
/**
* Applies the transform on the deserialized object.
*
* @return Transformed object of type T.
* @return Transformed object of type T.
*/
public T getTransformed() {
if (schema == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static StoreExceptions create(final Type type, final String errorMessage)
* @return Instance of type of StoreException.
*/
public static StoreExceptions create(final Type type, final Throwable cause, final String errorMessage) {
Preconditions.checkArgument(cause != null || (errorMessage != null && !errorMessage.isEmpty()),
Preconditions.checkArgument(cause != null || errorMessage != null && !errorMessage.isEmpty(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are changing the Checkstyle version it was claimed by that, it was claiming that redundant Pair of parenthesis

"Either cause or errorMessage should be non-empty");
StoreExceptions exception;
switch (type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ private <T extends Request & WireCommand> CompletableFuture<Reply> sendRequest(R
* @param client RawClient for sending request
* @param qualifiedStreamSegmentName StreamSegmentName
* @param requestType request which reply need to be transformed
* @param type Wire command Type
*/
private void handleReply(Reply reply,
RawClient client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public CompletableFuture<Void> updateEntries(List<Entry<Integer>> updates) {
TableKey key = update.getKey();
Integer version = update.getVersion();
Value<TableValue, Integer> val = table.get(key);
return version == null || (val != null && version.equals(val.getVersion()));
return version == null || val != null && version.equals(val.getVersion());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't get the reason behind this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are changing the Checkstyle version it was claimed by that, it was claiming that redundant Pair of parenthesis

});

if (isValid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.pravega.common.ObjectBuilder;
import io.pravega.common.io.SerializationException;
import io.pravega.common.io.serialization.RevisionDataInput;
import io.pravega.common.io.serialization.RevisionDataOutput;
import io.pravega.common.io.serialization.VersionedSerializer;
Expand All @@ -27,6 +28,7 @@
import lombok.Data;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.val;

import java.io.DataInput;
import java.io.DataOutput;
Expand Down Expand Up @@ -1244,6 +1246,10 @@ private void read00(RevisionDataInput source, SchemaIdValue.SchemaIdValueBuilder
@SneakyThrows(IOException.class)
@SuppressWarnings("unchecked")
static <T extends TableValue> T fromBytes(Class<? extends TableKey> keyClass, byte[] bytes, Class<T> valueClass) {
return (T) SERIALIZERS_BY_KEY_TYPE.get(keyClass).deserialize(bytes);
val versionSerializer = SERIALIZERS_BY_KEY_TYPE.get(keyClass);
if (versionSerializer == null) {
throw new SerializationException(String.format("No serializer found for the class %s", keyClass.toGenericString()));
}
return (T) versionSerializer.deserialize(bytes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import io.pravega.common.ObjectBuilder;
import io.pravega.common.io.SerializationException;
import io.pravega.common.io.serialization.RevisionDataInput;
import io.pravega.common.io.serialization.RevisionDataOutput;
import io.pravega.common.io.serialization.VersionedSerializer;
Expand All @@ -25,6 +26,7 @@
import lombok.Data;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.val;

import java.io.DataInput;
import java.io.DataOutput;
Expand Down Expand Up @@ -421,7 +423,11 @@ private void read00(RevisionDataInput source, SchemaGroupsList.SchemaGroupsListB
@SneakyThrows(IOException.class)
@SuppressWarnings("unchecked")
static <T extends Value> T fromBytes(Class<? extends Key> keyClass, byte[] bytes, Class<T> valueClass) {
return (T) SERIALIZERS_BY_KEY_TYPE.get(keyClass).deserialize(bytes);
val versionSerializer = SERIALIZERS_BY_KEY_TYPE.get(keyClass);
if ( versionSerializer == null ) {
throw new SerializationException(String.format("No serializer found for the class %s", keyClass.toGenericString()));
}
return (T) versionSerializer.deserialize(bytes);
}

public class KeySerializer extends VersionedSerializer.MultiType<Key> {
Expand Down