Alon Bar-Lev has posted comments on this change.

Change subject: engine: Import single certificate
......................................................................


Patch Set 2:

(4 comments)

http://gerrit.ovirt.org/#/c/35485/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetProviderCertificateQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetProviderCertificateQuery.java:

> Test is about testing connectivity to provider.
you can get the certificate out of the test for connectivity as a result.

1. connection successful.

2. optional certificate.

I do not think there is a need for a new query.
Line 1: package org.ovirt.engine.core.bll;
Line 2: 
Line 3: import java.security.cert.Certificate;
Line 4: import java.security.cert.CertificateEncodingException;


Line 28:         ProviderProxy proxy = 
ProviderProxyFactory.getInstance().create(provider);
Line 29:         List<? extends Certificate> chain = 
proxy.getCertificateChain();
Line 30:         if (!chain.isEmpty()) {
Line 31:             try {
Line 32:                 getQueryReturnValue().setReturnValue(new 
Base64().encodeToString(chain.get(chain.size() - 1)
> a. you can put anything you want in setReturnValue
better to have class so we can refer by name, no?
Line 33:                         .getEncoded()));
Line 34:             } catch (CertificateEncodingException e) {
Line 35:                 getQueryReturnValue().setSucceeded(false);
Line 36:                 log.error("Error in encoding certificate. Error is {} 
" + e.getMessage());


http://gerrit.ovirt.org/#/c/35485/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ExternalTrustStoreInitializer.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ExternalTrustStoreInitializer.java:

Line 49:             throw new RuntimeException(e);
Line 50:         }
Line 51:     }
Line 52: 
Line 53:     @Deprecated
> it is still used by rest-api, I'm not going to change this currently.
ok
Line 54:     public static void addCertificateChain(List<? extends Certificate> 
chain) throws CertificateEncodingException,
Line 55:             KeyStoreException {
Line 56:         KeyStore ks = getTrustStore();
Line 57:         Certificate certificate = chain.get(chain.size() - 1);


http://gerrit.ovirt.org/#/c/35485/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ImportProviderCetificateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ImportProviderCetificateCommand.java:

> You probably mean the update provider operation, I think we can do that, bu
nothing actually wrong, but reusing the same command should be easier. so now, 
when you approve you import, that's ok as well... you can still cancel the 
provider addition, right? so can we end up with a certificate and no provider?
Line 1: package org.ovirt.engine.core.bll.provider;
Line 2: 
Line 3: import java.io.ByteArrayInputStream;
Line 4: import java.io.IOException;


-- 
To view, visit http://gerrit.ovirt.org/35485
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9adb21ded6e6d9fb09fc68331872c1cd88f88a9
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to