[jira] [Commented] (NUTCH-2289) SSL Support for REST API

2016-07-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NUTCH-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15376001#comment-15376001
 ] 

ASF GitHub Bot commented on NUTCH-2289:
---

Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/136#discussion_r70727192
  
--- Diff: src/java/org/apache/nutch/api/NutchServer.java ---
@@ -113,19 +114,43 @@ public NutchServer() {
 component = new Component();
 component.getLogger().setLevel(Level.parse(logLevel));
 
-// Add a new HTTP server listening on defined port.
-component.getServers().add(Protocol.HTTP, port);
+AuthenticationTypeEnum authenticationType = 
configManager.get(ConfigResource.DEFAULT).getEnum("restapi.auth", 
AuthenticationTypeEnum.NONE);
+
+if (authenticationType == AuthenticationTypeEnum.SSL) {
+  // Add a new HTTPS server listening on defined port.
+  Server server = component.getServers().add(Protocol.HTTPS, port);
+
+  Series parameters = server.getContext().getParameters();
+  parameters.add("sslContextFactory", 
"org.restlet.engine.ssl.DefaultSslContextFactory");
+
+  String keyStorePath = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.storepath", 
"etc/nutch-ssl.keystore.jks");
+  parameters.add("keyStorePath", keyStorePath);
+
+  String keyStorePassword = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.storepass", "password");
+  parameters.add("keyStorePassword", keyStorePassword);
+
+  String keyPassword = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.keypass", "password");
+  parameters.add("keyPassword", keyPassword);
+
+  parameters.add("keyStoreType", "JKS");
+  LOG.info("SSL Authentication is set for NutchServer");
+} else {
+  // Add a new HTTP server listening on defined port.
+  component.getServers().add(Protocol.HTTP, port);
+}
 
 Context childContext = component.getContext().createChildContext();
 JaxRsApplication application = new JaxRsApplication(childContext);
 application.add(this);
 application.setStatusService(new ErrorStatusService());
 childContext.getAttributes().put(NUTCH_SERVER, this);
 
-AuthenticationTypeEnum authenticationType = 
configManager.get(ConfigResource.DEFAULT).getEnum("restapi.auth", 
AuthenticationTypeEnum.NONE);
-
 switch (authenticationType) {
   case NONE:
+  case SSL:
 // Attach the application without security
--- End diff --

Is this comment correct? 'Attach the application without security'???


> SSL Support for REST API
> 
>
> Key: NUTCH-2289
> URL: https://issues.apache.org/jira/browse/NUTCH-2289
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.5
>
>
> Add SSL Authentication for Nutch REST API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] nutch pull request #136: NUTCH-2289 SSL support for Nutch 2.X REST API.

2016-07-13 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/136#discussion_r70727192
  
--- Diff: src/java/org/apache/nutch/api/NutchServer.java ---
@@ -113,19 +114,43 @@ public NutchServer() {
 component = new Component();
 component.getLogger().setLevel(Level.parse(logLevel));
 
-// Add a new HTTP server listening on defined port.
-component.getServers().add(Protocol.HTTP, port);
+AuthenticationTypeEnum authenticationType = 
configManager.get(ConfigResource.DEFAULT).getEnum("restapi.auth", 
AuthenticationTypeEnum.NONE);
+
+if (authenticationType == AuthenticationTypeEnum.SSL) {
+  // Add a new HTTPS server listening on defined port.
+  Server server = component.getServers().add(Protocol.HTTPS, port);
+
+  Series parameters = server.getContext().getParameters();
+  parameters.add("sslContextFactory", 
"org.restlet.engine.ssl.DefaultSslContextFactory");
+
+  String keyStorePath = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.storepath", 
"etc/nutch-ssl.keystore.jks");
+  parameters.add("keyStorePath", keyStorePath);
+
+  String keyStorePassword = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.storepass", "password");
+  parameters.add("keyStorePassword", keyStorePassword);
+
+  String keyPassword = configManager.get(ConfigResource.DEFAULT)
+  .get("restapi.auth.ssl.keypass", "password");
+  parameters.add("keyPassword", keyPassword);
+
+  parameters.add("keyStoreType", "JKS");
+  LOG.info("SSL Authentication is set for NutchServer");
+} else {
+  // Add a new HTTP server listening on defined port.
+  component.getServers().add(Protocol.HTTP, port);
+}
 
 Context childContext = component.getContext().createChildContext();
 JaxRsApplication application = new JaxRsApplication(childContext);
 application.add(this);
 application.setStatusService(new ErrorStatusService());
 childContext.getAttributes().put(NUTCH_SERVER, this);
 
-AuthenticationTypeEnum authenticationType = 
configManager.get(ConfigResource.DEFAULT).getEnum("restapi.auth", 
AuthenticationTypeEnum.NONE);
-
 switch (authenticationType) {
   case NONE:
+  case SSL:
 // Attach the application without security
--- End diff --

Is this comment correct? 'Attach the application without security'???


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (NUTCH-2289) SSL Support for REST API

2016-07-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NUTCH-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375894#comment-15375894
 ] 

ASF GitHub Bot commented on NUTCH-2289:
---

GitHub user kamaci opened a pull request:

https://github.com/apache/nutch/pull/136

NUTCH-2289 SSL support for Nutch 2.X REST API.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kamaci/nutch NUTCH-2289-3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nutch/pull/136.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #136


commit cc83ecd48cc5ea97001e4948591da8e2c3e85f60
Author: Furkan KAMACI 
Date:   2016-07-13T22:20:34Z

NUTCH-2289 SSL support for Nutch 2.X REST API.




> SSL Support for REST API
> 
>
> Key: NUTCH-2289
> URL: https://issues.apache.org/jira/browse/NUTCH-2289
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.5
>
>
> Add SSL Authentication for Nutch REST API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] nutch pull request #136: NUTCH-2289 SSL support for Nutch 2.X REST API.

2016-07-13 Thread kamaci
GitHub user kamaci opened a pull request:

https://github.com/apache/nutch/pull/136

NUTCH-2289 SSL support for Nutch 2.X REST API.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kamaci/nutch NUTCH-2289-3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nutch/pull/136.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #136


commit cc83ecd48cc5ea97001e4948591da8e2c3e85f60
Author: Furkan KAMACI 
Date:   2016-07-13T22:20:34Z

NUTCH-2289 SSL support for Nutch 2.X REST API.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[Nutch Wiki] Update of "GoogleSummerOfCode/SecurityLayer/WeeklyReports" by kamaci

2016-07-13 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Nutch Wiki" for change 
notification.

The "GoogleSummerOfCode/SecurityLayer/WeeklyReports" page has been changed by 
kamaci:
https://wiki.apache.org/nutch/GoogleSummerOfCode/SecurityLayer/WeeklyReports?action=diff&rev1=9&rev2=10

  === Next Steps ===
  Add SSL support for Nutch 2.x
  
+ == Week 10 (27 June 2016 - 3 July 2016) ==
  
+ === Checklist ===
+ SSL support is added for Nutch 2.x
+ 
+ === Next Steps ===
+ Start authorization implementation for Nutch 2.x
+ 
+ 


[jira] [Resolved] (NUTCH-2285) Digest Authentication Support for REST API

2016-07-13 Thread Lewis John McGibbney (JIRA)

 [ 
https://issues.apache.org/jira/browse/NUTCH-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lewis John McGibbney resolved NUTCH-2285.
-
   Resolution: Fixed
Fix Version/s: (was: 2.5)
   2.4

Nice work [~kamaci]

> Digest Authentication Support for REST API
> --
>
> Key: NUTCH-2285
> URL: https://issues.apache.org/jira/browse/NUTCH-2285
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.4
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NUTCH-2285) Digest Authentication Support for REST API

2016-07-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NUTCH-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375706#comment-15375706
 ] 

ASF GitHub Bot commented on NUTCH-2285:
---

Github user asfgit closed the pull request at:

https://github.com/apache/nutch/pull/135


> Digest Authentication Support for REST API
> --
>
> Key: NUTCH-2285
> URL: https://issues.apache.org/jira/browse/NUTCH-2285
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.4
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] nutch pull request #135: NUTCH-2285 Digest Authentication support for Nutch ...

2016-07-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nutch/pull/135


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (NUTCH-2285) Digest Authentication Support for REST API

2016-07-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NUTCH-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375701#comment-15375701
 ] 

ASF GitHub Bot commented on NUTCH-2285:
---

GitHub user kamaci opened a pull request:

https://github.com/apache/nutch/pull/135

NUTCH-2285 Digest Authentication support for Nutch 2.X REST API.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kamaci/nutch NUTCH-2285-3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nutch/pull/135.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #135


commit 04eb5707e47fc286bee4625a02d79be15c0d0a3e
Author: Furkan KAMACI 
Date:   2016-07-13T20:34:46Z

NUTCH-2285 Digest Authentication support for Nutch 2.X REST API.




> Digest Authentication Support for REST API
> --
>
> Key: NUTCH-2285
> URL: https://issues.apache.org/jira/browse/NUTCH-2285
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.5
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NUTCH-2285) Digest Authentication Support for REST API

2016-07-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NUTCH-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375700#comment-15375700
 ] 

ASF GitHub Bot commented on NUTCH-2285:
---

Github user kamaci closed the pull request at:

https://github.com/apache/nutch/pull/132


> Digest Authentication Support for REST API
> --
>
> Key: NUTCH-2285
> URL: https://issues.apache.org/jira/browse/NUTCH-2285
> Project: Nutch
>  Issue Type: Sub-task
>  Components: REST_api, web gui
>Reporter: Furkan KAMACI
>Assignee: Furkan KAMACI
> Fix For: 2.5
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] nutch pull request #135: NUTCH-2285 Digest Authentication support for Nutch ...

2016-07-13 Thread kamaci
GitHub user kamaci opened a pull request:

https://github.com/apache/nutch/pull/135

NUTCH-2285 Digest Authentication support for Nutch 2.X REST API.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kamaci/nutch NUTCH-2285-3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nutch/pull/135.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #135


commit 04eb5707e47fc286bee4625a02d79be15c0d0a3e
Author: Furkan KAMACI 
Date:   2016-07-13T20:34:46Z

NUTCH-2285 Digest Authentication support for Nutch 2.X REST API.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request #132: NUTCH-2285 Digest Authentication support for Nutch ...

2016-07-13 Thread kamaci
Github user kamaci closed the pull request at:

https://github.com/apache/nutch/pull/132


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---