Skip to content
Permalink
Browse files

use modern api in ConsoleLogFilter

When enabled globally it should work with all types of Jobs, also
pipelines once JENKINS-45693 is fixed.
  • Loading branch information
mwinter69 committed Mar 15, 2018
1 parent 5e9e820 commit ba1c3781e91c18c6c57d96c3022eec9f66b48f8f
@@ -15,7 +15,7 @@
<version>2.11.1-SNAPSHOT</version>

<properties>
<jenkins.version>1.625.3</jenkins.version>
<jenkins.version>1.642.4</jenkins.version>
<java.level>7</java.level>
<workflow.version>1.8</workflow.version>
</properties>
@@ -24,43 +24,16 @@

package com.michelin.cio.hudson.plugins.maskpasswords;

import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
import hudson.console.ConsoleLogFilter;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.ParameterValue;
import hudson.model.ParametersAction;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.tasks.BuildWrapperDescriptor;
import hudson.util.Secret;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.tasks.SimpleBuildWrapper;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.jvnet.localizer.Localizable;
import org.jvnet.localizer.ResourceBundleHolder;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

/**
* GLOBAL Console Log Filter that alters the console so that passwords don't
@@ -79,7 +52,7 @@ public MaskPasswordsConsoleLogFilter() {

@SuppressWarnings("rawtypes")
@Override
public OutputStream decorateLogger(AbstractBuild _ignore, OutputStream logger) throws IOException, InterruptedException {
public OutputStream decorateLogger(Run _ignore, OutputStream logger) throws IOException, InterruptedException {
// check the config
MaskPasswordsConfig config = MaskPasswordsConfig.getInstance();
if(! config.isEnabledGlobally()) {

0 comments on commit ba1c378

Please sign in to comment.
You can’t perform that action at this time.