You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (trustAllPackages() || PRIMITIVES.contains(className)) {
133
155
return;
134
156
}
135
157
136
-
booleanfound = false;
137
-
PackagethePackage = clazz.getPackage();
138
-
if (thePackage != null) {
139
-
for (StringtrustedPackage : getTrustedPackages()) {
140
-
if (thePackage.getName().equals(trustedPackage) || thePackage.getName().startsWith(trustedPackage + ".")) {
141
-
found = true;
142
-
break;
143
-
}
158
+
for (StringtrustedClass : getTrustedClasses()) {
159
+
if (className.equals(trustedClass)) {
160
+
return;
144
161
}
145
162
}
146
-
if (!found) {
147
-
thrownewSecurityException("Forbidden " + clazz
148
-
+ "! This class is not trusted to be included in Avro schema using java-class. Please set org.apache.avro.SERIALIZABLE_PACKAGES system property with the packages you trust.");
163
+
164
+
for (StringtrustedPackage : getTrustedPackages()) {
+ "! This class is not trusted to be included in Avro schema using java-class. Please set org.apache.avro.SERIALIZABLE_CLASSES system property with the class you trust or org.apache.avro.SERIALIZABLE_PACKAGES system property with the packages you trust.");
0 commit comments