Skip to content

Commit

Permalink
OnBehalfOf tokens feature is disabled by default (opensearch-project#…
Browse files Browse the repository at this point in the history
…3643)

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks authored Nov 3, 2023
1 parent 5f1058a commit 823a311
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public String toString() {

public static class OnBehalfOfSettings {
@JsonProperty("enabled")
private Boolean oboEnabled = Boolean.TRUE;
private Boolean oboEnabled = Boolean.FALSE;
@JsonProperty("signing_key")
private String signingKey;
@JsonProperty("encryption_key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public String toString() {
+ authc
+ ", authz="
+ authz
+ ", on_behalf_of="
+ on_behalf_of
+ "]";
}
}
Expand Down Expand Up @@ -482,7 +484,7 @@ public String toString() {

public static class OnBehalfOfSettings {
@JsonProperty("enabled")
private Boolean oboEnabled = Boolean.TRUE;
private Boolean oboEnabled = Boolean.FALSE;
@JsonProperty("signing_key")
private String signingKey;
@JsonProperty("encryption_key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ public void testDashboards() throws Exception {
assertEquals(kibana, DefaultObjectMapper.readTree(json));
assertEquals(kibana, DefaultObjectMapper.readValue(json, ConfigV6.Kibana.class));
}

@Test
public void testOnBehalfOfSettings() {
ConfigV6.OnBehalfOfSettings oboSettings;

oboSettings = new ConfigV6.OnBehalfOfSettings();
Assert.assertEquals(oboSettings.getOboEnabled(), Boolean.FALSE);
Assert.assertNull(oboSettings.getSigningKey());
Assert.assertNull(oboSettings.getEncryptionKey());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,14 @@ public void testDashboards() throws Exception {
assertEquals(kibana, DefaultObjectMapper.readTree(json));
assertEquals(kibana, DefaultObjectMapper.readValue(json, ConfigV7.Kibana.class));
}

@Test
public void testOnBehalfOfSettings() {
ConfigV7.OnBehalfOfSettings oboSettings;

oboSettings = new ConfigV7.OnBehalfOfSettings();
Assert.assertEquals(oboSettings.getOboEnabled(), Boolean.FALSE);
Assert.assertNull(oboSettings.getSigningKey());
Assert.assertNull(oboSettings.getEncryptionKey());
}
}

0 comments on commit 823a311

Please sign in to comment.