Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[NC-2118] Method to reload permissions file #834

Merged
merged 15 commits into from
Feb 12, 2019

Conversation

lucassaldanha
Copy link
Contributor

PR description

Implemented perm_reloadPermissionsFile API method that will trigger a reload of the permissions file, updating the accounts and nodes whitelists.

configuration.isAccountWhitelistEnabled());

readNodesFromConfig(updatedConfig);
this.configuration = updatedConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably an unlikely case, but should the config be reverted if the Exception is thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only update the config as the last line inside the try-catch block. Any exception thrown before that will result in the configuration object not being updated.

"Error reloading permissions file. In-memory whitelisted accounts will be reverted to previous valid configuration. "
+ "Details: {}",
e.getMessage());
this.accountWhitelist.addAll(currentAccountsList);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See NodeWhitelistController comments.

@lucassaldanha lucassaldanha merged commit a82e91a into PegaSysEng:master Feb 12, 2019
@lucassaldanha lucassaldanha deleted the nc-2118 branch February 12, 2019 20:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants