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

"[March 05, 2022] [BUG] retrieve_credentials() returns incorrect KeyPairCredentials object if credential_supplier has empty password" #427

Closed
Balamuruhan opened this issue Mar 5, 2022 · 0 comments

Comments

@Balamuruhan
Copy link
Contributor

** Expected Behavior**
Even if credentials_supplier dict has empty password is should return PasswordCredentials() object but instead KeyPairCredentials() is returned.

** Actual Behavior**
For EBS plugin implemented in vsdk, we use passwordCredentialsSupplier for System Password field which is retrieved from UI and used in our workflows. But this field is optional field, where user may not provide it in most of the cases. So when we upgrade the plugin from Lua to VSDK and empty password is passed in for System password field. After upgrade, when VSDK code retrieves it using retrieve_credentials() fails with AttributeError as retrieve_credentials() returns the KeyPairCredentials() instead of PasswordCredentials(). This is because there is a check credentials_result.password != "" which is incorrect, instead it should be "password" in credentials_supplier

Steps To Reproduce the Problem
Call the retrieve_credentials() with dict {'password': '', 'type': 'NamedPasswordCredential'},

from dlpx.virtualization import libs
vault = {'password': '', 'type': 'NamedPasswordCredential'}
password = libs.retrieve_credentials(vault).password # We hit AttributeError as it returns KeyPairCredentials object which doesn't have attribute password.

Steps to reproduce the behavior:

  1. Use EBS Lua plugin to link and provision datasets with System Password field empty
  2. Disable datasets.
  3. Upgrade Lua to VSDK plugin
  4. Refresh the environments
  5. Enable datasets after successful upgrade.
  6. We hit AttributeError when dataset starts to run on vsdk plugin due to this issue
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 5, 2022
…ntials object if credential_supplier has empty password
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 6, 2022
…ntials object if credential_supplier has empty password
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 10, 2022
…ntials object if credential_supplier has empty password
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 10, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 14, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 16, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 16, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 16, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 18, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Mar 24, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Apr 1, 2022
Balamuruhan added a commit to Balamuruhan/virtualization-sdk that referenced this issue Apr 1, 2022
@ravi-cm ravi-cm closed this as completed in 0d9b832 Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant