Skip to content

Commit 763aa3b

Browse files
suryag1201Gupta, Surya
andauthored
Feature/cstackex 117 (#34)
* CSTAKEX-117 Password encoding * CSTACKEX-117 Decode the password * CSTACKEX-117 resolve check style issues * CSTACKEX-117 Remove unnecesaary loggers --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
1 parent 7c2b229 commit 763aa3b

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ public DataStore initialize(Map<String, Object> dsInfos) {
183183
details.put(Constants.SIZE, capacityBytes.toString());
184184

185185
ProtocolType protocol = ProtocolType.valueOf(details.get(Constants.PROTOCOL));
186-
187186
// Connect to ONTAP and create volume
188187
long volumeSize = Long.parseLong(details.get(Constants.SIZE));
189188
OntapStorage ontapStorage = new OntapStorage(

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/provider/StorageProviderFactory.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
import com.cloud.utils.component.ComponentContext;
2323
import com.cloud.utils.exception.CloudRuntimeException;
24+
25+
import java.nio.charset.StandardCharsets;
26+
2427
import org.apache.cloudstack.storage.feign.model.OntapStorage;
2528
import org.apache.cloudstack.storage.service.StorageStrategy;
2629
import org.apache.cloudstack.storage.service.UnifiedNASStrategy;
@@ -36,6 +39,14 @@ public class StorageProviderFactory {
3639
public static StorageStrategy getStrategy(OntapStorage ontapStorage) {
3740
ProtocolType protocol = ontapStorage.getProtocol();
3841
s_logger.info("Initializing StorageProviderFactory with protocol: " + protocol);
42+
String decodedPassword = new String(java.util.Base64.getDecoder().decode(ontapStorage.getPassword()), StandardCharsets.UTF_8);
43+
ontapStorage = new OntapStorage(
44+
ontapStorage.getUsername(),
45+
decodedPassword,
46+
ontapStorage.getStorageIP(),
47+
ontapStorage.getSvmName(),
48+
ontapStorage.getSize(),
49+
protocol);
3950
switch (protocol) {
4051
case NFS3:
4152
UnifiedNASStrategy unifiedNASStrategy = new UnifiedNASStrategy(ontapStorage);

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public UnifiedNASStrategy(OntapStorage ontapStorage) {
7575
String baseURL = Constants.HTTPS + ontapStorage.getStorageIP();
7676
this.feignClientFactory = new FeignClientFactory();
7777
this.nasFeignClient = feignClientFactory.createClient(NASFeignClient.class, baseURL);
78-
this.volumeFeignClient = feignClientFactory.createClient(VolumeFeignClient.class,baseURL );
78+
this.volumeFeignClient = feignClientFactory.createClient(VolumeFeignClient.class, baseURL);
7979
this.jobFeignClient = feignClientFactory.createClient(JobFeignClient.class, baseURL );
8080
}
8181

ui/src/views/infra/AddPrimaryStorage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ export default {
938938
} else if (values.provider === 'NetApp ONTAP') {
939939
params['details[0].storageIP'] = values.ontapIP
940940
params['details[0].username'] = values.ontapUsername
941-
params['details[0].password'] = values.ontapPassword
941+
params['details[0].password'] = btoa(values.ontapPassword)
942942
params['details[0].svmName'] = values.ontapSvmName
943943
params['details[0].protocol'] = values.protocol
944944
values.managed = true

0 commit comments

Comments
 (0)