-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed JENKINS-15882 - rebuild plugin should not store non-stored password parameter #8
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
17cfac7
Fixed JENKINS-15882 - rebuild plugin should not store non-stored pass…
rinokadijk 0eb0c00
JENKINS-15882 - rebuild plugin should not store non-stored password p…
rinokadijk a95b48c
Merge branch 'master' of git://github.com/jenkinsci/rebuild-plugin
rinokadijk 690ac04
JENKINS-15882 - rebuild plugin should not store non-stored password p…
rinokadijk 16dd397
Merge branch 'master' of git://github.com/jenkinsci/rebuild-plugin
rinokadijk 6678b8e
JENKINS-15882 - rebuild plugin should not store non-stored password p…
rinokadijk 2102137
Fixed: JENKINS-14828 - Rebuild plugin crashes when used in conjuction…
rinokadijk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,8 @@ work | |
.classpath | ||
.project | ||
.settings | ||
### IntelliJ ### | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ |
This file contains 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
69 changes: 69 additions & 0 deletions
69
src/main/java/com/sonyericsson/rebuild/RebuildConfiguration.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2013 Rino Kadijk. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.sonyericsson.rebuild; | ||
|
||
import hudson.model.Describable; | ||
import hudson.model.Descriptor; | ||
import hudson.model.Hudson; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
/** | ||
* This class holds the configuration values for the rebuild action. | ||
*/ | ||
public class RebuildConfiguration implements Describable { | ||
|
||
public boolean rememberPasswordEnabled; | ||
|
||
/** | ||
* Constructs a new configuration object. | ||
* | ||
* @param rememberPasswordEnabled indicates whether the password field should be pre-filled or empty when rebuilding | ||
* a job with a password parameter. | ||
*/ | ||
@DataBoundConstructor | ||
public RebuildConfiguration(boolean rememberPasswordEnabled) { | ||
this.rememberPasswordEnabled = rememberPasswordEnabled; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RebuildConfiguration{" + | ||
"rememberPasswordEnabled=" + rememberPasswordEnabled + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public Descriptor getDescriptor() { | ||
return Hudson.getInstance().getDescriptorOrDie(RebuildConfiguration.class); | ||
} | ||
|
||
/** | ||
* True if the password field should be pre-filled. | ||
* | ||
* @return true if the password field should be pre-filled. | ||
*/ | ||
public boolean getRememberPasswordEnabled() { | ||
return rememberPasswordEnabled; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/com/sonyericsson/rebuild/RebuildDescriptor.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.sonyericsson.rebuild; | ||
|
||
import jenkins.model.GlobalConfiguration; | ||
import net.sf.json.JSONObject; | ||
import org.kohsuke.stapler.StaplerRequest; | ||
|
||
/** | ||
* This class holds the configuration values for the rebuild action. | ||
*/ | ||
public final class RebuildDescriptor extends GlobalConfiguration { | ||
private final RebuildConfiguration rebuildConfiguration = new RebuildConfiguration(Boolean.TRUE); | ||
|
||
/** | ||
* Constructs a new Descriptor implementation. | ||
*/ | ||
public RebuildDescriptor() { | ||
load(); | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Rebuild"; | ||
} | ||
|
||
@Override | ||
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { | ||
this.rebuildConfiguration.rememberPasswordEnabled = Boolean.valueOf(formData.getString("rememberPasswordEnabled")); | ||
save(); | ||
return true; | ||
} | ||
|
||
/** | ||
* Gets the configuration object. | ||
* | ||
* @return the configuration object. | ||
*/ | ||
public RebuildConfiguration getRebuildConfiguration() { | ||
return rebuildConfiguration; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/resources/com/sonyericsson/rebuild/RebuildAction/ExtendedChoiceParameterValue.jelly
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- | ||
The MIT License | ||
|
||
Copyright 2013 Rino Kadijk. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" | ||
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" | ||
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project"> | ||
<f:entry title="${it.name}" description="${it.description}"> | ||
<div name="parameter" description="${it.description}"> | ||
<input type="hidden" name="name" value="${it.name}" /> | ||
<f:textbox name="value" value="${it.value}" /> | ||
</div> | ||
</f:entry> | ||
</j:jelly> | ||
|
||
|
This file contains 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
This file contains 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
13 changes: 13 additions & 0 deletions
13
src/main/resources/com/sonyericsson/rebuild/RebuildDescriptor/config.jelly
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" | ||
xmlns:t="/lib/hudson" | ||
xmlns:f="/lib/form"> | ||
<f:section title="Rebuild"> | ||
<f:entry title="Rebuild Configuration"> | ||
<table width="100%"> | ||
<f:entry title="Remember Password Enabled" field="rememberPasswordEnabled"> | ||
<f:checkbox default="true" checked="${descriptor.rebuildConfiguration.rememberPasswordEnabled}" /> | ||
</f:entry> | ||
</table> | ||
</f:entry> | ||
</f:section> | ||
</j:jelly> |
6 changes: 6 additions & 0 deletions
6
...in/resources/com/sonyericsson/rebuild/RebuildDescriptor/help-rememberPasswordEnabled.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div> | ||
If the remember password option is checked, the rebuild plugin will use the stored password parameter when a | ||
rebuild is triggered. If the remember password option is unchecked, the user will be prompted to enter the | ||
password every time a rebuild is triggered. This only applies for a parameterized build with parameters of | ||
type password. | ||
</div> |
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.
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.
File has not been described in the PR