Skip to content

Commit

Permalink
chore: Fix & improvements for PR #645
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Nov 13, 2024
1 parent a5eb382 commit e2c1f04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ public static final UrlConfig from(IUrlConfig other) {
}

public static final UrlConfigBuilder builderFrom(IUrlConfig other) {
var builder = builderFromConnectionConfig(other);
if (null != other) {
return builderFrom(other).url(other.getUrl());
builder = builder.url(other.getUrl());
}
return builderFrom(other);
return builder;
}

public static final UrlConfigBuilder builderFrom(IUrlConfig other, IUrlConfig overrides) {
Expand All @@ -52,7 +53,7 @@ public static final UrlConfigBuilder builderFrom(IUrlConfig other, IUrlConfig ov
return builder;
}

public static final UrlConfigBuilder builderFrom(IConnectionConfig other) {
public static final UrlConfigBuilder builderFromConnectionConfig(IConnectionConfig other) {
UrlConfigBuilder builder = UrlConfig.builder();
if ( other!=null ) {
builder = builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class SCSastSessionDescriptor extends AbstractSessionDescriptor {


public SCSastSessionDescriptor(ISCSastAndSSCUrlConfig scSastAndSscUrlConfig, ISSCCredentialsConfig credentialsConfig, char[] scSastClientAuthToken) {
this.sscUrlConfig = UrlConfig.builderFrom(scSastAndSscUrlConfig).url(scSastAndSscUrlConfig.getSscUrl()).build();
this.sscUrlConfig = UrlConfig.builderFromConnectionConfig(scSastAndSscUrlConfig).url(scSastAndSscUrlConfig.getSscUrl()).build();
this.predefinedSscToken = credentialsConfig.getPredefinedToken();
this.scSastClientAuthToken = scSastClientAuthToken;
this.cachedSscTokenResponse = getOrGenerateToken(sscUrlConfig, credentialsConfig);
Expand Down Expand Up @@ -166,7 +166,7 @@ private static final IUrlConfig buildScSastUrlConfig(IUrlConfig sscUrlConfig, IS
if (null == controllerUrl || StringUtils.isBlank(controllerUrl)) {
controllerUrl = getScSastUrl(sscUrlConfig, activeToken);
}
return UrlConfig.builderFrom(scSastAndSscUrlConfig).url(controllerUrl).build();
return UrlConfig.builderFromConnectionConfig(scSastAndSscUrlConfig).url(controllerUrl).build();
}

private static String getScSastUrl(IUrlConfig sscUrlConfig, char[] activeToken) {
Expand Down

0 comments on commit e2c1f04

Please sign in to comment.