SOLR-7648: Expose remote IP and Host via the AuthorizationContext to be used by the authorization plugin.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1684299 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Anshum Gupta 2015-06-09 00:29:27 +00:00
parent 1cf0ee7471
commit 0ba136c880
3 changed files with 21 additions and 0 deletions

View File

@ -174,6 +174,12 @@ Bug Fixes
* SOLR-7588: Fix javascript bug introduced by SOLR-7409 that breaks the
dataimport screen in the admin UI. (Bill Bell via Shawn Heisey)
Other Changes
----------------------
* SOLR-7648: Expose remote IP and Host via the AuthorizationContext to be used by the authorization plugin.
(Ishan Chattopadhyaya via Anshum Gupta)
================== 5.2.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -44,6 +44,10 @@ public abstract class AuthorizationContext {
public abstract Enumeration getHeaderNames();
public abstract String getRemoteAddr();
public abstract String getRemoteHost();
public abstract List<CollectionRequest> getCollectionRequests() ;
public abstract RequestType getRequestType();

View File

@ -50,6 +50,7 @@ import java.util.Set;
* limitations under the License.
*/
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -982,6 +983,16 @@ public class HttpSolrCall {
response.append("], Path: [").append(resource).append("]");
return response.toString();
}
@Override
public String getRemoteAddr() {
return getReq().getRemoteAddr();
}
@Override
public String getRemoteHost() {
return getReq().getRemoteHost();
}
};
}