Skip to content

Commit

Permalink
Modify the getDynamicOnBehalfOfSettings() to return settings.Empty if…
Browse files Browse the repository at this point in the history
… there is no changes

Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Aug 16, 2023
1 parent b64f7e1 commit 6cafc19
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ public void onDynamicConfigModelChanged(DynamicConfigModel dcm) {
this.dcm = dcm;

Settings settings = dcm.getDynamicOnBehalfOfSettings();
if (settings != null) {
Boolean enabled = Boolean.parseBoolean(settings.get("enabled"));
String signingKey = settings.get("signing_key");
String encryptionKey = settings.get("encryption_key");

if (!Boolean.FALSE.equals(enabled) && signingKey != null && encryptionKey != null) {
this.vendor = new JwtVendor(settings, Optional.empty());
} else {
this.vendor = null;
}

Boolean enabled = Boolean.parseBoolean(settings.get("enabled"));
String signingKey = settings.get("signing_key");
String encryptionKey = settings.get("encryption_key");

if (!Boolean.FALSE.equals(enabled) && signingKey != null && encryptionKey != null) {
this.vendor = new JwtVendor(settings, Optional.empty());
} else {
this.vendor = null;
}
Expand Down

0 comments on commit 6cafc19

Please sign in to comment.