Skip to content

Commit

Permalink
Fix V6 and V7 and lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Aug 25, 2023
1 parent 3c76151 commit 40eed32
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.opensearch.client.node.NodeClient;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.BytesRestResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,30 @@ public String toString() {
}

public static class OnBehalfOfSettings {
@JsonProperty("enabled")
private Boolean oboEnabled = Boolean.TRUE;
@JsonProperty("signing_key")
private String signingKey;
@JsonProperty("encryption_key")
private String encryptionKey;

@JsonIgnore
public String configAsJson() {
try {
return DefaultObjectMapper.writeValueAsString(this, false);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}

public Boolean getOboEnabled() {
return oboEnabled;
}

public void setOboEnabled(Boolean oboEnabled) {
this.oboEnabled = oboEnabled;
}

public String getSigningKey() {
return signingKey;
}
Expand All @@ -381,7 +400,7 @@ public void setEncryptionKey(String encryptionKey) {

@Override
public String toString() {
return "OnBehalfOf [signing_key=" + signingKey + ", encryption_key=" + encryptionKey + "]";
return "OnBehalfOf [ enabled=" + oboEnabled + ", signing_key=" + signingKey + ", encryption_key=" + encryptionKey + "]";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static class Dynamic {
public String hosts_resolver_mode = "ip-only";
public String transport_userrname_attribute;
public boolean do_not_fail_on_forbidden_empty;
public OnBehalfOf on_behalf_of = new OnBehalfOf();
public OnBehalfOfSettings on_behalf_of = new OnBehalfOfSettings();

@Override
public String toString() {
Expand Down Expand Up @@ -480,7 +480,7 @@ public String toString() {

}

public static class OnBehalfOf {
public static class OnBehalfOfSettings {
@JsonProperty("enabled")
private Boolean oboEnabled = Boolean.TRUE;
@JsonProperty("signing_key")
Expand Down

0 comments on commit 40eed32

Please sign in to comment.