Josh, thanks for the advice on this project!

I think the bits I am looking for are this:
From RegionServerCoprocessorHost.java 
{https://github.com/apache/hbase/blob/f63a7ff635fa02a8a97d9a36505732f647d2e7ff/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java#L73-L81}:
"
    // If a CoreCoprocessor, return a 'richer' environment, one laden with 
RegionServerServices.
    return instance.getClass().isAnnotationPresent(CoreCoprocessor.class)?
      new RegionServerEnvironmentForCoreCoprocessors(instance, priority, 
sequence, conf,
this.rsServices):
"

I see AccessController.java is annotated with:
@CoreCoprocessor
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)
public class AccessController implements MasterCoprocessor, RegionCoprocessor,

This does beg the question to me, should the coprocessor environment provide 
visibility of the requester though; it seems there might be other use-cases 
than core HBase's access controller? (Anyone have one, e.g. if a request is 
on-machine or network local, etc.?)

-Clay

From: [email protected] At: 09/21/18 17:37:21To:  [email protected]
Subject: Re: HBase 2.x getRegionServerServices for Client IPAddress Access

Hi Josh,

Erg, I see all my MUA stripped my in-line links from the original mail; sorry 
for the lack of context.

Yes, the RpcServer API is intact. But I don't see how to get access to an 
RpcServer object from a coprocessor now?

Previously, I would have done on my coprocessor's environment object 
getRegionServerSerivces(): 
({https://hbase.apache.org/1.2/apidocs/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.html#getRegionServerServices--})

But now that API call has gone 
away:({https://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.html})?

Sorry if I'm being dense but I don't see a way to get access outside the scope 
of the coprocessor to get the handler thread's RPC without 
getRegionServerServices()?

-Clay

From: [email protected] At: 09/21/18 17:25:49To:  [email protected]
Subject: Re: HBase 2.x getRegionServerServices for Client IPAddress Access

Hey Clay!

Looking at branch-2.0, I am seeing RpcServer#getRemoteAddress() or 
RpcServer#getRemoteIp() which are static calls that you should be able 
to execute in the Master or RegionServer (when running in the context of 
an Rpc handler thread, that is.

On 9/21/18 11:12 AM, Clay Baenziger (BLOOMBERG/ 731 LEX) wrote:
> Hi all,
> 
> I've been playing around trying to add client location based ACL controls. 
> (Akin to the GRANT user@<network specifier> type of access one has in MySQL, 
> et. al.) My nascent work has been on HBase 1.x but I missed that 
> getRegionServerSerivces went away in 2.x[1]. Is there a way to now get to the 
> RpcServer for a getRemoteIp() call from e.g. AccessController now that anyone 
> can think of or should I propose adding a get remoteIp() method for the 
> coprocessor environments?
> 
> -Clay
> 
> [1]: At least that's what I gather by:
> * HBase 1.2 RegionCoprocessorEnvironment JavaDocs vs current JavaDocs
> * The discussion in and referenced by HBASE-19007
> 


Reply via email to