[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] How to turn of the security warningduring afeature installation

Sam,
I guess that your agent is returned null after 60 seconds.
Did you make sure to include and start (at 1 or 0) org.eclipse.equinox.ds in your launch configuration or product ? because the IProvisioningAgent is registered through Declarative Services.

Regards,
Anthony



De : p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] De la part de Samuel Wu
Envoyà : 1 juin 2011 14:18
à : P2 developer discussions
Objet : Re: [p2-dev] How to turn of the security warningduring afeature installation

I'm trying to put Anthony, Pascal and Eugin's suggestion together without success. I created a plug-in which tried to run the following code in the start(BundleContext context)of the plugin.
ServiceTracker srvTrackerAgent = new ServiceTracker(context, IProvisioningAgent.class.getName(), null);
IProvisioningAgent agent = (IProvisioningAgent) srvTrackerAgent.waitForService(60 * 1000);
new ValidationDialogService().bindProvisioningAgent(agent);
The problem is that the agent got from the srvTrackerAgent is null. 
Can you please advise what I missed? Thanks.

Best Regards

Samuel Wu


"Dahanne, Anthony" ---05/30/2011 09:56:36 AM---Hello Samuel, Isn't the bundle org.eclipse.equinox.p2.core automatically registering the IProvisioni

From:

"Dahanne, Anthony" <Anthony.Dahanne@xxxxxxxxxxxxx>

To:

"P2 developer discussions" <p2-dev@xxxxxxxxxxx>

Date:

05/30/2011 09:56 AM

Subject:

Re: [p2-dev] How to turn of the security warning during afeature installation

Sent by:

p2-dev-bounces@xxxxxxxxxxx

 
Le contenu de ce courriel s'adresse au destinataire seulement. Il contient de l'information pouvant Ãtre confidentielle. Vous ne devez ni le copier ni l'utiliser ni le divulguer à qui que ce soit à moins que vous soyez le destinataire ou une personne dÃsignÃe autorisÃe. Si vous le receviez par erreur, veuillez nous aviser immÃdiatement et le dÃtruire.
 
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
 




Hello Samuel,
Isn't the bundle org.eclipse.equinox.p2.core automatically registering the IProvisioningAgent when being started ?(looking at OSGI-INF/agentProvider.xml and DefaultAgentProvider.java ) 
Then, using a service tracker 
ServiceTracker srvTrackerAgent = new ServiceTracker(ctxBundle, IProvisioningAgent.class.getName(), null);
IProvisioningAgent agent = (IProvisioningAgent) srvTrackerAgent.waitForService(60 * 1000);

Or declarative services, you should access the agent.

Regards,
Anthony

De : p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] De la part de Samuel Wu
Envoyà : 29 mai 2011 21:46
à : P2 developer discussions
Objet : Re: [p2-dev] How to turn of the security warning during afeature installation

Can you please provide some more details, Pascal, on how to register the provisioningAgent? Thanks a lot.

Best Regards

Samuel Wu


Pascal Rapicault ---05/29/2011 09:32:22 PM---You need to have a bundle that registers the service against the provisioningAgent before the p2 UI

From:

Pascal Rapicault <pascal@xxxxxxxxxxxx>

To:

P2 developer discussions <p2-dev@xxxxxxxxxxx>

Date:

05/29/2011 09:32 PM

Subject:

Re: [p2-dev] How to turn of the security warning during a feature installation

Sent by:

p2-dev-bounces@xxxxxxxxxxx


Le contenu de ce courriel s'adresse au destinataire seulement. Il contient de l'information pouvant Ãtre confidentielle. Vous ne devez ni le copier ni l'utiliser ni le divulguer à qui que ce soit à moins que vous soyez le destinataire ou une personne dÃsignÃe autorisÃe. Si vous le receviez par erreur, veuillez nous aviser immÃdiatement et le dÃtruire.

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.





You need to have a bundle that registers the service against the provisioningAgent before the p2 UI gets called.

On 2011-05-27, at 9:07 AM, Samuel Wu wrote:
Thank you, Eugen, for the suggestion. But I'm running the update through UI. Wonder how to override UIService in this situation.

Best Regards

Samuel Wu


<graycol.gif>Eugen Reiswich ---05/27/2011 08:46:25 AM---Hi Samuel, I had the same problem while invoking the update operation programmatically. To overcome
<ecblank.gif>
From:
<ecblank.gif>
Eugen Reiswich <ereiswich@xxxxxxxxxxxxxx>
<ecblank.gif>
To:
<ecblank.gif>
P2 developer discussions <p2-dev@xxxxxxxxxxx>
<ecblank.gif>
Date:
<ecblank.gif>
05/27/2011 08:46 AM
<ecblank.gif>
Subject:
<ecblank.gif>
Re: [p2-dev] How to turn of the security warning during a feature installation
<ecblank.gif>
Sent by:
<ecblank.gif>
p2-dev-bounces@xxxxxxxxxxx
________________________________________



Hi Samuel, 

I had the same problem while invoking the update operation programmatically. To overcome this issue the P2 community suggested to override UIService within the ProvisioningAgent: 

/**
* This service forces P2 not to open a validation dialog ("...you're installing
* untrusted content..."). Otherwise the dialog will block headless RCP
* applications during install/update operations.
* 
* @author e.reiswich
* @date 2011-02-14
* 
*/
public class ValidationDialogService extends UIServices {

private final Logger LOGGER = Logger
.getLogger(ValidationDialogService.class.getName());

@Override
public AuthenticationInfo getUsernamePassword(String location) {
// nothing yet
return null;
}

@Override
public AuthenticationInfo getUsernamePassword(String location,
AuthenticationInfo previousInfo) {
// nothing yet
return null;
}

@Override
public TrustInfo getTrustInfo(Certificate[][] untrustedChain,
String[] unsignedDetail) {
LOGGER.info("TrustedInfo overridden");
boolean trustUnsigned = true;
boolean persistTrust = true;

Certificate[] trusted = new Certificate[0];
TrustInfo trustInfo = new TrustInfo(trusted, trustUnsigned,
persistTrust);
return trustInfo;
}

/**
* This method will override the default UIServices instance within the
* provisioning agent. This will prevent the blocking "...you're installing
* untrusted content..." dialog to appear.
* 
* @param agent
* The P2 provisioning agent.
*/
public void bindProvisioningAgent(IProvisioningAgent agent) {
LOGGER.info("ValidationDialogService: UIServices overridden");
agent.registerService(UIServices.SERVICE_NAME, this);
}

}

The IProvisioningAgent instance is retrieved using DS.

Eugen

Am 27.05.2011 um 14:35 schrieb Samuel Wu: 
Hello there,
When install a feature, we got the following security warning since we didn't sign the feature we built. It's quite annoying. Is there a way to turn it off? Thanks.
<23497438.gif>

Best Regards

Samuel Wu 
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev