Re: [Dev] [UUF] How to do i18n with UUF?

2016-11-04 Thread Sumedha Rubasinghe
Guys,
We need to support both (browser locale and system language settings) going
forward. For UUF it's just a parameter value we accept. So it's just a
matter of from where we read it and set the value.

On Thu, Nov 3, 2016 at 8:57 PM, Udara Rathnayake  wrote:

>
>
> On Thu, Nov 3, 2016 at 7:14 PM, Thusitha Kalugamage 
> wrote:
>
>> Hi Ruwan,
>>
>> I think it is decided by the Browser locale,
>> Not sure about it's implementation.
>> @Udara?
>>
> ​You are correct Thusitha. We are using the HTTP Accept-Language header​
>
> ​and the maximum quality value to determine the locale of the user.​
>
>>
>> Regards,
>>
>> On Thu, Nov 3, 2016 at 6:55 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi Thusitha,
>>> Thank you. It works!
>>>
>>> What triggers change of the language bundle? is it a system property or
>>> the browser locale?
>>>
>>> Cheers,
>>> Ruwan
>>>
>>>
>>> On Thu, Nov 3, 2016 at 6:20 PM, Thusitha Kalugamage 
>>> wrote:
>>>
 Hi Ruwan,

 You can refer the sample that is with carbon-uuf [1]
 Inside [2] you'll find file called en_US.properties. This is the
 property file which you can use to store keys and values of keywords or
 messages which written in English.
 You can put key values pairs as below.

 :
 *Ex:- pets-store.all=See all our amazing pets*

 When you need to refer these values inside a .hbs you can use the
 following handlebar helper.

 *{{t ""}}*
 *Ex:-  {{t "pets-store.all”}}*


 [1] https://github.com/wso2/carbon-uuf/tree/master/samples
 
 [2] https://github.com/wso2/carbon-uuf/blob/master/samples/a
 pps/org.wso2.carbon.uuf.sample.pets-store/src/main/lang/en_U
 S.properties
 

 Hope this helps.
 Regards,

 On Thu, Nov 3, 2016 at 5:47 PM, Ruwan Abeykoon  wrote:

> Hi Devs,
> What is the recommended way for $subject
>
> Cheers,
> Ruwan
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Thusitha Kalugamage
 *Software Engineer*
 Mobile : +94 (0) 774 074370
 Tel   : +94 (0) 112 145 345
 thusi...@wso2.com

>>>
>>>
>>>
>>> --
>>>
>>> *Ruwan Abeykoon*
>>> *Associate Director/Architect**,*
>>> *WSO2, Inc. http://wso2.com  *
>>> *lean.enterprise.middleware.*
>>>
>>>
>>
>>
>> --
>> Thusitha Kalugamage
>> *Software Engineer*
>> Mobile : +94 (0) 774 074370
>> Tel   : +94 (0) 112 145 345
>> thusi...@wso2.com
>>
>
>
>
> --
> Regards,
> UdaraR
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
/sumedha
m: +94 773017743
b :  bit.ly/sumedha
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] WSO2 Carbon Unified UI Framework 1.0.0-M7 Released!

2016-11-04 Thread SajithAR Ariyarathna
Hi All,

We are pleased to announce the seventh milestone of WSO2 Carbon Unified UI
Framework (UUF). You can download the UUF server distribution at [1].

*Changes list (compared with 1.0.0-m6 version):*


   - Following JS functions are added.
  - module("module-name")
 - Loads the JS file '/modules/module-name.js' in your Component
 into your calling JS. This should be only used outside of the
 onRequest function to avoid loading the module JS over and over
 again.
  - sendToClient("clientSideName", obj)
 - Safely sends the variable obj as a JSON to the client-side and
 you can access it with clientSideName name.
  - Log.info(obj), Log.debug(obj), Log.trace(obj), Log.warn(obj), and
  Log.error(obj)
 - Logs the given object.
  - Following JS function have been removed.
  - 'setAppTheme' and 'getAppTheme'
   - Following Handlebars helpers are added,
  - {{t "key.to.msg.string"}}
 - Gives the i18n functionality
  - Following Handlebars variables have been renamed.
  - '@app.context' --> @contextPath
  - '@app.config' --> @config
   - Now UUF can,
  - Reload edited files on-the-fly when the *deveoper mode* is enabled.
  To enable the dev mode, start the Carbon server with -Ddevmode flag.
  - Deploy zip artifacts (Apps).
  - Handle POST request along with file uploading.
  - Render plain HTML files (in Pages for Fragments) with
  'uuf-renderablecreator-html' plugin.
   - Optimized static file serving.
   - Bug fixes.
   - More samples.


*Found an issue?* Help us to improve. Use our GitHub issues page at [2] to
report it to us.

[1]
https://github.com/wso2/carbon-uuf/releases/download/v1.0.0-m7/wso2uuf-1.0.0-m7.zip
[2] https://github.com/wso2/carbon-uuf/issues

*-- WSO2 Platform Team--*

Thanks.
-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] How to do i18n with UUF?

2016-11-04 Thread Ruwan Abeykoon
Hi Thushtha,
How can we localize the texts in "menu" defined in "config.yaml"?

Cheers,
Ruwan

On Thu, Nov 3, 2016 at 8:57 PM, Udara Rathnayake  wrote:

>
>
> On Thu, Nov 3, 2016 at 7:14 PM, Thusitha Kalugamage 
> wrote:
>
>> Hi Ruwan,
>>
>> I think it is decided by the Browser locale,
>> Not sure about it's implementation.
>> @Udara?
>>
> ​You are correct Thusitha. We are using the HTTP Accept-Language header​
>
> ​and the maximum quality value to determine the locale of the user.​
>
>>
>> Regards,
>>
>> On Thu, Nov 3, 2016 at 6:55 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi Thusitha,
>>> Thank you. It works!
>>>
>>> What triggers change of the language bundle? is it a system property or
>>> the browser locale?
>>>
>>> Cheers,
>>> Ruwan
>>>
>>>
>>> On Thu, Nov 3, 2016 at 6:20 PM, Thusitha Kalugamage 
>>> wrote:
>>>
 Hi Ruwan,

 You can refer the sample that is with carbon-uuf [1]
 Inside [2] you'll find file called en_US.properties. This is the
 property file which you can use to store keys and values of keywords or
 messages which written in English.
 You can put key values pairs as below.

 :
 *Ex:- pets-store.all=See all our amazing pets*

 When you need to refer these values inside a .hbs you can use the
 following handlebar helper.

 *{{t ""}}*
 *Ex:-  {{t "pets-store.all”}}*


 [1] https://github.com/wso2/carbon-uuf/tree/master/samples
 
 [2] https://github.com/wso2/carbon-uuf/blob/master/samples/a
 pps/org.wso2.carbon.uuf.sample.pets-store/src/main/lang/en_U
 S.properties
 

 Hope this helps.
 Regards,

 On Thu, Nov 3, 2016 at 5:47 PM, Ruwan Abeykoon  wrote:

> Hi Devs,
> What is the recommended way for $subject
>
> Cheers,
> Ruwan
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Thusitha Kalugamage
 *Software Engineer*
 Mobile : +94 (0) 774 074370
 Tel   : +94 (0) 112 145 345
 thusi...@wso2.com

>>>
>>>
>>>
>>> --
>>>
>>> *Ruwan Abeykoon*
>>> *Associate Director/Architect**,*
>>> *WSO2, Inc. http://wso2.com  *
>>> *lean.enterprise.middleware.*
>>>
>>>
>>
>>
>> --
>> Thusitha Kalugamage
>> *Software Engineer*
>> Mobile : +94 (0) 774 074370
>> Tel   : +94 (0) 112 145 345
>> thusi...@wso2.com
>>
>
>
>
> --
> Regards,
> UdaraR
>



-- 

*Ruwan Abeykoon*
*Associate Director/Architect**,*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CAS connector doesnt work with federated authenticators.

2016-11-04 Thread Kanapriya Kuleswararajan
Hi,

Yes, I have set the relying party in authentication request and now works
fine with federated authentication.
Please find the updated version [1] in the store.

[1] https://store.wso2.com/store/assets/isconnector/list?q=%22_
default%22%3A%22cas%20inbound%22


Thanks

Kanapriya Kuleswararajan
Associate Software Engineer
Mobile : - 0774894438
Mail : - kanapr...@wso2.com

On Wed, Nov 2, 2016 at 12:52 PM, Harsha Thirimanna  wrote:

> Hi Kanapriya,
>
> As explained in online, you have to set the relying party to the
> authentication request. Basically, you have to test the CAS with federation
> story that is available OOB, these are not a specific new scenario.
>
> *Harsha Thirimanna*
> Associate Tech Lead | WSO2
>
> Email: hars...@wso2.com
> Mob: +94715186770
> Blog: http://harshathirimanna.blogspot.com/
> Twitter: http://twitter.com/harshathirimann
> Linked-In: linked-in: http://www.linkedin.com/pub/ha
> rsha-thirimanna/10/ab8/122
> 
>
> On Wed, Nov 2, 2016 at 12:16 PM, Malaka Silva  wrote:
>
>> Hi Kanapriya,
>>
>> As we discussed can you further test the reason why federated
>> authenticators
>> ​ are not supported.​
>>
>> On Wed, Nov 2, 2016 at 10:38 AM, Malaka Silva  wrote:
>>
>>> We can prioritize those use cases on demand.
>>>
>>> On Wed, Nov 2, 2016 at 10:32 AM, Kanapriya Kuleswararajan <
>>> kanapr...@wso2.com> wrote:
>>>
 Hi Harsha / Hasintha

 Basic authentication supports with the initial version of
 cas-inbound-authenticator. In next version of cas-inbound-authenticator, we
 can add federated support in future  and while validating the tickets , we
 used /serviceValidate , not /samlValidate.

 As Kathees mentioned, there are other protocols (OpenID,OAuth and SAML)
 supports with CAS, but we didn't include that features in initial version
 of cas-inbound-authenticator.

 Thanks

 Kanapriya Kuleswararajan
 Associate Software Engineer
 Mobile : - 0774894438
 Mail : - kanapr...@wso2.com

 On Wed, Nov 2, 2016 at 6:21 AM, Harsha Thirimanna 
 wrote:

> Hi Kanapriya,
>
> What Hasitha was asking about an issue with current implementation ,
> right ? I am not clear whether it is the problem here,
> Hasitha , you gor solved the issue ?
>
> On Nov 1, 2016 11:57 PM, "Kathees Rajendram"  wrote:
>
>> SAML-Protocol support is another feature in CAS. Please find few more
>> resources for other protocols (OpenID,OAuth and SAML) supports as
>> extensions in CAS protocol.
>>
>> https://apereo.github.io/cas/4.2.x/protocol/CAS-Protocol.html
>> https://apereo.github.io/cas/4.2.x/protocol/SAML-Protocol.html
>>
>> Thanks,
>> Kathees
>>
>> On Tue, Nov 1, 2016 at 9:33 PM, Hasintha Indrajee 
>> wrote:
>>
>>> If this is the case then we should fix this in the sample cas client
>>> webapp.
>>>
>>> On Tue, Nov 1, 2016 at 9:28 PM, Harsha Thirimanna 
>>> wrote:
>>>
 So in your case, I feel like there should be missing the
 relyingParty value to pick the correct service provider to get the
 configured authentication options.

 *Harsha Thirimanna*
 Associate Tech Lead | WSO2

 Email: hars...@wso2.com
 Mob: +94715186770
 Blog: http://harshathirimanna.blogspot.com/
 Twitter: http://twitter.com/harshathirimann
 Linked-In: linked-in: http://www.linkedin.com/pub/ha
 rsha-thirimanna/10/ab8/122
 

 On Tue, Nov 1, 2016 at 9:15 PM, Hasintha Indrajee <
 hasin...@wso2.com> wrote:

> Hi Harsha,
>
> Following are the resources you can get information about CAS
> (Provided by Kanapriya)
>
> https://docs.wso2.com/display/ISCONNECTORS/CAS+Inbound+Authe
> nticator
> https://github.com/wso2-extensions/identity-inbound-auth-cas
> /pull/2
> https://github.com/apereo/cas/blob/master/docs/cas-server-do
> cumentation/protocol/CAS-Protocol-Specification.md
> https://github.com/UniconLabs/cas-sample-java-webapp
> https://wiki.jasig.org/display/CASC/Configuring+the+Jasig+CA
> S+Client+for+Java+in+the+web.xml
>
> On Tue, Nov 1, 2016 at 7:56 PM, Harsha Thirimanna <
> hars...@wso2.com> wrote:
>
>> Hi Hasintha,
>>
>> Did you get any documentation for this to know the request and
>> configuration details with CAS ?
>>
>> *Harsha Thirimanna*
>> Associate Tech Lead | WSO2
>>
>> Email: hars...@wso2.com
>> Mob: +94715186770
>> Blog: http://harshathirimanna.blogspot.com/
>> Twitter: http://twitter.com/harshathirimann

Re: [Dev] [IS][Registry] Usage of modules/carbon/scripts/registry/artifacts.js in Identity Server

2016-11-04 Thread Abimaran Kugathasan
This issue can be resolved by downgrading registry related version to
org.wso2.carbon.governance.api_4.7.1 below 4.6.0 and the range to [4.4.0,
5.0.0). But, downgrading a library might break some functionality, So I
followed the earlier approach in the above mail.


This issue won't occur if all the bundles follow providing version range
like [current major version, next major version)

On Fri, Nov 4, 2016 at 2:48 PM, Abimaran Kugathasan 
wrote:

> Hi All,
>
> I was able to fix the issue. The root cause of the issue is following.
>
> While installing Key Manager feature, org.wso2.carbon.governance.api_4.7.1
> was installed as transitive bundle of org.wso2.carbon.apimgt.impl_6.0.4.jar
> bundle.
>
> org.wso2.carbon.governance.api_4.7.1 require
> org.wso2.carbon.registry.indexing.service_4.6.0, and it has version range
> of [4.6.0, 5.0.0) for registry related bundles, but Identity Server 5.2.0
> has org.wso2.carbon.registry.indexing.service_4.5.4.
>
> And org.wso2.carbon.apimgt.impl_6.0.4 uses [4.4.0, 4.6.0) range for
> registry related bundles. So, I have to increase this version to accomadate
> org.wso2.carbon.registry.indexing.service_4.6.0 like [4.4.0, 4.7.0). Have
> to copy org.wso2.carbon.registry.indexing.service_4.6.0.jar and add this
> to bundle.info was resolved the issue.
>
> On Wed, Nov 2, 2016 at 3:36 PM, Harsha Thirimanna 
> wrote:
>
>> Hi All,
>>
>> This is kind of not packaging relevant bundle with the KM features to the
>> IS i think. DineshW is investigating this.
>>
>> *Harsha Thirimanna*
>> Associate Tech Lead | WSO2
>>
>> Email: hars...@wso2.com
>> Mob: +94715186770
>> Blog: http://harshathirimanna.blogspot.com/
>> Twitter: http://twitter.com/harshathirimann
>> Linked-In: linked-in: http://www.linkedin.com/pub/ha
>> rsha-thirimanna/10/ab8/122
>> 
>>
>> On Wed, Nov 2, 2016 at 3:02 PM, Ayesha Dissanayaka 
>> wrote:
>>
>>> Hi Abimaran,
>>>
>>> If this helps, wso2is-5.2.0/modules/carbon/  module comes from a
>>> jaggery-extension , carbon [1].
>>>
>>> This dependency in product-is can be found at [2].
>>>
>>> [1] https://github.com/wso2/jaggery-extensions/tree/release-1.5.3/carbon
>>> [2] https://github.com/wso2/product-is/blob/release-5.2.0/module
>>> s/p2-profile-gen/pom.xml#L1287
>>>
>>> Thanks!
>>> -Ayesha
>>>
>>>
>>> On Mon, Oct 31, 2016 at 3:34 PM, Abimaran Kugathasan 
>>> wrote:
>>>
 Hi,

 The reason for asking this, in Identity Server 5.2.0, after installing
 Key Manager feature, dashboard doesn't work. Through Key Manager feature,
 following bundles are installed

 om.google.gson_2.2.4.jar,
 maven-scm_1.7.0.wso2v2.jar,
 org.apache.velocity_1.7.0.jar,
 org.wso2.carbon.apimgt.api_6.0.4.jar,
 org.wso2.carbon.apimgt.gateway.stub_6.0.4.jar,
 org.wso2.carbon.apimgt.handlers.security.stub_6.0.4.jar,
 org.wso2.carbon.apimgt.impl_6.0.4.jar,
 org.wso2.carbon.apimgt.keymgt_6.0.4.jar,
 org.wso2.carbon.apimgt.keymgt.client_6.0.4.jar,
 org.wso2.carbon.apimgt.keymgt.stub_6.0.4.jar,
 org.wso2.carbon.apimgt.statsupdate.stub_6.0.4.jar,
 org.wso2.carbon.apimgt.tier.cache.stub_6.0.4.jar,
 org.wso2.carbon.event.processor.stub_2.1.4.jar,
 org.wso2.carbon.governance.api_4.7.1.jar,
 org.wso2.carbon.identity.user.registration.stub_5.2.0.jar,
 org.wso2.carbon.registry.extensions_4.6.0.jar,
 pdfbox_1.8.10.wso2v2.jar,
 wso2-uri-templates_1.6.5.jar

 When I diagnose each bundle, I can see following error for
 org.wso2.carbon.governance.api_4.7.1 bundle

 osgi> diag 272
 reference:file:../plugins/org.wso2.carbon.governance.api_4.7.1.jar
 [272]
   Direct constraints which are unresolved:
 Missing optionally imported package org.wso2.carbon.registry.index
 ing.service_4.6.0.

 Since artifacts.js is accessing registry content, I suspect, this
 could be an issue with not satisfying above constraint, but it was marked
 as optional.

 Please put some shades on.



 On Thu, Oct 27, 2016 at 5:05 PM, Abimaran Kugathasan  wrote:

> Any hint on this?
>
> On Thu, Oct 27, 2016 at 10:12 AM, Abimaran Kugathasan <
> abima...@wso2.com> wrote:
>
>> Hi IS/Registry Teams,
>>
>>
>> I want to know the usage of 
>> wso2is-5.2.0/modules/carbon/scripts/registry/artifacts.js
>> script?
>>
>> It was referred through wso2is-5.2.0/modules/carbon/scripts/module.xml
>> and wso2is-5.2.0/modules/carbon/module.xml files.
>>
>> I guess, Identity Server doesn't use any registry related
>> functionalities and this was shipped by some carbon kernel features. 
>> Please
>> confirm.
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>> Senior Software Engineer - API Technologies
>>
>> Email : abima...@wso2.com
>> Mobile : +94 773922820
>>

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Bhathiya Jayasekara
In your publisher node, does api-manager.xml has 'localhost' for gateway
url? If yes, please attach the api-manager.xml of publisher.

Thanks,
Bhathiya

On Fri, Nov 4, 2016 at 3:01 PM, Susinda Perera  wrote:

> I'm using localhost, as it gives me this error 'SSL peer failed hostname
> validation for name: 127.0.0.1', I created a keystore with 127.0.0.1 and
> tried and it worked. Have to check at which place it resolves localhost to
> 127.0.0.1.
>
> On Fri, Nov 4, 2016 at 2:27 PM, Bhathiya Jayasekara 
> wrote:
>
>>
>> On Fri, Nov 4, 2016 at 2:24 PM, Susinda Perera  wrote:
>>
>>> -Dorg.wso2.ignoreHostnameVerification=true
>>> This property is already in the wso2server.sh file, I.e having this did
>>> not helped me.
>>>
>>> On Fri, Nov 4, 2016 at 2:11 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Susinda,

 If you want to use IP instead of hostname, you have to create a cert
 for that IP. For CN validation, hostname and IP mapping is not used.

>>> I don't want to use the IP. but I tried that as a workaround only, just
>>> check if that works
>>>
>>
>> What I meant was why do you want to use IP to call the service? Why can't
>> you simply use 'localhost'?
>>
>> Thanks,
>> Bhathiya
>>
>>
>>>
 On a related note, using IPs for CN is not recommended in general.

 Thanks,
 Bhathiya

 On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera 
 wrote:

> Got this fixed by using a new keystore where primary key's CN is set
> to 127.0.0.1 and importing the public key of the same to
> client-truststore.jks.
> But i believe this is not the proper fix, as wso2carbon.jks already
> have the cert for localhost and we do not want to create another cert for
> 127.0.0.1.
> Any idea?
> Similar issues found in
> https://wso2.org/jira/browse/APIMANAGER-4205
> https://wso2.org/jira/browse/APIMANAGER-4626
>
> Thanks
> Susinda
>
> On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera 
> wrote:
>
>> Hi All
>> I'm getting this[1] $subject. Have anyone faced the same, what was
>> the resolution?
>>
>>
>> ERROR - APIGatewayManager Error occurred when publish to gateway
>> Production and Sandbox
>> org.apache.axis2.AxisFault: Error while contacting the authentication
>> admin services
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.login(AbstractAPIGatewayAdminClient.java:92)
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.setup(AbstractAPIGatewayAdminClient.java:50)
>> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.> t>(APIGatewayAdminClient.java:37)
>> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
>> ay(APIGatewayManager.java:86)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
>> (APIProviderImpl.java:1485)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
>> tusChangeToGateways(APIProviderImpl.java:1294)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
>> PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
>> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
>> IExecutor.java:136)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.invoke(DefaultLifeCycle.java:450)
>> at org.wso2.carbon.governance.registry.eventing.handlers.Govern
>> anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
>> nvokeAspect(HandlerManager.java:2792)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
>> Manager.invokeAspect(HandlerLifecycleManager.java:518)
>> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
>> pect(EmbeddedRegistry.java:2591)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
>> vokeAspect(CacheBackedRegistry.java:510)
>> at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
>> ect(UserRegistry.java:1952)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
>> tatus(APIProviderImpl.java:3644)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
>> ycleStatus(UserAwareAPIProvider.java:148)
>> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
>> 

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Susinda Perera
I'm using localhost, as it gives me this error 'SSL peer failed hostname
validation for name: 127.0.0.1', I created a keystore with 127.0.0.1 and
tried and it worked. Have to check at which place it resolves localhost to
127.0.0.1.

On Fri, Nov 4, 2016 at 2:27 PM, Bhathiya Jayasekara 
wrote:

>
> On Fri, Nov 4, 2016 at 2:24 PM, Susinda Perera  wrote:
>
>> -Dorg.wso2.ignoreHostnameVerification=true
>> This property is already in the wso2server.sh file, I.e having this did
>> not helped me.
>>
>> On Fri, Nov 4, 2016 at 2:11 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Susinda,
>>>
>>> If you want to use IP instead of hostname, you have to create a cert for
>>> that IP. For CN validation, hostname and IP mapping is not used.
>>>
>> I don't want to use the IP. but I tried that as a workaround only, just
>> check if that works
>>
>
> What I meant was why do you want to use IP to call the service? Why can't
> you simply use 'localhost'?
>
> Thanks,
> Bhathiya
>
>
>>
>>> On a related note, using IPs for CN is not recommended in general.
>>>
>>> Thanks,
>>> Bhathiya
>>>
>>> On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera  wrote:
>>>
 Got this fixed by using a new keystore where primary key's CN is set to
 127.0.0.1 and importing the public key of the same to 
 client-truststore.jks.
 But i believe this is not the proper fix, as wso2carbon.jks already
 have the cert for localhost and we do not want to create another cert for
 127.0.0.1.
 Any idea?
 Similar issues found in
 https://wso2.org/jira/browse/APIMANAGER-4205
 https://wso2.org/jira/browse/APIMANAGER-4626

 Thanks
 Susinda

 On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera 
 wrote:

> Hi All
> I'm getting this[1] $subject. Have anyone faced the same, what was the
> resolution?
>
>
> ERROR - APIGatewayManager Error occurred when publish to gateway
> Production and Sandbox
> org.apache.axis2.AxisFault: Error while contacting the authentication
> admin services
> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
> ent.login(AbstractAPIGatewayAdminClient.java:92)
> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
> ent.setup(AbstractAPIGatewayAdminClient.java:50)
> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient. t>(APIGatewayAdminClient.java:37)
> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
> ay(APIGatewayManager.java:86)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
> (APIProviderImpl.java:1485)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
> tusChangeToGateways(APIProviderImpl.java:1294)
> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
> PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
> IExecutor.java:136)
> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
> ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
> ltLifeCycle.invoke(DefaultLifeCycle.java:450)
> at org.wso2.carbon.governance.registry.eventing.handlers.Govern
> anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
> nvokeAspect(HandlerManager.java:2792)
> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
> Manager.invokeAspect(HandlerLifecycleManager.java:518)
> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
> pect(EmbeddedRegistry.java:2591)
> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
> vokeAspect(CacheBackedRegistry.java:510)
> at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
> ect(UserRegistry.java:1952)
> at org.wso2.carbon.governance.api.common.dataobjects.Governance
> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
> at org.wso2.carbon.governance.api.common.dataobjects.Governance
> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
> tatus(APIProviderImpl.java:3644)
> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
> ycleStatus(UserAwareAPIProvider.java:148)
> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
> eImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChange
> LifecyclePost(ApisApi.java:91)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:62)
> at 

Re: [Dev] [IS][Registry] Usage of modules/carbon/scripts/registry/artifacts.js in Identity Server

2016-11-04 Thread Abimaran Kugathasan
Hi All,

I was able to fix the issue. The root cause of the issue is following.

While installing Key Manager feature, org.wso2.carbon.governance.api_4.7.1
was installed as transitive bundle of org.wso2.carbon.apimgt.impl_6.0.4.jar
bundle.

org.wso2.carbon.governance.api_4.7.1 require
org.wso2.carbon.registry.indexing.service_4.6.0,
and it has version range of [4.6.0, 5.0.0) for registry related bundles,
but Identity Server 5.2.0 has org.wso2.carbon.registry.
indexing.service_4.5.4.

And org.wso2.carbon.apimgt.impl_6.0.4 uses [4.4.0, 4.6.0) range for
registry related bundles. So, I have to increase this version to accomadate
org.wso2.carbon.registry.indexing.service_4.6.0 like [4.4.0, 4.7.0). Have
to copy org.wso2.carbon.registry.indexing.service_4.6.0.jar and add this to
bundle.info was resolved the issue.

On Wed, Nov 2, 2016 at 3:36 PM, Harsha Thirimanna  wrote:

> Hi All,
>
> This is kind of not packaging relevant bundle with the KM features to the
> IS i think. DineshW is investigating this.
>
> *Harsha Thirimanna*
> Associate Tech Lead | WSO2
>
> Email: hars...@wso2.com
> Mob: +94715186770
> Blog: http://harshathirimanna.blogspot.com/
> Twitter: http://twitter.com/harshathirimann
> Linked-In: linked-in: http://www.linkedin.com/pub/
> harsha-thirimanna/10/ab8/122
> 
>
> On Wed, Nov 2, 2016 at 3:02 PM, Ayesha Dissanayaka 
> wrote:
>
>> Hi Abimaran,
>>
>> If this helps, wso2is-5.2.0/modules/carbon/  module comes from a
>> jaggery-extension , carbon [1].
>>
>> This dependency in product-is can be found at [2].
>>
>> [1] https://github.com/wso2/jaggery-extensions/tree/release-1.5.3/carbon
>> [2] https://github.com/wso2/product-is/blob/release-5.2.0/module
>> s/p2-profile-gen/pom.xml#L1287
>>
>> Thanks!
>> -Ayesha
>>
>>
>> On Mon, Oct 31, 2016 at 3:34 PM, Abimaran Kugathasan 
>> wrote:
>>
>>> Hi,
>>>
>>> The reason for asking this, in Identity Server 5.2.0, after installing
>>> Key Manager feature, dashboard doesn't work. Through Key Manager feature,
>>> following bundles are installed
>>>
>>> om.google.gson_2.2.4.jar,
>>> maven-scm_1.7.0.wso2v2.jar,
>>> org.apache.velocity_1.7.0.jar,
>>> org.wso2.carbon.apimgt.api_6.0.4.jar,
>>> org.wso2.carbon.apimgt.gateway.stub_6.0.4.jar,
>>> org.wso2.carbon.apimgt.handlers.security.stub_6.0.4.jar,
>>> org.wso2.carbon.apimgt.impl_6.0.4.jar,
>>> org.wso2.carbon.apimgt.keymgt_6.0.4.jar,
>>> org.wso2.carbon.apimgt.keymgt.client_6.0.4.jar,
>>> org.wso2.carbon.apimgt.keymgt.stub_6.0.4.jar,
>>> org.wso2.carbon.apimgt.statsupdate.stub_6.0.4.jar,
>>> org.wso2.carbon.apimgt.tier.cache.stub_6.0.4.jar,
>>> org.wso2.carbon.event.processor.stub_2.1.4.jar,
>>> org.wso2.carbon.governance.api_4.7.1.jar,
>>> org.wso2.carbon.identity.user.registration.stub_5.2.0.jar,
>>> org.wso2.carbon.registry.extensions_4.6.0.jar,
>>> pdfbox_1.8.10.wso2v2.jar,
>>> wso2-uri-templates_1.6.5.jar
>>>
>>> When I diagnose each bundle, I can see following error for
>>> org.wso2.carbon.governance.api_4.7.1 bundle
>>>
>>> osgi> diag 272
>>> reference:file:../plugins/org.wso2.carbon.governance.api_4.7.1.jar [272]
>>>   Direct constraints which are unresolved:
>>> Missing optionally imported package org.wso2.carbon.registry.index
>>> ing.service_4.6.0.
>>>
>>> Since artifacts.js is accessing registry content, I suspect, this could
>>> be an issue with not satisfying above constraint, but it was marked as
>>> optional.
>>>
>>> Please put some shades on.
>>>
>>>
>>>
>>> On Thu, Oct 27, 2016 at 5:05 PM, Abimaran Kugathasan 
>>> wrote:
>>>
 Any hint on this?

 On Thu, Oct 27, 2016 at 10:12 AM, Abimaran Kugathasan <
 abima...@wso2.com> wrote:

> Hi IS/Registry Teams,
>
>
> I want to know the usage of 
> wso2is-5.2.0/modules/carbon/scripts/registry/artifacts.js
> script?
>
> It was referred through wso2is-5.2.0/modules/carbon/scripts/module.xml
> and wso2is-5.2.0/modules/carbon/module.xml files.
>
> I guess, Identity Server doesn't use any registry related
> functionalities and this was shipped by some carbon kernel features. 
> Please
> confirm.
>
>
> --
> Thanks
> Abimaran Kugathasan
> Senior Software Engineer - API Technologies
>
> Email : abima...@wso2.com
> Mobile : +94 773922820
>
> 
> 
>   
> 
>
>


 --
 Thanks
 Abimaran Kugathasan
 Senior Software Engineer - API Technologies

 Email : abima...@wso2.com
 Mobile : +94 773922820

 
 
   
 


>>>
>>>
>>> --
>>> Thanks
>>> 

[Dev] Error while publishing apis to gateway

2016-11-04 Thread Susinda Perera
Hi All
I'm getting this[1] $subject. Have anyone faced the same, what was the
resolution?


ERROR - APIGatewayManager Error occurred when publish to gateway Production
and Sandbox
org.apache.axis2.AxisFault: Error while contacting the authentication admin
services
at
org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminClient.login(AbstractAPIGatewayAdminClient.java:92)
at
org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminClient.setup(AbstractAPIGatewayAdminClient.java:50)
at
org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.(APIGatewayAdminClient.java:37)
at
org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGateway(APIGatewayManager.java:86)
at
org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway(APIProviderImpl.java:1485)
at
org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPIStatusChangeToGateways(APIProviderImpl.java:1294)
at
org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateAPIStatusChangeToGateways(UserAwareAPIProvider.java:36)
at
org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(APIExecutor.java:136)
at
org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
at
org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle.invoke(DefaultLifeCycle.java:450)
at
org.wso2.carbon.governance.registry.eventing.handlers.GovernanceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
at
org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.invokeAspect(HandlerManager.java:2792)
at
org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.invokeAspect(HandlerLifecycleManager.java:518)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAspect(EmbeddedRegistry.java:2591)
at
org.wso2.carbon.registry.core.caching.CacheBackedRegistry.invokeAspect(CacheBackedRegistry.java:510)
at
org.wso2.carbon.registry.core.session.UserRegistry.invokeAspect(UserRegistry.java:1952)
at
org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
at
org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
at
org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleStatus(APIProviderImpl.java:3644)
at
org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeCycleStatus(UserAwareAPIProvider.java:148)
at
org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
at
org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChangeLifecyclePost(ApisApi.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at

Re: [Dev] Shall we change the convention for placement of DB Query String in Java Code.

2016-11-04 Thread Abimaran Kugathasan
Hi Ruwan,

We used to keep the queries withing the method up to API Manager 1.9.1 [1],
with vendor specific queries and the indentation of the queries took much
space. So we moved the queries to a separate constant class for each vendor
from API Manager 1.10 onwards [2]

So having vendor specific queries and having a proper indentation of the
queries within the method will increase the number of line of the class. I
understood, that having queries withing method is less error prone as we
can always check the placeholder of the query when setting the values.

Even some basic CURD operations differ in syntax among vendors [3]

[1] :
https://github.com/wso2/carbon-apimgt/blob/carbon-apimgt-v1.9.1/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java
[2] :
https://github.com/wso2/carbon-apimgt/blob/v6.0.4/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java
[3] :
https://github.com/wso2/carbon-apimgt/tree/v6.0.4/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/constants

On Fri, Nov 4, 2016 at 11:01 AM, Lahiru Cooray  wrote:

>
>
> On Thu, Nov 3, 2016 at 10:57 AM, Maduranga Siriwardena  > wrote:
>
>> Hi Ruwan,
>>
>> Having the SQL query in the method itself improves the readability.
>>
>> However in C4 usercore and C5 user store connector current
>> implementation, we have the SQL queries in a central place and load it to a
>> map at the time of the initialization of connector. With this approach one
>> of the advantages we have gained is we can load the SQL queries from a
>> config file (may be to support a new database type without changing the
>> code). How can we do this with the new approach?
>>
> Agreed with RuwanA. -1 for the current approach. Giving the control to
> modify the DML statements as a configuration is not a good practise unless
> if it's an extension point. Is there any reason why we are currently doing
> this?
>
>
>> And when there are different SQL queries for different database types,
>> readability of the method is worsen in my opinion.
>>
> If the query is an ANSI SQL statement, we could have it closer to the code
> and if not +1 to use a factory method separate the statements DB type wise.
>
>
>>
>> Thanks,
>> Maduranga.
>>
>> On Tue, Nov 1, 2016 at 12:46 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi Rajith,
>>> +1
>>>
>>> final String insertIdpSql
>>>
>>> On Tue, Nov 1, 2016 at 11:33 AM, Rajith Roshan  wrote:
>>>
 Hi Ruwan,

 Since the final variable is not static can we name it using camel case
 convention[1]. Otherwise check style plugin will give errors.

 [1] - final String insertIdpSql

 Thanks!
 Rajith

 On Fri, Oct 28, 2016 at 9:41 AM, Afkham Azeez  wrote:

> Query should be close to the code. +1 for Ruwan's proposal. Not only
> for queries, you should use your judgment when deciding where to place
> constants as well. In many cases, it makes sense to keep the constants in
> the relevant class where it is used but people have been blindly putting
> those into a Constants class.
>
> On Fri, Oct 28, 2016 at 8:04 AM, Sumedha Rubasinghe 
> wrote:
>
>> I am actually in favour of what Ruwan is suggesting.
>>
>> 1. When a problem comes we  usually start by looking at the
>> particular query. There is no need to look at all queries together.
>>
>> 2. Having the query close to rest of the jdbc code is easier.
>>
>> 3. Regardless of where it is, all queries should be formatted for
>> readability than putting it as a single liner string
>>
>> On Oct 28, 2016 7:27 AM, "Selvaratnam Uthaiyashankar" <
>> shan...@wso2.com> wrote:
>>
>>> Do we have any requirements to see all queries together? If so,
>>> defining in a single place would be easy. However, I am not sure 
>>> whether we
>>> have used that requirement ever. We normally look at the query local to 
>>> the
>>> method? If so, I am +1 for Ruwan's proposal. Being local constant to the
>>> method seems good.
>>>
>>> On Thu, Oct 27, 2016 at 9:42 PM, Sagara Gunathunga 
>>> wrote:
>>>

 Personally I don't have strong preference on one style over other,
 what mostly important for me is maintain one style consistently within 
 the
 product and if possible across the company.

 I'm adding few other people for their opinion.

 Thanks !

 On Thu, Oct 27, 2016 at 5:34 PM, Ruwan Abeykoon 
 wrote:

> Hi Devs,
> We have been following a convention to put Database query string
> in a constant elsewhere in the code when performing DB CRUD 
> operations.

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Bhathiya Jayasekara
On Fri, Nov 4, 2016 at 2:24 PM, Susinda Perera  wrote:

> -Dorg.wso2.ignoreHostnameVerification=true
> This property is already in the wso2server.sh file, I.e having this did
> not helped me.
>
> On Fri, Nov 4, 2016 at 2:11 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Susinda,
>>
>> If you want to use IP instead of hostname, you have to create a cert for
>> that IP. For CN validation, hostname and IP mapping is not used.
>>
> I don't want to use the IP. but I tried that as a workaround only, just
> check if that works
>

What I meant was why do you want to use IP to call the service? Why can't
you simply use 'localhost'?

Thanks,
Bhathiya


>
>> On a related note, using IPs for CN is not recommended in general.
>>
>> Thanks,
>> Bhathiya
>>
>> On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera  wrote:
>>
>>> Got this fixed by using a new keystore where primary key's CN is set to
>>> 127.0.0.1 and importing the public key of the same to client-truststore.jks.
>>> But i believe this is not the proper fix, as wso2carbon.jks already have
>>> the cert for localhost and we do not want to create another cert for
>>> 127.0.0.1.
>>> Any idea?
>>> Similar issues found in
>>> https://wso2.org/jira/browse/APIMANAGER-4205
>>> https://wso2.org/jira/browse/APIMANAGER-4626
>>>
>>> Thanks
>>> Susinda
>>>
>>> On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera 
>>> wrote:
>>>
 Hi All
 I'm getting this[1] $subject. Have anyone faced the same, what was the
 resolution?


 ERROR - APIGatewayManager Error occurred when publish to gateway
 Production and Sandbox
 org.apache.axis2.AxisFault: Error while contacting the authentication
 admin services
 at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
 ent.login(AbstractAPIGatewayAdminClient.java:92)
 at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
 ent.setup(AbstractAPIGatewayAdminClient.java:50)
 at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.>>> t>(APIGatewayAdminClient.java:37)
 at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
 ay(APIGatewayManager.java:86)
 at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
 (APIProviderImpl.java:1485)
 at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
 tusChangeToGateways(APIProviderImpl.java:1294)
 at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
 PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
 at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
 IExecutor.java:136)
 at org.wso2.carbon.governance.registry.extensions.aspects.Defau
 ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
 at org.wso2.carbon.governance.registry.extensions.aspects.Defau
 ltLifeCycle.invoke(DefaultLifeCycle.java:450)
 at org.wso2.carbon.governance.registry.eventing.handlers.Govern
 anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
 at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
 nvokeAspect(HandlerManager.java:2792)
 at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
 Manager.invokeAspect(HandlerLifecycleManager.java:518)
 at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
 pect(EmbeddedRegistry.java:2591)
 at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
 vokeAspect(CacheBackedRegistry.java:510)
 at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
 ect(UserRegistry.java:1952)
 at org.wso2.carbon.governance.api.common.dataobjects.Governance
 ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
 at org.wso2.carbon.governance.api.common.dataobjects.Governance
 ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
 at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
 tatus(APIProviderImpl.java:3644)
 at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
 ycleStatus(UserAwareAPIProvider.java:148)
 at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
 eImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
 at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChange
 LifecyclePost(ApisApi.java:91)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
 ssorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
 thodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at org.apache.cxf.service.invoker.AbstractInvoker.performInvoca
 tion(AbstractInvoker.java:180)
 at org.apache.cxf.service.invoker.AbstractInvoker.invoke(Abstra
 ctInvoker.java:96)
 at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
 at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)

Re: [Dev] [IS] C5 Support for filtering

2016-11-04 Thread Johann Nallathamby
We need to support simple filters, pagination and sorting from user-core
APIs. I don't think there is a defined list of complex filters; it is
endless. So we can't support it from user-core. So what we can do is we can
provide a default implementation to evaluate complex filters using simple
filters in SCIMUserManager, and if someone wants to extend it they need to
extend SCIMUserManager implementation.

On Fri, Nov 4, 2016 at 1:15 PM, Darshana Gunawardana 
wrote:

> Hi,
>
> Do we have the support for complex filters, pagination, sorting from the
> C5 user-core?
>
> If not, we should support these since these are some major limitations we
> had in C4 user-core and we should avoid those limitations in C5.
>
> Thanks,
>
> On Thu, Oct 20, 2016 at 9:41 AM, Vindula Jayawardana 
> wrote:
>
>> Hi Chamila,
>>
>> On Tue, Oct 18, 2016 at 4:18 PM, Chamila Wijayarathna <
>> cdwijayarat...@gmail.com> wrote:
>>
>>> Hi Johann, Vindula,
>>>
>>> On Tue, Oct 18, 2016 at 3:59 PM, Johann Nallathamby 
>>> wrote:
>>>


 On Tue, Oct 18, 2016 at 10:05 AM, Vindula Jayawardana  wrote:

> Hi All,
>
> With the current user core implementation we support only the equal
> filter (e.g. userName Eq "john"). However SCIM 2.0 specification [1]
> specify total of 10 such simple filters and complex filters which are
> combinations of simple filters using logical and grouping operators (e.g.
> userType ne "Employee" and not (emails co "example.com" or
> emails.value co "example.org")). As we are in the process of C5
> implementation, have we considered the other filter type implementations 
> as
> well?
>

 Yes we need to consider these features in the extended user-core
 implementation.

>
> Moreover if we are supporting the complex filters, are we supporting
> it by simple filter by filter basis or the entire complex filter as a
> whole? If we are looking for the simple filter by filter basis, there will
> be performance issues as well.
>

 It is better if we provide complex filters from extended user-core
 itself for performance reasons. However if time doesn't permit to implement
 all those APIs, we can have a scim UserManager implementation which will
 call multiple simple filters and combine the result and return. Obviously
 as you said performance of such implementation will be low. But it is
 acceptable as an interim solution until extended user-core implementation
 supports all the filters.

>>> Can you please explain, what you refer as complex filters here? I think
>>> we need to implement operators listed in table 3 and 4 in the specification
>>> and implement a generic way to build complex queries reusing them. I don't
>>> think it would be practical to more complex filters, there can be large
>>> amount of complex filters that can be created by combining these simple
>>> filter. Please correct me if I'm wrong.
>>>
>>
>> What I meant by complex filters is exactly what you have mentioned above.
>> Yes we can build large amount of complex filters (complex queries) by
>> combining the simple filters using operators listed in table 3 and 4.
>>
>>>
>>> Also what different would it made when we are handling these filters in
>>> user-core level and when handling using scimUserManager level? Are you
>>> reffering to the fact that when we need "username sw a" , we can retrieve
>>> only  the users who have username start with 'a' from database/ldap, so
>>> that we can achieve higher performance?
>>>
>>> In addition to that, I believe it would be good to consider other SCIM
>>> operations such as sorting and pagination at the same time. If we can come
>>> up with a generic design, that would be better. Otherwise, we'll have to
>>> put a huge effort to embed those functionalities again.
>>>
>>
>> Yes agree. We need a generic design which will ease our work in the long
>> run.
>>
>>>
>>> Cheers
>>> -Chamila
>>>

> Any thoughts on the matter is highly appreciated.
>
> [1] https://tools.ietf.org/html/rfc7644#section-3.4.2.2
>
> Thank you,
>
> *Vindula Jayawardana*
> Trainee Software Engineer
> Mobile : +94 713 462554
> vind...@wso2.com
>



 --
 Thanks & Regards,

 *Johann Dilantha Nallathamby*
 Technical Lead & Product Lead of WSO2 Identity Server
 Governance Technologies Team
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+9476950*
 Blog - *http://nallaa.wordpress.com *

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Chamila Dilshan Wijayarathna,
>>> PhD Research Student
>>> The University of New South Wales (UNSW Canberra)
>>> Australian Centre of Cyber Security

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Susinda Perera
-Dorg.wso2.ignoreHostnameVerification=true
This property is already in the wso2server.sh file, I.e having this did not
helped me.

On Fri, Nov 4, 2016 at 2:11 PM, Bhathiya Jayasekara 
wrote:

> Hi Susinda,
>
> If you want to use IP instead of hostname, you have to create a cert for
> that IP. For CN validation, hostname and IP mapping is not used.
>
I don't want to use the IP. but I tried that as a workaround only, just
check if that works

>
> On a related note, using IPs for CN is not recommended in general.
>
> Thanks,
> Bhathiya
>
> On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera  wrote:
>
>> Got this fixed by using a new keystore where primary key's CN is set to
>> 127.0.0.1 and importing the public key of the same to client-truststore.jks.
>> But i believe this is not the proper fix, as wso2carbon.jks already have
>> the cert for localhost and we do not want to create another cert for
>> 127.0.0.1.
>> Any idea?
>> Similar issues found in
>> https://wso2.org/jira/browse/APIMANAGER-4205
>> https://wso2.org/jira/browse/APIMANAGER-4626
>>
>> Thanks
>> Susinda
>>
>> On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera  wrote:
>>
>>> Hi All
>>> I'm getting this[1] $subject. Have anyone faced the same, what was the
>>> resolution?
>>>
>>>
>>> ERROR - APIGatewayManager Error occurred when publish to gateway
>>> Production and Sandbox
>>> org.apache.axis2.AxisFault: Error while contacting the authentication
>>> admin services
>>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>>> ent.login(AbstractAPIGatewayAdminClient.java:92)
>>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>>> ent.setup(AbstractAPIGatewayAdminClient.java:50)
>>> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.>> t>(APIGatewayAdminClient.java:37)
>>> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
>>> ay(APIGatewayManager.java:86)
>>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
>>> (APIProviderImpl.java:1485)
>>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
>>> tusChangeToGateways(APIProviderImpl.java:1294)
>>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
>>> PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
>>> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
>>> IExecutor.java:136)
>>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>>> ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
>>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>>> ltLifeCycle.invoke(DefaultLifeCycle.java:450)
>>> at org.wso2.carbon.governance.registry.eventing.handlers.Govern
>>> anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
>>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
>>> nvokeAspect(HandlerManager.java:2792)
>>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
>>> Manager.invokeAspect(HandlerLifecycleManager.java:518)
>>> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
>>> pect(EmbeddedRegistry.java:2591)
>>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
>>> vokeAspect(CacheBackedRegistry.java:510)
>>> at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
>>> ect(UserRegistry.java:1952)
>>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
>>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
>>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
>>> tatus(APIProviderImpl.java:3644)
>>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
>>> ycleStatus(UserAwareAPIProvider.java:148)
>>> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
>>> eImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
>>> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChange
>>> LifecyclePost(ApisApi.java:91)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>> ssorImpl.java:62)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>> thodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:497)
>>> at org.apache.cxf.service.invoker.AbstractInvoker.performInvoca
>>> tion(AbstractInvoker.java:180)
>>> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(Abstra
>>> ctInvoker.java:96)
>>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
>>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
>>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(S
>>> erviceInvokerInterceptor.java:59)
>>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleM
>>> essage(ServiceInvokerInterceptor.java:96)
>>> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
>>> 

Re: [Dev] [IS] C5 Support for filtering

2016-11-04 Thread Darshana Gunawardana
Hi,

Do we have the support for complex filters, pagination, sorting from the C5
user-core?

If not, we should support these since these are some major limitations we
had in C4 user-core and we should avoid those limitations in C5.

Thanks,

On Thu, Oct 20, 2016 at 9:41 AM, Vindula Jayawardana 
wrote:

> Hi Chamila,
>
> On Tue, Oct 18, 2016 at 4:18 PM, Chamila Wijayarathna <
> cdwijayarat...@gmail.com> wrote:
>
>> Hi Johann, Vindula,
>>
>> On Tue, Oct 18, 2016 at 3:59 PM, Johann Nallathamby 
>> wrote:
>>
>>>
>>>
>>> On Tue, Oct 18, 2016 at 10:05 AM, Vindula Jayawardana 
>>> wrote:
>>>
 Hi All,

 With the current user core implementation we support only the equal
 filter (e.g. userName Eq "john"). However SCIM 2.0 specification [1]
 specify total of 10 such simple filters and complex filters which are
 combinations of simple filters using logical and grouping operators (e.g.
 userType ne "Employee" and not (emails co "example.com" or
 emails.value co "example.org")). As we are in the process of C5
 implementation, have we considered the other filter type implementations as
 well?

>>>
>>> Yes we need to consider these features in the extended user-core
>>> implementation.
>>>

 Moreover if we are supporting the complex filters, are we supporting it
 by simple filter by filter basis or the entire complex filter as a whole?
 If we are looking for the simple filter by filter basis, there will be
 performance issues as well.

>>>
>>> It is better if we provide complex filters from extended user-core
>>> itself for performance reasons. However if time doesn't permit to implement
>>> all those APIs, we can have a scim UserManager implementation which will
>>> call multiple simple filters and combine the result and return. Obviously
>>> as you said performance of such implementation will be low. But it is
>>> acceptable as an interim solution until extended user-core implementation
>>> supports all the filters.
>>>
>> Can you please explain, what you refer as complex filters here? I think
>> we need to implement operators listed in table 3 and 4 in the specification
>> and implement a generic way to build complex queries reusing them. I don't
>> think it would be practical to more complex filters, there can be large
>> amount of complex filters that can be created by combining these simple
>> filter. Please correct me if I'm wrong.
>>
>
> What I meant by complex filters is exactly what you have mentioned above.
> Yes we can build large amount of complex filters (complex queries) by
> combining the simple filters using operators listed in table 3 and 4.
>
>>
>> Also what different would it made when we are handling these filters in
>> user-core level and when handling using scimUserManager level? Are you
>> reffering to the fact that when we need "username sw a" , we can retrieve
>> only  the users who have username start with 'a' from database/ldap, so
>> that we can achieve higher performance?
>>
>> In addition to that, I believe it would be good to consider other SCIM
>> operations such as sorting and pagination at the same time. If we can come
>> up with a generic design, that would be better. Otherwise, we'll have to
>> put a huge effort to embed those functionalities again.
>>
>
> Yes agree. We need a generic design which will ease our work in the long
> run.
>
>>
>> Cheers
>> -Chamila
>>
>>>
 Any thoughts on the matter is highly appreciated.

 [1] https://tools.ietf.org/html/rfc7644#section-3.4.2.2

 Thank you,

 *Vindula Jayawardana*
 Trainee Software Engineer
 Mobile : +94 713 462554
 vind...@wso2.com

>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>>
>>> *Johann Dilantha Nallathamby*
>>> Technical Lead & Product Lead of WSO2 Identity Server
>>> Governance Technologies Team
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>>
>>> Mobile - *+9476950*
>>> Blog - *http://nallaa.wordpress.com *
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Chamila Dilshan Wijayarathna,
>> PhD Research Student
>> The University of New South Wales (UNSW Canberra)
>> Australian Centre of Cyber Security
>> Australian Defence Force Academy
>> PO Box 7916, Canberra BA ACT 2610
>> Australia
>> Mobile:(+61)416895795
>>
>>
>
>
> --
> *Vindula Jayawardana*
> Trainee Software Engineer
> Mobile : +94 713 462554
> Email : vind...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Regards,


*Darshana Gunawardana*Associate Technical Lead
WSO2 Inc.; http://wso2.com

*E-mail: darsh...@wso2.com *
*Mobile: +94718566859*Lean . Enterprise . Middleware
___
Dev mailing list

Re: [Dev] Shall we change the convention for placement of DB Query String in Java Code.

2016-11-04 Thread Maduranga Siriwardena
On Fri, Nov 4, 2016 at 11:01 AM, Lahiru Cooray  wrote:

>
>
> On Thu, Nov 3, 2016 at 10:57 AM, Maduranga Siriwardena  > wrote:
>
>> Hi Ruwan,
>>
>> Having the SQL query in the method itself improves the readability.
>>
>> However in C4 usercore and C5 user store connector current
>> implementation, we have the SQL queries in a central place and load it to a
>> map at the time of the initialization of connector. With this approach one
>> of the advantages we have gained is we can load the SQL queries from a
>> config file (may be to support a new database type without changing the
>> code). How can we do this with the new approach?
>>
> Agreed with RuwanA. -1 for the current approach. Giving the control to
> modify the DML statements as a configuration is not a good practise unless
> if it's an extension point. Is there any reason why we are currently doing
> this?
>
>
>> And when there are different SQL queries for different database types,
>> readability of the method is worsen in my opinion.
>>
> If the query is an ANSI SQL statement, we could have it closer to the code
> and if not +1 to use a factory method separate the statements DB type wise.
>
Having 2 patterns at the same time is not a good practice in my opinion. We
have to stick to one of the methods throughout the whole code base.

The only place I have come across that needs different query types (when
inserting, updating, deleting or selecting data) is when using the limits.
So we may not need worry much about it.

>
>
>>
>> Thanks,
>> Maduranga.
>>
>> On Tue, Nov 1, 2016 at 12:46 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi Rajith,
>>> +1
>>>
>>> final String insertIdpSql
>>>
>>> On Tue, Nov 1, 2016 at 11:33 AM, Rajith Roshan  wrote:
>>>
 Hi Ruwan,

 Since the final variable is not static can we name it using camel case
 convention[1]. Otherwise check style plugin will give errors.

 [1] - final String insertIdpSql

 Thanks!
 Rajith

 On Fri, Oct 28, 2016 at 9:41 AM, Afkham Azeez  wrote:

> Query should be close to the code. +1 for Ruwan's proposal. Not only
> for queries, you should use your judgment when deciding where to place
> constants as well. In many cases, it makes sense to keep the constants in
> the relevant class where it is used but people have been blindly putting
> those into a Constants class.
>
> On Fri, Oct 28, 2016 at 8:04 AM, Sumedha Rubasinghe 
> wrote:
>
>> I am actually in favour of what Ruwan is suggesting.
>>
>> 1. When a problem comes we  usually start by looking at the
>> particular query. There is no need to look at all queries together.
>>
>> 2. Having the query close to rest of the jdbc code is easier.
>>
>> 3. Regardless of where it is, all queries should be formatted for
>> readability than putting it as a single liner string
>>
>> On Oct 28, 2016 7:27 AM, "Selvaratnam Uthaiyashankar" <
>> shan...@wso2.com> wrote:
>>
>>> Do we have any requirements to see all queries together? If so,
>>> defining in a single place would be easy. However, I am not sure 
>>> whether we
>>> have used that requirement ever. We normally look at the query local to 
>>> the
>>> method? If so, I am +1 for Ruwan's proposal. Being local constant to the
>>> method seems good.
>>>
>>> On Thu, Oct 27, 2016 at 9:42 PM, Sagara Gunathunga 
>>> wrote:
>>>

 Personally I don't have strong preference on one style over other,
 what mostly important for me is maintain one style consistently within 
 the
 product and if possible across the company.

 I'm adding few other people for their opinion.

 Thanks !

 On Thu, Oct 27, 2016 at 5:34 PM, Ruwan Abeykoon 
 wrote:

> Hi Devs,
> We have been following a convention to put Database query string
> in a constant elsewhere in the code when performing DB CRUD 
> operations.
>
> e.g.
>
> try {
> String sqlStmt = 
> IdPManagementConstants.SQLQueries.GET_IDP_BY_NAME_SQL;
> prepStmt = dbConnection.prepareStatement(sqlStmt);
> prepStmt.setInt(1, tenantId);
> prepStmt.setInt(2, MultitenantConstants.SUPER_TENANT_ID);
> prepStmt.setString(3, idPName);
> rs = prepStmt.executeQuery();
>
> ...
>
>
> However I would propose to keep the query in the same location as the 
> SQL parameter binding and result set reading. Shall we make it within 
> local final variable(constant) in  the method itself.
>
> The advantage is that the Query is visible on the same screen as it 
> is being used. 

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Bhathiya Jayasekara
Hi Susinda,

If you want to use IP instead of hostname, you have to create a cert for
that IP. For CN validation, hostname and IP mapping is not used.

On a related note, using IPs for CN is not recommended in general.

Thanks,
Bhathiya

On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera  wrote:

> Got this fixed by using a new keystore where primary key's CN is set to
> 127.0.0.1 and importing the public key of the same to client-truststore.jks.
> But i believe this is not the proper fix, as wso2carbon.jks already have
> the cert for localhost and we do not want to create another cert for
> 127.0.0.1.
> Any idea?
> Similar issues found in
> https://wso2.org/jira/browse/APIMANAGER-4205
> https://wso2.org/jira/browse/APIMANAGER-4626
>
> Thanks
> Susinda
>
> On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera  wrote:
>
>> Hi All
>> I'm getting this[1] $subject. Have anyone faced the same, what was the
>> resolution?
>>
>>
>> ERROR - APIGatewayManager Error occurred when publish to gateway
>> Production and Sandbox
>> org.apache.axis2.AxisFault: Error while contacting the authentication
>> admin services
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.login(AbstractAPIGatewayAdminClient.java:92)
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.setup(AbstractAPIGatewayAdminClient.java:50)
>> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.> t>(APIGatewayAdminClient.java:37)
>> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
>> ay(APIGatewayManager.java:86)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
>> (APIProviderImpl.java:1485)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
>> tusChangeToGateways(APIProviderImpl.java:1294)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
>> PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
>> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
>> IExecutor.java:136)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.invoke(DefaultLifeCycle.java:450)
>> at org.wso2.carbon.governance.registry.eventing.handlers.Govern
>> anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
>> nvokeAspect(HandlerManager.java:2792)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
>> Manager.invokeAspect(HandlerLifecycleManager.java:518)
>> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
>> pect(EmbeddedRegistry.java:2591)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
>> vokeAspect(CacheBackedRegistry.java:510)
>> at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
>> ect(UserRegistry.java:1952)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
>> tatus(APIProviderImpl.java:3644)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
>> ycleStatus(UserAwareAPIProvider.java:148)
>> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
>> eImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
>> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChange
>> LifecyclePost(ApisApi.java:91)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> at org.apache.cxf.service.invoker.AbstractInvoker.performInvoca
>> tion(AbstractInvoker.java:180)
>> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
>> AbstractInvoker.java:96)
>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(
>> ServiceInvokerInterceptor.java:59)
>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleM
>> essage(ServiceInvokerInterceptor.java:96)
>> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
>> InterceptorChain.java:308)
>> at org.apache.cxf.transport.ChainInitiationObserver.onMessage(C
>> hainInitiationObserver.java:121)
>> at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke
>> (AbstractHTTPDestination.java:251)
>> at org.apache.cxf.transport.servlet.ServletController.invokeDes
>> tination(ServletController.java:234)
>> at org.apache.cxf.transport.servlet.ServletController.invoke(
>> 

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Abimaran Kugathasan
Hi Susinda,

I guess, you are using API Manager 2.0. Hostname verification is mandatory
from carbon kernel 4.4.x onwards. In the latest version, they have agreed
to keep this in configuration level.

>From the exception trace, I guess, your operation uses http client to
communicate, in this case, you can use below property to suppress the
hostname verification.

-Dorg.wso2.ignoreHostnameVerification=true


On Fri, Nov 4, 2016 at 1:19 PM, Susinda Perera  wrote:

> Got this fixed by using a new keystore where primary key's CN is set to
> 127.0.0.1 and importing the public key of the same to client-truststore.jks.
> But i believe this is not the proper fix, as wso2carbon.jks already have
> the cert for localhost and we do not want to create another cert for
> 127.0.0.1.
> Any idea?
> Similar issues found in
> https://wso2.org/jira/browse/APIMANAGER-4205
> https://wso2.org/jira/browse/APIMANAGER-4626
>
> Thanks
> Susinda
>
> On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera  wrote:
>
>> Hi All
>> I'm getting this[1] $subject. Have anyone faced the same, what was the
>> resolution?
>>
>>
>> ERROR - APIGatewayManager Error occurred when publish to gateway
>> Production and Sandbox
>> org.apache.axis2.AxisFault: Error while contacting the authentication
>> admin services
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.login(AbstractAPIGatewayAdminClient.java:92)
>> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminCli
>> ent.setup(AbstractAPIGatewayAdminClient.java:50)
>> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.> t>(APIGatewayAdminClient.java:37)
>> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGatew
>> ay(APIGatewayManager.java:86)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway
>> (APIProviderImpl.java:1485)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.propergateAPISta
>> tusChangeToGateways(APIProviderImpl.java:1294)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.propergateA
>> PIStatusChangeToGateways(UserAwareAPIProvider.java:36)
>> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(AP
>> IExecutor.java:136)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
>> at org.wso2.carbon.governance.registry.extensions.aspects.Defau
>> ltLifeCycle.invoke(DefaultLifeCycle.java:450)
>> at org.wso2.carbon.governance.registry.eventing.handlers.Govern
>> anceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.i
>> nvokeAspect(HandlerManager.java:2792)
>> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycle
>> Manager.invokeAspect(HandlerLifecycleManager.java:518)
>> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.invokeAs
>> pect(EmbeddedRegistry.java:2591)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.in
>> vokeAspect(CacheBackedRegistry.java:510)
>> at org.wso2.carbon.registry.core.session.UserRegistry.invokeAsp
>> ect(UserRegistry.java:1952)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
>> at org.wso2.carbon.governance.api.common.dataobjects.Governance
>> ArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
>> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleS
>> tatus(APIProviderImpl.java:3644)
>> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeC
>> ycleStatus(UserAwareAPIProvider.java:148)
>> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic
>> eImpl.apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
>> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisChange
>> LifecyclePost(ApisApi.java:91)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> at org.apache.cxf.service.invoker.AbstractInvoker.performInvoca
>> tion(AbstractInvoker.java:180)
>> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(Abstra
>> ctInvoker.java:96)
>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
>> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(S
>> erviceInvokerInterceptor.java:59)
>> at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleM
>> essage(ServiceInvokerInterceptor.java:96)
>> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
>> InterceptorChain.java:308)
>> at org.apache.cxf.transport.ChainInitiationObserver.onMessage(C
>> hainInitiationObserver.java:121)
>> at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke
>> (AbstractHTTPDestination.java:251)
>> at 

Re: [Dev] Error while publishing apis to gateway

2016-11-04 Thread Susinda Perera
Got this fixed by using a new keystore where primary key's CN is set to
127.0.0.1 and importing the public key of the same to client-truststore.jks.
But i believe this is not the proper fix, as wso2carbon.jks already have
the cert for localhost and we do not want to create another cert for
127.0.0.1.
Any idea?
Similar issues found in
https://wso2.org/jira/browse/APIMANAGER-4205
https://wso2.org/jira/browse/APIMANAGER-4626

Thanks
Susinda

On Fri, Nov 4, 2016 at 12:53 PM, Susinda Perera  wrote:

> Hi All
> I'm getting this[1] $subject. Have anyone faced the same, what was the
> resolution?
>
>
> ERROR - APIGatewayManager Error occurred when publish to gateway
> Production and Sandbox
> org.apache.axis2.AxisFault: Error while contacting the authentication
> admin services
> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminClient.login(
> AbstractAPIGatewayAdminClient.java:92)
> at org.wso2.carbon.apimgt.impl.utils.AbstractAPIGatewayAdminClient.setup(
> AbstractAPIGatewayAdminClient.java:50)
> at org.wso2.carbon.apimgt.impl.utils.APIGatewayAdminClient.<
> init>(APIGatewayAdminClient.java:37)
> at org.wso2.carbon.apimgt.impl.APIGatewayManager.publishToGateway(
> APIGatewayManager.java:86)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.publishToGateway(
> APIProviderImpl.java:1485)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.
> propergateAPIStatusChangeToGateways(APIProviderImpl.java:1294)
> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.
> propergateAPIStatusChangeToGateways(UserAwareAPIProvider.java:36)
> at org.wso2.carbon.apimgt.impl.executors.APIExecutor.execute(
> APIExecutor.java:136)
> at org.wso2.carbon.governance.registry.extensions.aspects.
> DefaultLifeCycle.runCustomExecutorsCode(DefaultLifeCycle.java:712)
> at org.wso2.carbon.governance.registry.extensions.aspects.
> DefaultLifeCycle.invoke(DefaultLifeCycle.java:450)
> at org.wso2.carbon.governance.registry.eventing.handlers.
> GovernanceEventingHandler.invokeAspect(GovernanceEventingHandler.java:338)
> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.
> invokeAspect(HandlerManager.java:2792)
> at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.
> invokeAspect(HandlerLifecycleManager.java:518)
> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.
> invokeAspect(EmbeddedRegistry.java:2591)
> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.invokeAspect(
> CacheBackedRegistry.java:510)
> at org.wso2.carbon.registry.core.session.UserRegistry.
> invokeAspect(UserRegistry.java:1952)
> at org.wso2.carbon.governance.api.common.dataobjects.
> GovernanceArtifactImpl.invokeAction(GovernanceArtifactImpl.java:829)
> at org.wso2.carbon.governance.api.common.dataobjects.
> GovernanceArtifactImpl.invokeAction(GovernanceArtifactImpl.java:808)
> at org.wso2.carbon.apimgt.impl.APIProviderImpl.changeLifeCycleStatus(
> APIProviderImpl.java:3644)
> at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.changeLifeCycleStatus(
> UserAwareAPIProvider.java:148)
> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl.
> apisChangeLifecyclePost(ApisApiServiceImpl.java:252)
> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.
> apisChangeLifecyclePost(ApisApi.java:91)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(
> AbstractInvoker.java:180)
> at org.apache.cxf.service.invoker.AbstractInvoker.
> invoke(AbstractInvoker.java:96)
> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
> at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
> at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.
> run(ServiceInvokerInterceptor.java:59)
> at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(
> ServiceInvokerInterceptor.java:96)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:308)
> at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> ChainInitiationObserver.java:121)
> at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(
> AbstractHTTPDestination.java:251)
> at org.apache.cxf.transport.servlet.ServletController.invokeDestination(
> ServletController.java:234)
> at org.apache.cxf.transport.servlet.ServletController.
> invoke(ServletController.java:208)
> at org.apache.cxf.transport.servlet.ServletController.
> invoke(ServletController.java:160)
> at org.apache.cxf.transport.servlet.CXFNonSpringServlet.
> invoke(CXFNonSpringServlet.java:180)
> at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(
> AbstractHTTPServlet.java:293)
> at org.apache.cxf.transport.servlet.AbstractHTTPServlet.
> doPost(AbstractHTTPServlet.java:212)
> at 

Re: [Dev] Unable to remove Content-Type header for POST request with empty body

2016-11-04 Thread Malaka Silva
It seems to me we may not be able to do this use case for post requests
with empty content.

@ESB Team - Let us know if there is a way to handle this?

On Wed, Nov 2, 2016 at 5:36 PM, Keerthika Mahendralingam  wrote:

> Hi All,
>
> Dropbox backend service expecting a POST request with empty body and
> without Content-Type header for download method[1].
>
> I am unable to remove the Content-Type header from the request. Is there
> any way to do this?
>
> I tried with the following:
> 
> It is working for GET methods but not for POST one.
>
> If I use , content
> type is set as null but it is sending "" in the body.
>
> Please find the configuration I used:
>
> 
> http://ws.apache.org/ns/synapse;
>name="testProxy"
>startOnLoad="true"
>statistics="disable"
>trace="disable"
>transports="https,http">
>
>   
>   
>   
>   
>   
>value="application/x-www-form-urlencoded"
> scope="axis2">
>scope="axis2" type="BOOLEAN">
>   
>   
> https://content.
> dropboxapi.com/2/files/download"/>
>   
>  
>   
>
>
> 
>
> [1]. https://www.dropbox.com/developers/documentation/http/
> documentation#files-download
>
> Thanks,
> --
> 
> Keerthika Mahendralingam
> Software Engineer
> Mobile :+94 (0) 776 121144
> keerth...@wso2.com
> WSO2, Inc.
> lean . enterprise . middleware
>



-- 

Best Regards,

Malaka Silva
Senior Technical Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
https://wso2.com/signature
http://www.wso2.com/about/team/malaka-silva/

https://store.wso2.com/store/

Don't make Trees rare, we should keep them with care
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dependencies get missed from the msf4j

2016-11-04 Thread Tharindu Dharmarathna
Hi Azeez,

Noted, We import the com.fasterxml.jackson.jaxrs:
jackson-jaxrs-json-provider:*jar:2.4.5 *into the project and done the
changes.




On Thu, Nov 3, 2016 at 5:38 PM, Afkham Azeez  wrote:

> Yes we removed Swagger because it increases the dependency size by about
> 5MB (double the size). So take a look at the stockquote sample and add the
> relevant swagger deps to the pom.
>
> On Thu, Nov 3, 2016 at 5:24 PM, Tharindu Dharmarathna 
> wrote:
>
>> Hi All,
>>
>> In APIM C5 we are going to update the msf4j version into 2.1.0 when we
>> going to build it using that version we got following dependencies which
>> used in 2.0.0 get missed in 2.1.0. Is there any error we had done ?.
>>
>> *Dependency tree while using 2.0.0.*
>>
>>
>> +- org.wso2.msf4j:msf4j-core:jar:2.0.0:compile
>> [INFO] |  +- org.wso2.carbon.messaging:org.wso2.carbon.messaging:jar:1.0.
>> 4:compile
>> [INFO] |  |  \- org.wso2.carbon:org.wso2.carbo
>> n.launcher:jar:5.1.0:compile
>> [INFO] |  +- org.wso2.carbon.transport:org.wso2.carbon.transport.http.net
>> ty:jar:2.1.2:compile
>> [INFO] |  |  +- io.netty:netty-common:jar:4.0.30.Final:compile
>> [INFO] |  |  +- io.netty:netty-buffer:jar:4.0.30.Final:compile
>> [INFO] |  |  +- io.netty:netty-transport:jar:4.0.30.Final:compile
>> [INFO] |  |  +- io.netty:netty-handler:jar:4.0.30.Final:compile
>> [INFO] |  |  +- io.netty:netty-codec:jar:4.0.30.Final:compile
>> [INFO] |  |  +- commons-pool.wso2:commons-pool:jar:1.5.6.wso2v1:compile
>> [INFO] |  |  |  \- commons-pool:commons-pool:jar:1.5.6:compile
>> [INFO] |  |  \- org.wso2.orbit.com.lmax:disrup
>> tor:jar:3.3.2.wso2v2:compile
>> [INFO] |  +- org.wso2.eclipse.osgi:org.eclipse.osgi:jar:3.10.2.v20150203-
>> 1939:compile
>> [INFO] |  +- org.wso2.eclipse.osgi:org.eclipse.osgi.services:jar:3.4.0.
>> v20140312-2051:compile
>> [INFO] |  +- org.wso2.msf4j:jaxrs-delegates:jar:2.0.0:compile
>> [INFO] |  +- org.slf4j:slf4j-api:jar:1.7.5:compile
>> [INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.6.0:compile
>> [INFO] |  |  \- log4j:log4j:jar:1.2.14:compile
>> [INFO] |  +- com.google.code.gson:gson:jar:2.2.4:compile
>> [INFO] |  +- com.google.guava:guava:jar:18.0:compile
>> [INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
>> [INFO] |  +- org.apache.servicemix.bundles:org.apache.servicemix.bundles.
>> commons-beanutils:jar:1.8.3_2:compile
>> [INFO] |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
>> [INFO] |  +- com.nimbusds:nimbus-jose-jwt:jar:2.25:compile
>> [INFO] |  |  +- net.jcip:jcip-annotations:jar:1.0:compile
>> [INFO] |  |  +- net.minidev:json-smart:jar:1.1.1:compile
>> [INFO] |  |  \- org.bouncycastle:bcprov-jdk15on:jar:1.50:compile
>> [INFO] |  +- io.swagger:swagger-core:jar:1.5.8:compile
>> [INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.2.1:compile
>> [INFO] |  |  +- io.swagger:swagger-models:jar:1.5.8:compile
>> [INFO] |  |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
>> [INFO] |  +- io.swagger:swagger-jaxrs:jar:1.5.8:compile
>> [INFO] |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:
>> jar:2.4.5:compile
>> [INFO] |  |  |  \- org.yaml:snakeyaml:jar:1.12:compile
>> [INFO] |  |  +- org.reflections:reflections:jar:0.9.10:compile
>> [INFO] |  |  |  \- org.javassist:javassist:jar:3.19.0-GA:compile
>> [INFO] |  |  \- com.fasterxml.jackson.jaxrs:ja
>> ckson-jaxrs-json-provider:jar:2.4.5:compile
>> [INFO] |  | +- com.fasterxml.jackson.jaxrs:ja
>> ckson-jaxrs-base:jar:2.4.5:compile
>> [INFO] |  | \- com.fasterxml.jackson.module:j
>> ackson-module-jaxb-annotations:jar:2.4.5:compile
>> [INFO] |  \- commons-io.wso2:commons-io:jar:2.4.0.wso2v1:compile
>>
>> *Dependency tree after 2.1.0*
>>
>> +- org.wso2.msf4j:msf4j-core:jar:2.1.0:compile
>> [INFO]|  +- org.wso2.carbon.messaging:org.
>> wso2.carbon.messaging:jar:1.0.6:compile
>> [INFO]|  |  \- org.wso2.carbon:org.wso2.carbo
>> n.launcher:jar:5.1.0:compile
>> [INFO]|  +- org.wso2.carbon.transport:org.
>> wso2.carbon.transport.http.netty:jar:2.1.4:compile
>> [INFO]|  |  +- io.netty:netty-common:jar:4.0.30.Final:compile
>> [INFO]|  |  +- io.netty:netty-buffer:jar:4.0.30.Final:compile
>> [INFO]|  |  +- io.netty:netty-transport:jar:4.0.30.Final:compile
>> [INFO]|  |  +- io.netty:netty-handler:jar:4.0.30.Final:compile
>> [INFO]|  |  +- io.netty:netty-codec:jar:4.0.30.Final:compile
>> [INFO]|  |  +- io.netty:netty-codec-http:jar:4.0.30.Final:compile
>> [INFO]|  |  +- commons-pool.wso2:commons-pool
>> :jar:1.5.6.wso2v1:compile
>> [INFO]|  |  |  \- commons-pool:commons-pool:jar:1.5.6:compile
>> [INFO]|  |  \- org.wso2.orbit.com.lmax:disrup
>> tor:jar:3.3.2.wso2v2:compile
>> [INFO]|  +- org.wso2.eclipse.osgi:org.ecli
>> pse.osgi:jar:3.10.2.v20150203-1939:compile
>> [INFO]|  +- org.wso2.eclipse.osgi:org.ecli
>> pse.osgi.services:jar:3.4.0.v20140312-2051:compile
>> [INFO]|  +- org.wso2.msf4j:jaxrs-delegates:jar:2.1.0:compile
>> [INFO]|  |  \- 

Re: [Dev] Shall we change the convention for placement of DB Query String in Java Code.

2016-11-04 Thread Lahiru Cooray
On Fri, Nov 4, 2016 at 11:30 AM, Maduranga Siriwardena 
wrote:

>
>
> On Fri, Nov 4, 2016 at 11:01 AM, Lahiru Cooray  wrote:
>
>>
>>
>> On Thu, Nov 3, 2016 at 10:57 AM, Maduranga Siriwardena <
>> madura...@wso2.com> wrote:
>>
>>> Hi Ruwan,
>>>
>>> Having the SQL query in the method itself improves the readability.
>>>
>>> However in C4 usercore and C5 user store connector current
>>> implementation, we have the SQL queries in a central place and load it to a
>>> map at the time of the initialization of connector. With this approach one
>>> of the advantages we have gained is we can load the SQL queries from a
>>> config file (may be to support a new database type without changing the
>>> code). How can we do this with the new approach?
>>>
>> Agreed with RuwanA. -1 for the current approach. Giving the control to
>> modify the DML statements as a configuration is not a good practise unless
>> if it's an extension point. Is there any reason why we are currently doing
>> this?
>>
>>
>>> And when there are different SQL queries for different database types,
>>> readability of the method is worsen in my opinion.
>>>
>> If the query is an ANSI SQL statement, we could have it closer to the
>> code and if not +1 to use a factory method separate the statements DB type
>> wise.
>>
> Having 2 patterns at the same time is not a good practice in my opinion.
> We have to stick to one of the methods throughout the whole code base.
>

It can be argued both ways..
Basically more than 90% of the DML statements would be ANSI SQL's. (we may
only need to write specific queries when we need to do very limited
operations (eg: as you said setting paginations/datetime casting etc). I
believe insert/update/delete syntaxes are similar unless a select involves
to do a bulk operation.

So its easier if we have such queries near to your code.
And my opinion is when you do not have a query near to your code block you
always know that this is not an ANSI Sql and its a reminder for the
developer to do the relevant change in all types.




>
> The only place I have come across that needs different query types (when
> inserting, updating, deleting or selecting data) is when using the limits.
> So we may not need worry much about it.
>
>>
>>
>>>
>>> Thanks,
>>> Maduranga.
>>>
>>> On Tue, Nov 1, 2016 at 12:46 PM, Ruwan Abeykoon  wrote:
>>>
 Hi Rajith,
 +1

 final String insertIdpSql

 On Tue, Nov 1, 2016 at 11:33 AM, Rajith Roshan 
 wrote:

> Hi Ruwan,
>
> Since the final variable is not static can we name it using camel case
> convention[1]. Otherwise check style plugin will give errors.
>
> [1] - final String insertIdpSql
>
> Thanks!
> Rajith
>
> On Fri, Oct 28, 2016 at 9:41 AM, Afkham Azeez  wrote:
>
>> Query should be close to the code. +1 for Ruwan's proposal. Not only
>> for queries, you should use your judgment when deciding where to place
>> constants as well. In many cases, it makes sense to keep the constants in
>> the relevant class where it is used but people have been blindly putting
>> those into a Constants class.
>>
>> On Fri, Oct 28, 2016 at 8:04 AM, Sumedha Rubasinghe > > wrote:
>>
>>> I am actually in favour of what Ruwan is suggesting.
>>>
>>> 1. When a problem comes we  usually start by looking at the
>>> particular query. There is no need to look at all queries together.
>>>
>>> 2. Having the query close to rest of the jdbc code is easier.
>>>
>>> 3. Regardless of where it is, all queries should be formatted for
>>> readability than putting it as a single liner string
>>>
>>> On Oct 28, 2016 7:27 AM, "Selvaratnam Uthaiyashankar" <
>>> shan...@wso2.com> wrote:
>>>
 Do we have any requirements to see all queries together? If so,
 defining in a single place would be easy. However, I am not sure 
 whether we
 have used that requirement ever. We normally look at the query local 
 to the
 method? If so, I am +1 for Ruwan's proposal. Being local constant to 
 the
 method seems good.

 On Thu, Oct 27, 2016 at 9:42 PM, Sagara Gunathunga  wrote:

>
> Personally I don't have strong preference on one style over other,
> what mostly important for me is maintain one style consistently 
> within the
> product and if possible across the company.
>
> I'm adding few other people for their opinion.
>
> Thanks !
>
> On Thu, Oct 27, 2016 at 5:34 PM, Ruwan Abeykoon 
> wrote:
>
>> Hi Devs,
>> We have been following a convention to put Database query string
>> in a constant elsewhere in the code when performing DB 

Re: [Dev] Fwd: [DEV][C5] How to access the REST API Request properties

2016-11-04 Thread Sanjeewa Malalgoda
When we provide OOB security handlers ideally they should build
authentication context and pass that information throughout execution flow.
Please have a look at on this[1].

[1]
http://docs.spring.io/spring-security/site/docs/current/apidocs/org/springframework/security/core/context/SecurityContext.html

Thanks,
sanjeewa.

On Fri, Nov 4, 2016 at 10:05 AM, Thusitha Thilina Dayaratne <
thusit...@wso2.com> wrote:

> Hi Sanjeewa,
>
> I didn't get the exact point that you mentioned. Could you please
> elaborate what we need to do from MSF4J side to cater the requirement?
>
>
> Thanks
> Thusitha
>
> On Thu, Nov 3, 2016 at 5:46 PM, Sanjeewa Malalgoda 
> wrote:
>
>> Hi Azeez, Thusitha,
>> Shouldn't we build a authentication context once request pass through
>> authentication interceptor? Usually web services frameworks do that. And
>> most of the time they let users to build authentication context and users
>> context so they can access some of those in application implementation. We
>> should be able to add that as a property from interceptor and use it in
>> next interceptors or app implementation. But shouldn't we support it OOB?
>>
>> Thanks,
>> sanjeewa.
>>
>> On Thu, Nov 3, 2016 at 5:21 PM, Ishara Cooray  wrote:
>>
>>> Thanks Thusitha.
>>>
>>> FI
>>> following info could be found as request properties.
>>>
>>>
>>> ​
>>> ​
>>> Also the token info could be found in Token introspection response
>>>
>>> 
>>>
>>> Thanks & Regards,
>>> Ishara Cooray
>>> Senior Software Engineer
>>> Mobile : +9477 262 9512
>>> WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>>
>>> On Thu, Nov 3, 2016 at 10:30 AM, Thusitha Thilina Dayaratne <
>>> thusit...@wso2.com> wrote:
>>>
 Hi Ishara,

 AFAIK you should be able to get that information through the request
 object.
 e.g request.getProperties()

 Thanks
 Thusitha

 On Thu, Nov 3, 2016 at 10:24 AM, Ishara Cooray 
 wrote:

> +Shafreen, Sanjeewa, Kishanthan
>
> Hi,
>
> With regard to C5 implementation, i need to get api request properties
> such as Message.BASE_PATH, Message.PATH_INFO, Message.HTTP_REQUEST_METHOD
> for scope validation of a rest api call.
>
> In Interceptor interface we have precall method which i can use to get
> above information.
>
> public boolean preCall(Request request, Response responder,
> ServiceMethodInfo serviceMethodInfo)
>
> Appreciate if you can provide the usage of the above to get http
> request info and token info.
>
>
> Thanks.
> Ishara
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Thusitha Dayaratne
 Software Engineer
 WSO2 Inc. - lean . enterprise . middleware |  wso2.com

 Mobile  +94712756809
 Blog  alokayasoya.blogspot.com
 Abouthttp://about.me/thusithathilina
 


>>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779
>>
>> blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> 
>>
>>
>>
>
>
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog  alokayasoya.blogspot.com
> Abouthttp://about.me/thusithathilina
> 
>
>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DEV][MSF4J] Is it possible to expose a method to get introspect endpoint response in OAuthSecurityInterceptor

2016-11-04 Thread Ishara Cooray
For API Manager Rest API scope validation we need to get the scops from the
introspect endpoint response.

Current implementation of OAuthSecurityInterceptor does token validation
and only return the status of the access token.

In order to do the scope validation we are planning to extend this
OAuthSecurityInterceptor, but according to the current implementation
introspect endpoint response is protected from a private method.

To avoid code duplication in the extended class
*Is it possible to expose a method to get this response?*

Do you have any plans to OOTB support for scope validation?

Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev