Skip to content

Commit

Permalink
Merge commit '7e43cd8ed6522a134f42891ee8b514bb159735f7'
Browse files Browse the repository at this point in the history
Fixes JENKINS-3709
  • Loading branch information
Radek Antoniuk committed Oct 8, 2015
2 parents ffee9e2 + 7e43cd8 commit da1ae78
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/hudson/plugins/jira/JiraSite.java
Expand Up @@ -14,6 +14,7 @@
import hudson.model.AbstractProject;
import hudson.model.Descriptor;
import hudson.util.FormValidation;
import hudson.util.Secret;
import org.joda.time.DateTime;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
Expand All @@ -26,7 +27,12 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -82,7 +88,7 @@ public class JiraSite extends AbstractDescribableImpl<JiraSite> {
/**
* Password needed to login. Optional.
*/
public final String password;
public final Secret password;

/**
* Group visibility to constrain the visibility of the added comment. Optional.
Expand Down Expand Up @@ -160,7 +166,7 @@ public JiraSite(URL url, URL alternativeUrl, String userName, String password, b
this.url = url;
this.alternativeUrl = alternativeUrl;
this.userName = Util.fixEmpty(userName);
this.password = Util.fixEmpty(password);
this.password = Secret.fromString(Util.fixEmpty(password));
this.supportsWikiStyleComment = supportsWikiStyleComment;
this.recordScmChanges = recordScmChanges;
this.userPattern = Util.fixEmpty(userPattern);
Expand Down Expand Up @@ -227,9 +233,9 @@ protected JiraSession createSession() throws IOException {
LOGGER.info("creating Jira Session: " + uri);

final JiraRestClient jiraRestClient = new AsynchronousJiraRestClientFactory()
.createWithBasicHttpAuthentication(uri, userName, password);
.createWithBasicHttpAuthentication(uri, userName, password.getPlainText());

return new JiraSession(this, new JiraRestService(uri, jiraRestClient, userName, password));
return new JiraSession(this, new JiraRestService(uri, jiraRestClient, userName, password.getPlainText()));
}

/**
Expand Down

0 comments on commit da1ae78

Please sign in to comment.