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:
Use EBS Lua plugin to link and provision datasets with System Password field empty
Disable datasets.
Upgrade Lua to VSDK plugin
Refresh the environments
Enable datasets after successful upgrade.
We hit AttributeError when dataset starts to run on vsdk plugin due to this issue
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'},
Steps to reproduce the behavior: