bookkeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matteo Merli <mme...@yahoo-inc.com>
Subject Re: How to implement a custom Auth Provider
Date Wed, 19 Oct 2016 22:37:59 GMT
Hi Enrico, 
yes the shading of protobuf is a bit of a problem. A possible solution would be to include
the implementation in BookKeeper itself, if it's of general interest. 
Another approach, could be to release both shaded and unshaded jars for bookkeeper-server
artifact.

Matteo 

    On Wednesday, October 19, 2016 9:41 AM, Sijie Guo <sijie@apache.org> wrote:
 

 I think we also need to think a solution on how to prevent this kind of shade behavior. It
is not good to expose shade classes to any public interface.

- Sijie

On Wed, Oct 19, 2016 at 9:40 AM, Sijie Guo <sijie@apache.org> wrote:

Ah, good catch, Enrico.

It is really bad for this behavior. I think it should be fine to break the code backward compatibility
for this interface.

- Sijie

On Wed, Oct 19, 2016 at 8:02 AM, Enrico Olivelli <eolivelli@gmail.com> wrote:

Hi,
I'm going to implement a custom AuthProvider for BookKeeper, I have
come to a showstopper:
ClientAuthProvider.Factory depends on Protobuf ExtensionRegistry,
which is shaded inside the BooKeeper JAR

A custom provider will look like the code below, this is not good,
because my code needs to depend on an "hidden" dependency of BK.

I can file a JIRA and propose a fix, but any fix need to break
compatibilty with existing custom Providers (But I assume that no
implemention can actually exist, outside a fork of BookKeeper)

What do you think ?

This is an example

public class CustomProvider implements ClientAuthProvider.Factory {

    @Override
    public void init(ClientConfiguration cc,
bk-shade.com.google.protobuf.E xtensionRegistry er) throws IOException
{
        throw new UnsupportedOperationException( "Not supported yet.");
//To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ClientAuthProvider newProvider(InetSocketAddress isa,
BookkeeperInternalCallbacks.Ge nericCallback<Void> gc) {
        throw new UnsupportedOperationException( "Not supported yet.");
//To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public String getPluginName() {
        throw new UnsupportedOperationException( "Not supported yet.");
//To change body of generated methods, choose Tools | Templates.
    }

}






   
Mime
View raw message