-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AVRO-3985: Add trusted packages support in SpecificData #2934
Conversation
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 @jbonofre
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflectData.java
Outdated
Show resolved
Hide resolved
78142bb
to
9991b78
Compare
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Outdated
Show resolved
Hide resolved
@Fokko @martin-g @KalleOlaviNiemitalo I updated the PR. Can you guys please take a look ? Thanks ! |
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Show resolved
Hide resolved
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Outdated
Show resolved
Hide resolved
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java
Show resolved
Hide resolved
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Moving this forward, thanks @jbonofre for fixing this 🙌 and thanks @martin-g and @KalleOlaviNiemitalo for the reviews! |
I'm creating the 1.11.x backport PR. |
|
||
boolean found = false; | ||
Package thePackage = clazz.getPackage(); | ||
if (thePackage != null) { |
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.
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.
I can take a look on this too as I'm the original author
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.
@MichalFoksa Would you like to send a Pull Request?
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.
Else I can work on a PR tomorrow
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.
What is the purpose of the change
This change introduces the
org.apache.avro.SERIALIZABLE_PACKAGES
system property to enforce the security aspect of usingjava-class
in a schema.Verifying this change
This change is already covered by existing tests, using the default trusted packages. I can add an additional test specifically for non trusted packages.
Documentation
org.apache.avro.SERIALIZABLE_PACKAGES
system property. Happy to add additional documentation if needed.