Skip to content

Commit d2b8d27

Browse files
authored
Merge pull request #33 from bdpiparva/rename-oauth-token-key
Changed plugin settings key oauth_token to security_token
2 parents 2cb5361 + 43e209f commit d2b8d27

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/java/cd/go/contrib/elasticagent/KubernetesClientFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public synchronized KubernetesClient client(PluginSettings pluginSettings) {
4747

4848
private KubernetesClient createClientFor(PluginSettings pluginSettings) {
4949
final ConfigBuilder configBuilder = new ConfigBuilder()
50-
.withOauthToken(pluginSettings.getOauthToken())
50+
.withOauthToken(pluginSettings.getSecurityToken())
5151
.withMasterUrl(pluginSettings.getClusterUrl())
5252
.withCaCertData(pluginSettings.getCaCertData())
5353
.withNamespace(pluginSettings.getNamespace());

src/main/java/cd/go/contrib/elasticagent/PluginSettings.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public class PluginSettings {
4141
private String clusterUrl;
4242

4343
@Expose
44-
@SerializedName("oauth_token")
45-
private String oauthToken;
44+
@SerializedName("security_token")
45+
private String securityToken;
4646

4747
@Expose
4848
@SerializedName("kubernetes_cluster_ca_cert")
@@ -86,8 +86,8 @@ public String getGoServerUrl() {
8686
return goServerUrl;
8787
}
8888

89-
public String getOauthToken() {
90-
return oauthToken;
89+
public String getSecurityToken() {
90+
return securityToken;
9191
}
9292

9393
public String getClusterUrl() {
@@ -127,7 +127,7 @@ public boolean equals(Object o) {
127127
if (maxPendingPods != null ? !maxPendingPods.equals(that.maxPendingPods) : that.maxPendingPods != null)
128128
return false;
129129
if (clusterUrl != null ? !clusterUrl.equals(that.clusterUrl) : that.clusterUrl != null) return false;
130-
if (oauthToken != null ? !oauthToken.equals(that.oauthToken) : that.oauthToken != null) return false;
130+
if (securityToken != null ? !securityToken.equals(that.securityToken) : that.securityToken != null) return false;
131131
if (clusterCACertData != null ? !clusterCACertData.equals(that.clusterCACertData) : that.clusterCACertData != null)
132132
return false;
133133
return namespace != null ? namespace.equals(that.namespace) : that.namespace == null;
@@ -139,7 +139,7 @@ public int hashCode() {
139139
result = 31 * result + (autoRegisterTimeout != null ? autoRegisterTimeout.hashCode() : 0);
140140
result = 31 * result + (maxPendingPods != null ? maxPendingPods.hashCode() : 0);
141141
result = 31 * result + (clusterUrl != null ? clusterUrl.hashCode() : 0);
142-
result = 31 * result + (oauthToken != null ? oauthToken.hashCode() : 0);
142+
result = 31 * result + (securityToken != null ? securityToken.hashCode() : 0);
143143
result = 31 * result + (clusterCACertData != null ? clusterCACertData.hashCode() : 0);
144144
result = 31 * result + (namespace != null ? namespace.hashCode() : 0);
145145
return result;

src/test/java/cd/go/contrib/elasticagent/PluginSettingsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void shouldDeserializeFromJSON() {
3535
pluginSettingsMap.put("auto_register_timeout", "13");
3636
pluginSettingsMap.put("pending_pods_count", 14);
3737
pluginSettingsMap.put("kubernetes_cluster_url", "https://cloud.example.com");
38-
pluginSettingsMap.put("oauth_token", "foo-token");
38+
pluginSettingsMap.put("security_token", "foo-token");
3939
pluginSettingsMap.put("kubernetes_cluster_ca_cert", "foo-ca-certs");
4040
pluginSettingsMap.put("namespace", "gocd");
4141

@@ -46,7 +46,7 @@ public void shouldDeserializeFromJSON() {
4646
assertThat(pluginSettings.getMaxPendingPods(), is(14));
4747
assertThat(pluginSettings.getClusterUrl(), is("https://cloud.example.com"));
4848
assertThat(pluginSettings.getCaCertData(), is("foo-ca-certs"));
49-
assertThat(pluginSettings.getOauthToken(), is("foo-token"));
49+
assertThat(pluginSettings.getSecurityToken(), is("foo-token"));
5050
assertThat(pluginSettings.getNamespace(), is("gocd"));
5151

5252
}

0 commit comments

Comments
 (0)