Skip to content

Commit c1b135e

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
CSTACKEX-98 decoded the Base64 password
1 parent 8cf7f97 commit c1b135e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@
5757
import org.apache.logging.log4j.Logger;
5858

5959
import javax.inject.Inject;
60-
import java.util.List;
61-
import java.util.Map;
62-
import java.util.Set;
63-
import java.util.UUID;
60+
import java.util.*;
6461

6562
public class OntapPrimaryDatastoreLifecycle extends BasePrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
6663
@Inject private ClusterDao _clusterDao;
@@ -182,12 +179,15 @@ public DataStore initialize(Map<String, Object> dsInfos) {
182179
details.put(Constants.SIZE, capacityBytes.toString());
183180

184181
ProtocolType protocol = ProtocolType.valueOf(details.get(Constants.PROTOCOL));
182+
String encodedPassword = details.get(Constants.PASSWORD);
183+
byte[] decodedBytes = Base64.getDecoder().decode(encodedPassword);
184+
String decodedPassword = new String(decodedBytes);
185185

186186
// Connect to ONTAP and create volume
187187
long volumeSize = Long.parseLong(details.get(Constants.SIZE));
188188
OntapStorage ontapStorage = new OntapStorage(
189189
details.get(Constants.USERNAME),
190-
details.get(Constants.PASSWORD),
190+
decodedPassword,
191191
details.get(Constants.STORAGE_IP),
192192
details.get(Constants.SVM_NAME),
193193
volumeSize,

0 commit comments

Comments
 (0)