On Wed, Jun 13, 2012 at 3:25 PM, <[email protected]> wrote:

> Author: subash
> Date: Wed Jun 13 05:55:04 2012
> New Revision: 129911
> URL: http://wso2.org/svn/browse/wso2?view=rev&revision=129911
>
> Log:
> Removing hard coded usernames,passwords and included in as parameters
>
> Modified:
>
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/registry/WSRegistryServiceClient.java
>
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/ws-test/org/wso2/carbon/registry/ws/client/test/security/SecurityTestSetup.java
>
> Modified:
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/registry/WSRegistryServiceClient.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/registry/WSRegistryServiceClient.java?rev=129911&r1=129910&r2=129911&view=diff
>
> ==============================================================================
> ---
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/registry/WSRegistryServiceClient.java
> (original)
> +++
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/java/org/wso2/carbon/registry/ws/client/registry/WSRegistryServiceClient.java
> Wed Jun 13 05:55:04 2012
> @@ -30,6 +30,7 @@
>  import org.apache.rampart.RampartMessageData;
>  import org.apache.rampart.policy.model.CryptoConfig;
>  import org.apache.rampart.policy.model.RampartConfig;
> +import org.apache.ws.security.components.crypto.Merlin;
>  import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub;
>  import org.wso2.carbon.core.common.AuthenticationException;
>  import org.wso2.carbon.registry.core.*;
> @@ -158,7 +159,7 @@
>                return PolicyEngine.getPolicy(builder.getDocumentElement());
>        }
>
> -       public void addSecurityOptions ( String policyPath, String
> keyStore) throws AxisFault, FileNotFoundException, XMLStreamException {
> +       public void addSecurityOptions ( String policyPath, String
> keyStore,String username,String password) throws AxisFault,
> FileNotFoundException, XMLStreamException {
>                ServiceClient client = stub._getServiceClient();
>
>                Policy policy = loadPolicy(policyPath);
> @@ -171,17 +172,17 @@
>
>  merlinProp.put("org.apache.ws.security.crypto.merlin.keystore.password",
> "wso2carbon");
>
>                CryptoConfig sigCryptoConfig = new CryptoConfig();
> -
> sigCryptoConfig.setProvider("org.apache.ws.security.components.crypto.Merlin");
> +               sigCryptoConfig.setProvider(Merlin.class.getName());
>                sigCryptoConfig.setProp(merlinProp);
>
>                CryptoConfig encCryptoConfig = new CryptoConfig();
> -
> encCryptoConfig.setProvider("org.apache.ws.security.components.crypto.Merlin");
> +               encCryptoConfig.setProvider(Merlin.class.getName());
>                encCryptoConfig.setProp(merlinProp);
>
>                RampartConfig rampartConfig = new RampartConfig();
>                rampartConfig.setEncryptionUser("wso2carbon");
>                rampartConfig.setUserCertAlias("wso2carbon");
> -
> rampartConfig.setPwCbClass("org.wso2.carbon.registry.ws.client.registry.PWCBHandler");
> +               rampartConfig.setPwCbClass(PWCBHandler.class.getName());
>                rampartConfig.setSigCryptoConfig(sigCryptoConfig);
>                rampartConfig.setEncrCryptoConfig(encCryptoConfig);
>
> @@ -189,8 +190,8 @@
>
>                Options options = client.getOptions();
>                options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
> policy);
> -               options.setUserName("admin");
> -               options.setPassword("admin");
> +               options.setUserName(username);
> +               options.setPassword(password);
>
>                client.engageModule("rampart");
>        }
>
> Modified:
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/ws-test/org/wso2/carbon/registry/ws/client/test/security/SecurityTestSetup.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/ws-test/org/wso2/carbon/registry/ws/client/test/security/SecurityTestSetup.java?rev=129911&r1=129910&r2=129911&view=diff
>
> ==============================================================================
> ---
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/ws-test/org/wso2/carbon/registry/ws/client/test/security/SecurityTestSetup.java
>       (original)
> +++
> carbon/platform/trunk/components/registry/org.wso2.carbon.registry.ws.client/src/main/ws-test/org/wso2/carbon/registry/ws/client/test/security/SecurityTestSetup.java
>       Wed Jun 13 05:55:04 2012
> @@ -64,7 +64,7 @@
>             configContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Repo,
> axis2Conf);
>             authenticate(configContext, serverURL);
>             registry = new WSRegistryServiceClient(serverURL, "admin",
> "admin", configContext);
> -            registry.addSecurityOptions(policyPath, CARBON_HOME +
> "/resources/security/wso2carbon.jks");
> +            registry.addSecurityOptions(policyPath, CARBON_HOME +
> "/resources/security/wso2carbon.jks",username,password);
>
>         } catch (Exception e) {
>             e.printStackTrace();
> _________________________________


Hi Subash ,

Did you run the integration tests before this commit, I'm getting following
compilation failure in integration tests.
Please fix this ASAP and follow the process.

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
(default-testCompile) on project registry-integration-test: Compilation
failure: Compilation failure:
[ERROR]
/home/ajith/wso2/builds/trunk/platform/trunk/products/greg/modules/integration/registry/tests/src/test/java/org/wso2/carbon/registry/ws/client/test/general/TestSetup.java:[63,52]
addSecurityOptions(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
in org.wso2.carbon.registry.ws.client.registry.WSRegistryServiceClient
cannot be applied to (java.lang.String,java.lang.String)
[ERROR]
/home/ajith/wso2/builds/trunk/platform/trunk/products/greg/modules/integration/registry/tests/src/test/java/org/wso2/carbon/registry/ws/client/test/general/UserSecurityWSTestCase.java:[57,60]
addSecurityOptions(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
in org.wso2.carbon.registry.ws.client.registry.WSRegistryServiceClient
cannot be applied to (java.lang.String,java.lang.String)
[ERROR] -> [Help 1]

Thanks
Ajith




> ______________
> Commits mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/commits
>



-- 
Ajith Vitharana.
WSO2 Inc. - http://wso2.org
Email  :  [email protected]
Mobile : +94714631794
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to