-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using StringCredentialsImpl as tokens Move ServiceAccountCredential to kubernetes-credentials
- Loading branch information
Showing
9 changed files
with
85 additions
and
66 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
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
7 changes: 2 additions & 5 deletions
7
...main/java/org/csanchez/jenkins/plugins/kubernetes/OpenShiftBearerTokenCredentialImpl.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
33 changes: 28 additions & 5 deletions
33
src/main/java/org/csanchez/jenkins/plugins/kubernetes/OpenShiftTokenCredentialImpl.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 |
---|---|---|
@@ -1,22 +1,45 @@ | ||
package org.csanchez.jenkins.plugins.kubernetes; | ||
|
||
import org.jenkinsci.plugins.plaincredentials.StringCredentials; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import com.cloudbees.plugins.credentials.CredentialsScope; | ||
import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
import hudson.Extension; | ||
import hudson.util.Secret; | ||
|
||
/** | ||
* @deprecated Use {@link StringCredentials} | ||
* @author <a href="mailto:andy.block@gmail.com">Andrew Block</a> | ||
*/ | ||
@Deprecated | ||
@SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS") | ||
public class OpenShiftTokenCredentialImpl | ||
extends org.jenkinsci.plugins.kubernetes.credentials.OpenShiftTokenCredentialImpl { | ||
public class OpenShiftTokenCredentialImpl extends BaseStandardCredentials implements TokenProducer { | ||
|
||
private final Secret secret; | ||
|
||
@DataBoundConstructor | ||
public OpenShiftTokenCredentialImpl(CredentialsScope scope, String id, String description, Secret secret) { | ||
super(scope, id, description, secret); | ||
super(scope, id, description); | ||
this.secret = secret; | ||
} | ||
|
||
@Override | ||
public String getToken(String serviceAddress, String caCertData, boolean skipTlsVerify) { | ||
return secret.getPlainText(); | ||
} | ||
|
||
public Secret getSecret() { | ||
return secret; | ||
} | ||
|
||
@Extension | ||
public static class DescriptorImpl extends BaseStandardCredentialsDescriptor { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "OpenShift OAuth token"; | ||
} | ||
} | ||
|
||
} |
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