-
Notifications
You must be signed in to change notification settings - Fork 5
Allow whitelist of packages that can exit #4
Conversation
Today, SecureSM has a mechanism that enables a hardcoded list of test packages to exit if the SecureSM instance is constructed with a boolean flag indicating that these packages will be permitted to exit. This commit replaces this mechanism by allowing the SecureSM instance to be constructed with a whitelist of packages that can exit.
| * The "Uwe Schindler" algorithm. | ||
| */ | ||
| protected void checkTestExit(final int status) { | ||
| protected void checkExit(final int status, final String[] packagesThatCanExit) { |
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 don't understand why we should change this signature, given that we already have the list of packages as an instance variable.
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 pushed f0dc394.
This commit removes a parameter from SecureSM#checkExit(int, String[]) that is not needed as the necessary values are a field on the instance.
This commit adds a convenience method for creating a test SecureSM for which a standard set of packages can exit or halt the VM. Additionally, a default constructor is added with the semantics that no package can exit nor halt the virtual machine.
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.Objects; |
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.
can we nuke these imports when pushing?
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 pushed c8d058f.
|
+1, thank you. i left a note about unused imports, looks great. |
|
Thanks @rmuir. |
|
now to figure out how to release a new version :) |
Today, SecureSM has a mechanism that enables a hardcoded list of test
packages to exit if the SecureSM instance is constructed with a boolean
flag indicating that these packages will be permitted to exit. This
commit replaces this mechanism by allowing the SecureSM instance to be
constructed with a whitelist of packages that can exit.