-
Notifications
You must be signed in to change notification settings - Fork 695
[1.12] GEODE-9758/GEODE-9980: Backport serial filter improvements to 1.12 #7510
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
[1.12] GEODE-9758/GEODE-9980: Backport serial filter improvements to 1.12 #7510
Conversation
…pache#7121) Adds support for customizing source set paths of ClassAnalysisRule. PROBLEM Modules external to Geode must be structured the same as Geode source code in order to use ClassAnalysisRule and the Analyze*Serializables tests. This is necessary to better facilitate pluggability of modules that need to provide sanctioned serializable lists. SOLUTION Add source set path customization to ClassAnalysisRule, introduce a new layer of Analyze*Serializables test base classes that can be directly extended in order to customize source set paths in ClassAnalysisRule. Also includes improvements to some iterating of classes during analysis. (cherry picked from commit 5d1e919)
Move SanctionedSerializables to new package org.apache.geode.internal.serialization.filter. (cherry picked from commit db64b49)
(cherry picked from commit b6fca29)
Extract part of SystemPropertyHelper to geode-common for use in modules that are upstream from geode-core. Define new DEFAULT_PREFIX that maps to GEODE_PREFIX and use that everywhere that GEODE_PREFIX was previously used. * Inline prefix constants in SystemPropertyHelper * Use static imports for system property prefixes. * Split up large tests in SystemPropertyHelperTest. * Fix JAXBService (cherry picked from commit ebf8479)
GEODE-9758: Add internal serial filter API apache#7217 Expand ObjectInputStreamFilterWrapper to be an internal API which supports all of Geode's uses of Java's ObjectInputFilter. Introduce a new system property, geode.enableGlobalSerialFilter, to enable a process-wide filter with all serializable Geode classes on the classpath and the value of serializable-object-filter accept-listed. To enable the process-wide filter with GFSH start commands, add: * --J=-Dgeode.enableGlobalSerialFilter=true Functional Capabilities The internal API lives in geode-serialization and works on OpenJDK based JREs providing a facade for Java's ObjectInputFilter in Java 8 and Java 9 or greater using reflection. The API provides the following capabilities: * creating an ObjectInputFilter * setting an ObjectInputFilter on an ObjectInputStream * getting an ObjectInputFilter from a ObjectInputStream * setting a process-wide ObjectInputFilter * getting a process-wide ObjectInputFilter Design Notes The API defines the following primary interface types: * factory interfaces for creating instances of types within the API * filter interfaces to split out single ops from Java's ObjectInputFilter * configuration interfaces for handling system properties, logging, and config validation The concrete classes in the API receive parameters injected via a constructor for any collaborators that are not specified by the interfaces. This is intentional even when the instance is only used once before de-referencing it. All collaborators that are defined in the interface are passed in as parameters to the implementing method; all others are passed in via the constructor and stored as fields. (cherry picked from commit 7978abf) (cherry picked from commit f974238)
363402f to
09155d2
Compare
onichols-pivotal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opting-in to automated commit message feedback via COMMITWATCHERS. Guidelines in https://cwiki.apache.org/confluence/display/GEODE/Commit+Message+Format (which are totally optional, and yes, a bit pedantic) suggest your first commit summary should be 50 characters or less (not including bug# and pr#) to avoid truncation in github and other tools (yours is 64 characters...longer is ok and just check that you've prioritized the most salient words before the 47-character mark).
What matters most is not formatting, but including enough detail for future contributors to understand what you changed and why.
754956d to
626bf58
Compare
Improves the error handling of serial filter configuration and filtering. The API throws a runtime exception wrapping any thrown exceptions. When geode.enableGlobalSerialFilter is FALSE: * Startup succeeds without throwing any exceptions even if an older version of Java throws "java.lang.ClassNotFoundException sun.misc.ObjectInputFilter". When geode.enableGlobalSerialFilter is TRUE: * Startup fails by throwing an exception when configuration of serial filter fails for any reason. Renames ObjectInputFilter to avoid confusion with the Java interface of the same name. Fixes a bug found in ReflectiveFacadeGlobalSerialFilterTest which resulted in configuring a non-mocked process-wide serial filter that polluted the JVM for all later tests. Fixes other minor details in LocatorLauncher, InternalDataSerializer and various related tests. (cherry picked from commit ce57e9f)
626bf58 to
75fa136
Compare
Backport all necessary commits for GEODE-9758 and GEODE-9980