Skip to content
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

Open
wants to merge 1 commit into
base: foundation-2024
Choose a base branch
from

Conversation

Junaid-Khan-Nant
Copy link
Contributor

@Junaid-Khan-Nant
Copy link
Contributor Author

Screenshot from 2024-12-04 22-45-32
Screenshot from 2024-12-04 22-45-24
Screenshot from 2024-12-04 22-45-16

Copy link
Contributor

@cgorantla cgorantla left a 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:

  1. We may have to watch for file updates with FileReloadContainer and reload the cache when the keystore file gets updated.

  2. Add a button to reload cache in UI and implement in Rest api and service.

I would prefer to try with 1 option.

@cgorantla
Copy link
Contributor

Or may be try using FileUpdateWatcher to reload the cache.

Copy link
Contributor

@cgorantla cgorantla left a 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()) {
Copy link
Member

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()));
Copy link
Member

@aurang-zeb313 aurang-zeb313 Dec 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants