* Allows historical build records with unsigned console notes to be displayed, at the expense of any security.
* Disables checking of {@link #MAC} so do not set this flag unless you completely trust all users capable of affecting build output,
* which in practice means that all SCM committers as well as all Jenkins users with any non-read-only access are consider administrators.
*/
static/* nonfinal for tests & script console */booleanLENIENT_MAC=Boolean.getBoolean(ConsoleNote.class.getName()+".LENIENT_MAC");// TODO 2.x use SystemProperties
/**
* When the line of a console output that this annotation is attached is read by someone,
...
...
@@ -240,7 +246,9 @@ public abstract class ConsoleNote<T> implements Serializable, Describable<Consol
returnnull;// not a valid postamble
if(mac==null){
thrownewIOException("Refusing to deserialize unsigned note from an old log.");
if(!LENIENT_MAC){
thrownewIOException("Refusing to deserialize unsigned note from an old log.");
@@ -78,6 +79,14 @@ public class AnnotatedLargeTextTest {
text.writeHtmlTo(0,w);
assertEquals("hellothere\n",w.toString());
// TODO expect log record with message "Failed to resurrect annotation" and IOException with message "Refusing to deserialize unsigned note from an old log."