-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NMS-16943 : De-Sync Bug between Web UI and SCVCLI Command. #7554
base: foundation-2024
Are you sure you want to change the base?
Conversation
Junaid-Khan-Nant
commented
Dec 5, 2024
- https://opennms.atlassian.net/browse/NMS-16943
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think these changes are solving the problem properly.
Looks like this problem occurs because cache is invalid when we add credentials form scvcli.
Two ways to solve this issue:
-
We may have to watch for file updates with
FileReloadContainer
and reload the cache when the keystore file gets updated. -
Add a button to reload cache in UI and implement in Rest api and service.
I would prefer to try with 1 option.
Or may be try using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proposed couple of solutions to solve this properly.
try { | ||
KeyStore.PasswordProtection keyStorePP = new KeyStore.PasswordProtection(m_password); | ||
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBE"); | ||
for (String aliass : getAliases()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliass should be alias
continue; | ||
} | ||
PBEKeySpec keySpec = (PBEKeySpec) factory.getKeySpec(ske.getSecretKey(), PBEKeySpec.class); | ||
m_credentialsCache.put(aliass, fromBase64EncodedByteArray(new String(keySpec.getPassword()).getBytes())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_credentialsCache is access by multiple threads need to synchronize the block