This repository was archived by the owner on Jan 12, 2021. It is now read-only.
Allow whitelist of packages that can exit#4
Merged
jasontedor merged 4 commits intoelastic:masterfrom Jul 5, 2016
Merged
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) { |
Contributor
There was a problem hiding this comment.
I don't understand why we should change this signature, given that we already have the list of packages as an instance variable.
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; |
Contributor
There was a problem hiding this comment.
can we nuke these imports when pushing?
Contributor
|
+1, thank you. i left a note about unused imports, looks great. |
Member
Author
|
Thanks @rmuir. |
Contributor
|
now to figure out how to release a new version :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.