[GitHub] nutch pull request #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75560664
  
--- Diff: src/java/org/apache/nutch/api/security/SecurityUtil.java ---
@@ -0,0 +1,100 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+import org.apache.nutch.api.ConfManager;
+import org.apache.nutch.api.resources.ConfigResource;
+import org.restlet.ext.jaxrs.JaxRsApplication;
+import org.restlet.security.MapVerifier;
+import org.restlet.security.MemoryRealm;
+import org.restlet.security.Role;
+import org.restlet.security.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Utility class for Security Operations
+ *
+ */
+public final class SecurityUtil {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(SecurityUtil.class);
+
+  /**
+   * Private constructor to prevent instantiation
+   */
+  private SecurityUtil() {
+  }
+
+  public static List getRoles(JaxRsApplication application) {
--- End diff --

Fixed


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75559208
  
--- Diff: src/java/org/apache/nutch/api/security/SecurityUtil.java ---
@@ -0,0 +1,100 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+import org.apache.nutch.api.ConfManager;
+import org.apache.nutch.api.resources.ConfigResource;
+import org.restlet.ext.jaxrs.JaxRsApplication;
+import org.restlet.security.MapVerifier;
+import org.restlet.security.MemoryRealm;
+import org.restlet.security.Role;
+import org.restlet.security.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Utility class for Security Operations
+ *
+ */
+public final class SecurityUtil {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(SecurityUtil.class);
+
+  /**
+   * Private constructor to prevent instantiation
+   */
+  private SecurityUtil() {
+  }
+
+  public static List getRoles(JaxRsApplication application) {
--- End diff --

Javadoc


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75559156
  
--- Diff: ivy/ivy.xml ---
@@ -76,10 +76,10 @@
 
 
 
-
-
-
-
+
--- End diff --

That's fine. Thank you for explaining.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554363
  
--- Diff: src/java/org/apache/nutch/api/resources/AdminResource.java ---
@@ -20,14 +20,12 @@
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import javax.ws.rs.*;
--- End diff --

I've added it to upcoming commit.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554347
  
--- Diff: conf/nutch-default.xml ---
@@ -1447,20 +1447,12 @@
 
 
 
-  restapi.auth.username
-  admin
+  restapi.auth.users
+  admin|admin|admin,user|user|user
   
-Username for REST API authentication. restapi.auth property should be 
set to either BASIC or DIGEST to use this property.
-"admin" is used for username as default.
-  
-
-
-
-  restapi.auth.password
-  nutch
-  
-Password for REST API authentication. restapi.auth property should be 
set to either BASIC or DIGEST to use this property.
-"nutch" is used for password as default.
+Username, password and role combination for REST API 
authentication/authorization. restapi.auth property should be set to either 
BASIC or DIGEST to use this property.
+Username, password and role should be delimited by pipe character (|) 
Every user should be separated with comma character (,). i.e. 
admin|admin|admin,user|user|user.
+Default is admin|admin|admin.
--- End diff --

I've added it to upcoming commit.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554375
  
--- Diff: src/java/org/apache/nutch/api/security/SecurityUtil.java ---
@@ -0,0 +1,101 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+import org.apache.nutch.api.ConfManager;
+import org.apache.nutch.api.NutchServer;
+import org.apache.nutch.api.resources.ConfigResource;
+import org.restlet.ext.jaxrs.JaxRsApplication;
+import org.restlet.security.MapVerifier;
+import org.restlet.security.MemoryRealm;
+import org.restlet.security.Role;
+import org.restlet.security.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Utility class for Security Operations
+ *
+ */
+public final class SecurityUtil {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(NutchServer.class);
+
+  /**
+   * Private constructor to prevent instantiation
+   */
+  private SecurityUtil() {
+  }
+
+  public static List getRoles(JaxRsApplication application) {
+List roles = new ArrayList<>();
+for (AuthorizationRoleEnum authorizationRole : 
AuthorizationRoleEnum.values()) {
+  roles.add(new org.restlet.security.Role(application, 
authorizationRole.toString()));
+}
+return roles;
+  }
+
+  /**
+   * Constructs realm
+   *
+   * @param application {@link org.restlet.ext.jaxrs.JaxRsApplication 
}application
+   * @param configManager {@link org.apache.nutch.api.ConfManager} type 
config manager
+   * @return realm
+   */
+  public static MemoryRealm constructRealm(JaxRsApplication application, 
ConfManager configManager){
+MemoryRealm realm = new MemoryRealm();
+MapVerifier mapVerifier = new MapVerifier();
+String[] users = 
configManager.get(ConfigResource.DEFAULT).getTrimmedStrings("restapi.auth.users",
 "admin|admin|admin");
+if (users.length <= 1) {
+  throw new IllegalStateException("Check users definition of 
restapi.auth.users at nutch-site.xml ");
+}
+for (String userconf : users) {
+  String[] userDetail = userconf.split("\\|");
+  if(userDetail.length != 3) {
+LOG.error("Check user definition of restapi.auth.users at 
nutch-site.xml");
+throw new IllegalStateException("Check user definition of 
restapi.auth.users at nutch-site.xml ");
+  }
+  User user = new User(userDetail[0], userDetail[1]);
+  mapVerifier.getLocalSecrets().put(user.getIdentifier(), 
user.getSecret());
+  realm.getUsers().add(user);
+  realm.map(user, Role.get(application, userDetail[2]));
+  LOG.info("User added: " + userDetail[0]);
--- End diff --

I've added it to upcoming commit.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554369
  
--- Diff: src/java/org/apache/nutch/api/security/AuthorizationRoleEnum.java 
---
@@ -0,0 +1,37 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+/**
+ * Authorization Roles enum
+ */
+public enum AuthorizationRoleEnum {
+  USER("user"),
+  ADMIN("admin");
+
+  private final String value;
+
+  AuthorizationRoleEnum(String value) {
--- End diff --

I've added it to upcoming commit.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554351
  
--- Diff: ivy/ivy.xml ---
@@ -76,10 +76,10 @@
 
 
 
-
-
-
-
+
--- End diff --

I had to solve very challenging tasks to solve authorization at 
NutchServer. When you construct dependencies of Nutch you will see that jersey 
1.9 is used and it is to dangerous to upgrade it to newer major version: 2.x.

When you use jersey 2.x you have an ability to use @RolesAllowed, @Priority 
or ContainerRequestFilter etc. but you can't do it with current dependency 
complexity at Nutch. 

You can use filters with restlet 2.3.7 for authorization but I couldn't not 
use restlet 2.3.7 (I've reverted the version to 2.2.3) because restlet 2.3.7 
forces you to use jersey 2.x when you want to use such filters.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
Github user kamaci commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75554359
  
--- Diff: src/java/org/apache/nutch/api/NutchServer.java ---
@@ -52,9 +53,8 @@
 import org.restlet.data.Reference;
 import org.restlet.ext.jaxrs.JaxRsApplication;
 import org.restlet.resource.ClientResource;
-import org.restlet.security.ChallengeAuthenticator;
+import org.restlet.security.*;
--- End diff --

I've added it to upcoming commit.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75551083
  
--- Diff: src/java/org/apache/nutch/api/security/SecurityUtil.java ---
@@ -0,0 +1,101 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+import org.apache.nutch.api.ConfManager;
+import org.apache.nutch.api.NutchServer;
+import org.apache.nutch.api.resources.ConfigResource;
+import org.restlet.ext.jaxrs.JaxRsApplication;
+import org.restlet.security.MapVerifier;
+import org.restlet.security.MemoryRealm;
+import org.restlet.security.Role;
+import org.restlet.security.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Utility class for Security Operations
+ *
+ */
+public final class SecurityUtil {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(NutchServer.class);
+
+  /**
+   * Private constructor to prevent instantiation
+   */
+  private SecurityUtil() {
+  }
+
+  public static List getRoles(JaxRsApplication application) {
+List roles = new ArrayList<>();
+for (AuthorizationRoleEnum authorizationRole : 
AuthorizationRoleEnum.values()) {
+  roles.add(new org.restlet.security.Role(application, 
authorizationRole.toString()));
+}
+return roles;
+  }
+
+  /**
+   * Constructs realm
+   *
+   * @param application {@link org.restlet.ext.jaxrs.JaxRsApplication 
}application
+   * @param configManager {@link org.apache.nutch.api.ConfManager} type 
config manager
+   * @return realm
+   */
+  public static MemoryRealm constructRealm(JaxRsApplication application, 
ConfManager configManager){
+MemoryRealm realm = new MemoryRealm();
+MapVerifier mapVerifier = new MapVerifier();
+String[] users = 
configManager.get(ConfigResource.DEFAULT).getTrimmedStrings("restapi.auth.users",
 "admin|admin|admin");
+if (users.length <= 1) {
+  throw new IllegalStateException("Check users definition of 
restapi.auth.users at nutch-site.xml ");
+}
+for (String userconf : users) {
+  String[] userDetail = userconf.split("\\|");
+  if(userDetail.length != 3) {
+LOG.error("Check user definition of restapi.auth.users at 
nutch-site.xml");
+throw new IllegalStateException("Check user definition of 
restapi.auth.users at nutch-site.xml ");
+  }
+  User user = new User(userDetail[0], userDetail[1]);
+  mapVerifier.getLocalSecrets().put(user.getIdentifier(), 
user.getSecret());
+  realm.getUsers().add(user);
+  realm.map(user, Role.get(application, userDetail[2]));
+  LOG.info("User added: " + userDetail[0]);
--- End diff --

Parameterized logging please


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75550918
  
--- Diff: src/java/org/apache/nutch/api/security/AuthorizationRoleEnum.java 
---
@@ -0,0 +1,37 @@

+/***
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
**/
+package org.apache.nutch.api.security;
+
+/**
+ * Authorization Roles enum
+ */
+public enum AuthorizationRoleEnum {
+  USER("user"),
+  ADMIN("admin");
+
+  private final String value;
+
+  AuthorizationRoleEnum(String value) {
--- End diff --

Javadoc please


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75550714
  
--- Diff: src/java/org/apache/nutch/api/NutchServer.java ---
@@ -52,9 +53,8 @@
 import org.restlet.data.Reference;
 import org.restlet.ext.jaxrs.JaxRsApplication;
 import org.restlet.resource.ClientResource;
-import org.restlet.security.ChallengeAuthenticator;
+import org.restlet.security.*;
--- End diff --

Can you please use individual imports?


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75550782
  
--- Diff: src/java/org/apache/nutch/api/resources/AdminResource.java ---
@@ -20,14 +20,12 @@
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import javax.ws.rs.*;
--- End diff --



Can you please use individual imports?



---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75550693
  
--- Diff: ivy/ivy.xml ---
@@ -76,10 +76,10 @@
 
 
 
-
-
-
-
+
--- End diff --

What is the requirement to downgrade?


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/142#discussion_r75550659
  
--- Diff: conf/nutch-default.xml ---
@@ -1447,20 +1447,12 @@
 
 
 
-  restapi.auth.username
-  admin
+  restapi.auth.users
+  admin|admin|admin,user|user|user
   
-Username for REST API authentication. restapi.auth property should be 
set to either BASIC or DIGEST to use this property.
-"admin" is used for username as default.
-  
-
-
-
-  restapi.auth.password
-  nutch
-  
-Password for REST API authentication. restapi.auth property should be 
set to either BASIC or DIGEST to use this property.
-"nutch" is used for password as default.
+Username, password and role combination for REST API 
authentication/authorization. restapi.auth property should be set to either 
BASIC or DIGEST to use this property.
+Username, password and role should be delimited by pipe character (|) 
Every user should be separated with comma character (,). i.e. 
admin|admin|admin,user|user|user.
+Default is admin|admin|admin.
--- End diff --

Are you sure that 'admin|admin|admin' is the default. To me, based on the 
above it looks like 'admin|admin|admin,user|user|user' is the default.


---
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 #142: NUTCH-2294 Authorization Support for REST API

2016-08-19 Thread kamaci
GitHub user kamaci opened a pull request:

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

NUTCH-2294 Authorization Support for REST API



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

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

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

https://github.com/apache/nutch/pull/142.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 #142


commit 0b4210d8d38bb67f6da206f1900379ecdc8010fe
Author: Furkan KAMACI 
Date:   2016-08-19T20:48:58Z

NUTCH-2294 Authorization Support for 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.
---