-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SECURITY-1408, SECURITY-381, SECURITY-1528
Co-Authored-By: Jeff Thompson <37345299+jeffret-b@users.noreply.github.com> Co-Authored-By: Matt Sicker <boards@gmail.com> Co-Authored-By: rsandell <rsandell@cloudbees.com>
- Loading branch information
1 parent
f520245
commit 4c9f03a
Showing
42 changed files
with
2,194 additions
and
50 deletions.
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 |
---|---|---|
|
@@ -11,3 +11,5 @@ target | |
/bin | ||
/work | ||
/src_generated | ||
.history | ||
.factorypath |
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
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
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
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
67 changes: 67 additions & 0 deletions
67
src/main/java/hudson/plugins/ec2/HostKeyVerificationStrategyEnum.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,67 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2020-, M Ramon Leon, CloudBees, Inc. | ||
* | ||
* 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 hudson.plugins.ec2; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.plugins.ec2.ssh.verifiers.AcceptNewStrategy; | ||
import hudson.plugins.ec2.ssh.verifiers.CheckNewHardStrategy; | ||
import hudson.plugins.ec2.ssh.verifiers.CheckNewSoftStrategy; | ||
import hudson.plugins.ec2.ssh.verifiers.NonVerifyingKeyVerificationStrategy; | ||
import hudson.plugins.ec2.ssh.verifiers.SshHostKeyVerificationStrategy; | ||
|
||
public enum HostKeyVerificationStrategyEnum { | ||
CHECK_NEW_HARD("check-new-hard", "yes", new CheckNewHardStrategy()), | ||
CHECK_NEW_SOFT("check-new-soft", "accept-new", new CheckNewSoftStrategy()), | ||
ACCEPT_NEW("accept-new", "accept-new", new AcceptNewStrategy()), | ||
OFF("off", "off", new NonVerifyingKeyVerificationStrategy()); | ||
|
||
private final String displayText; | ||
private final SshHostKeyVerificationStrategy strategy; | ||
private final String sshCommandEquivalentFlag; | ||
|
||
HostKeyVerificationStrategyEnum(@NonNull String displayText, @NonNull String sshCommandEquivalentFlag, @NonNull SshHostKeyVerificationStrategy strategy) { | ||
this.displayText = displayText; | ||
this.sshCommandEquivalentFlag = sshCommandEquivalentFlag; | ||
this.strategy = strategy; | ||
} | ||
|
||
@NonNull | ||
public SshHostKeyVerificationStrategy getStrategy() { | ||
return strategy; | ||
} | ||
|
||
public boolean equalsDisplayText(String other) { | ||
return this.displayText.equals(other); | ||
} | ||
|
||
@NonNull | ||
public String getDisplayText() { | ||
return displayText; | ||
} | ||
|
||
@NonNull | ||
public String getSshCommandEquivalentFlag() { | ||
return sshCommandEquivalentFlag; | ||
} | ||
} |
Oops, something went wrong.