Re: [Dev] [App Factory] Need to add a setter for appFactoryRepositoryAuthorizationClient in the appfactory-gitblit-plugin's AppFactoryGitBlitUserModel class

2014-05-31 Thread Sumedha Kodithuwakku
Hi all,

If there are no issues, shall I go ahead and commit the fix.

Thanks
SumedhaS


On Fri, May 30, 2014 at 7:24 PM, Danushka Fernando danush...@wso2.com
wrote:

 In that case +1 to adding this to the plugin, which will make it
 extensible.

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, May 30, 2014 at 4:37 PM, Sumedha Kodithuwakku sumed...@wso2.com
 wrote:

 Hi Danushka,

 The issue is when we override authenticate method in
 AppFactoryGitBlitAuthenticationProvider, we have to call the supper
 method which will return a AppFactoryGitBlitUserModel which cannot be
 casted to the extended one. If we are to get the extended one, we will have
 to write our own authenticate method and if we do that we will not get the
 changes you may do in future.

 Thanks
 SumedhaS


 On Fri, May 30, 2014 at 3:52 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi Sumedha
 This fix doesn't seems harmful. So I am ok with adding this to our code
 if its necessary.
 But question I got is since you are writing a plugin extended from our
 code, Isn't it possible to extend AppFactoryGitBlitUserModel and write
 your own and add it there? And IIRC you can configure gitblit to use it.



 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, May 30, 2014 at 3:39 PM, Sumedha Kodithuwakku sumed...@wso2.com
  wrote:

 Hi AF team,

 We need to extend the appfactory-gitblit-plugin [1] to do some changes
 so that it can authenticate/authorize users with only their email address.
 So basically we want to override authenticate method
 of AppFactoryGitBlitAuthenticationProvider and authorize method in
 AppFactoryRepositoryAuthorizationClient.

 So doing that it was required to set the authorization client in
 the AppFactoryGitBlitUserModel to a custom one. To do that I had to include
 the following setter;

 ---
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java
  (revision
 204299)
 +++
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java
  (working
 copy)
 @@ -116,4 +116,7 @@
   return new
 AppFactoryRepositoryAuthorizationClient(getConfiguration());
   }

 -}
 \ No newline at end of file
 + public void
 setAppFactoryRepositoryAuthorizationClient(AppFactoryRepositoryAuthorizationClient
 appFactoryRepositoryAuthorizationClient) {
 + this.appFactoryRepositoryAuthorizationClient =
 appFactoryRepositoryAuthorizationClient;
 + }
 +}


 I have locally made the necessary change and then wrote the new plugin
 extending yours and it works as expected (cloning, pushing and UI access
 etc).

 If the above is ok, Shall we include the above..?

 [1]
 https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/appfactory/2.0.0/modules/webapps/gitbilit/appfactory-gitblit-plugin/


 Thanks
 SumedhaS

 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
 Blog: http://sumedhask.blogspot.com/


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





 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
 Blog: http://sumedhask.blogspot.com/





-- 
*Sumedha Kodithuwakku*
Software Engineer
WSO2 Inc. : wso2.com
lean . enterprise . middleware

Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [App Factory] Need to add a setter for appFactoryRepositoryAuthorizationClient in the appfactory-gitblit-plugin's AppFactoryGitBlitUserModel class

2014-05-30 Thread Sumedha Kodithuwakku
Hi Danushka,

The issue is when we override authenticate method in
AppFactoryGitBlitAuthenticationProvider, we have to call the supper method
which will return a AppFactoryGitBlitUserModel which cannot be casted to
the extended one. If we are to get the extended one, we will have to write
our own authenticate method and if we do that we will not get the changes
you may do in future.

Thanks
SumedhaS


On Fri, May 30, 2014 at 3:52 PM, Danushka Fernando danush...@wso2.com
wrote:

 Hi Sumedha
 This fix doesn't seems harmful. So I am ok with adding this to our code if
 its necessary.
 But question I got is since you are writing a plugin extended from our
 code, Isn't it possible to extend AppFactoryGitBlitUserModel and write
 your own and add it there? And IIRC you can configure gitblit to use it.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, May 30, 2014 at 3:39 PM, Sumedha Kodithuwakku sumed...@wso2.com
 wrote:

 Hi AF team,

 We need to extend the appfactory-gitblit-plugin [1] to do some changes so
 that it can authenticate/authorize users with only their email address. So
 basically we want to override authenticate method
 of AppFactoryGitBlitAuthenticationProvider and authorize method in
 AppFactoryRepositoryAuthorizationClient.

 So doing that it was required to set the authorization client in
 the AppFactoryGitBlitUserModel to a custom one. To do that I had to include
 the following setter;

 ---
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java 
 (revision
 204299)
 +++
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java 
 (working
 copy)
 @@ -116,4 +116,7 @@
   return new AppFactoryRepositoryAuthorizationClient(getConfiguration());
   }

 -}
 \ No newline at end of file
 + public void
 setAppFactoryRepositoryAuthorizationClient(AppFactoryRepositoryAuthorizationClient
 appFactoryRepositoryAuthorizationClient) {
 + this.appFactoryRepositoryAuthorizationClient =
 appFactoryRepositoryAuthorizationClient;
 + }
 +}


 I have locally made the necessary change and then wrote the new plugin
 extending yours and it works as expected (cloning, pushing and UI access
 etc).

 If the above is ok, Shall we include the above..?

 [1]
 https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/appfactory/2.0.0/modules/webapps/gitbilit/appfactory-gitblit-plugin/


 Thanks
 SumedhaS

 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
 Blog: http://sumedhask.blogspot.com/


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





-- 
*Sumedha Kodithuwakku*
Software Engineer
WSO2 Inc. : wso2.com
lean . enterprise . middleware

Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [App Factory] Need to add a setter for appFactoryRepositoryAuthorizationClient in the appfactory-gitblit-plugin's AppFactoryGitBlitUserModel class

2014-05-30 Thread Danushka Fernando
In that case +1 to adding this to the plugin, which will make it extensible.

Thanks  Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729


On Fri, May 30, 2014 at 4:37 PM, Sumedha Kodithuwakku sumed...@wso2.com
wrote:

 Hi Danushka,

 The issue is when we override authenticate method in
 AppFactoryGitBlitAuthenticationProvider, we have to call the supper
 method which will return a AppFactoryGitBlitUserModel which cannot be
 casted to the extended one. If we are to get the extended one, we will have
 to write our own authenticate method and if we do that we will not get the
 changes you may do in future.

 Thanks
 SumedhaS


 On Fri, May 30, 2014 at 3:52 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi Sumedha
 This fix doesn't seems harmful. So I am ok with adding this to our code
 if its necessary.
 But question I got is since you are writing a plugin extended from our
 code, Isn't it possible to extend AppFactoryGitBlitUserModel and write
 your own and add it there? And IIRC you can configure gitblit to use it.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, May 30, 2014 at 3:39 PM, Sumedha Kodithuwakku sumed...@wso2.com
 wrote:

 Hi AF team,

 We need to extend the appfactory-gitblit-plugin [1] to do some changes
 so that it can authenticate/authorize users with only their email address.
 So basically we want to override authenticate method
 of AppFactoryGitBlitAuthenticationProvider and authorize method in
 AppFactoryRepositoryAuthorizationClient.

 So doing that it was required to set the authorization client in
 the AppFactoryGitBlitUserModel to a custom one. To do that I had to include
 the following setter;

 ---
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java
  (revision
 204299)
 +++
 src/main/java/org/wso2/carbon/appfactory/git/AppFactoryGitBlitUserModel.java
  (working
 copy)
 @@ -116,4 +116,7 @@
   return new
 AppFactoryRepositoryAuthorizationClient(getConfiguration());
   }

 -}
 \ No newline at end of file
 + public void
 setAppFactoryRepositoryAuthorizationClient(AppFactoryRepositoryAuthorizationClient
 appFactoryRepositoryAuthorizationClient) {
 + this.appFactoryRepositoryAuthorizationClient =
 appFactoryRepositoryAuthorizationClient;
 + }
 +}


 I have locally made the necessary change and then wrote the new plugin
 extending yours and it works as expected (cloning, pushing and UI access
 etc).

 If the above is ok, Shall we include the above..?

 [1]
 https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/appfactory/2.0.0/modules/webapps/gitbilit/appfactory-gitblit-plugin/


 Thanks
 SumedhaS

 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
 Blog: http://sumedhask.blogspot.com/


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





 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124
 Blog: http://sumedhask.blogspot.com/


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