Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-3714: zkperl: Add (Cyrus) SASL authentication support to Perl client #1243

Closed
wants to merge 7 commits into from

Conversation

ztzg
Copy link
Contributor

@ztzg ztzg commented Feb 3, 2020

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a --with-sasl2 flag (and, optionally, header and lib locations):

    perl Makefile.PL \
        --with-sasl2 \
        --sasl2-include=/path/to/sasl2/include \
        --sasl2-lib=/path/to/sasl2/lib

When enabled, Net::ZooKeeper->new(...) admits a new key, sasl_options, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix ZOOKEEPER-3303, which is about compilation issues. The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

@ztzg
Copy link
Contributor Author

ztzg commented Feb 3, 2020

@eolivelli: Should I add you as a reviewer on this? I understand it is not your "domain," but you had some interesting comments about the Perl module on ZOOKEEPER-3303:

Honestly I wasn't aware of the perl module, it is not compiled using neither ant nor the new maven build.
We should definitely and automatic build and tests for the perl module.

(I am willing to help with the integration, but would like to have your comments.)

Also: would you have other reviewers to recommend?

@ztzg
Copy link
Contributor Author

ztzg commented Mar 23, 2020

Dear @eolivelli, @HariSekhon, @chrisd8088, @nrh, @nkalmar, @symat, @enixon:

I understand that Perl might not be the hottest topic in ZooKeeper land, but is there something one of us could do to get this moving?

Cheers, -D

@nkalmar
Copy link
Contributor

nkalmar commented Mar 23, 2020

The sad truth is that most contrib projects gets neglected :(

Honestly, I never run the perl client. If anyone at least familiar with Perl takes a look, I'm willing to commit. Ping me again if no one reviews it in the next few days. I'll at least try to run the client and commit if it seems to work. But I would feel comfortable if someone who at least written at least one line of Perl took a look :)

@Randgalt
Copy link
Member

FYI: I have a gRPC prototype that I've been working on. I feel that the solution to non-JVM languages is gRPC. gRPC does have a Perl binding.

@ztzg
Copy link
Contributor Author

ztzg commented Mar 23, 2020

@Randgalt: I know about it, and generally agree—but the goal of this specific PR is to enable existing Perl programs to SASL-authenticate with current servers while keeping changes to a minimum.

(FWIW, I had a look at your branches, and am "monitoring" ZOOKEEPER-102. Everything looks very promising there, but "ingestion" into a stable ZK release is likely to take a while.)

@ztzg
Copy link
Contributor Author

ztzg commented Mar 23, 2020

retest this please

ztzg added 7 commits March 23, 2020 17:00
Without this, the compiler does not see any of the "Sync API"
prototypes (e.g., zoo_create), and compilation only succeeds in
non-hardenened environments.
…d issues

This allows the binding to build with recent versions of GCC, including
with -Wformat, -Wformat-security, and -Werror=format-security, as
configured in some "hardened" environments.
…rl client

This patch allows one to access the C client Cyrus SASL support
(ZOOKEEPER-1112) from the Perl binding by passing a --with-sasl2
flag (and, optionally, header and lib locations):

    perl Makefile.PL \
        --with-sasl2 \
        --sasl2-include=/path/to/sasl2/include \
        --sasl2-lib=/path/to/sasl2/lib

When enabled, Net::ZooKeeper->new(...) admits a new key,
'sasl_options', which can be used to automatically authenticate with
the server during connections (including reconnects).
@ztzg ztzg force-pushed the ZOOKEEPER-3714-zkperl-sasl-support branch from 4b09d3d to fdcab39 Compare March 23, 2020 16:04
@eolivelli
Copy link
Contributor

@phunt can you take a look please ?

@ztzg
Copy link
Contributor Author

ztzg commented Mar 26, 2020

Now thinking that @symat may be also interested in looking into this.

@symat
Copy link
Contributor

symat commented Mar 26, 2020

I can take a look tomorrow... however, I haven't used much perl either. And also I am not a committer, so my +1 will not mean much :)

@ztzg
Copy link
Contributor Author

ztzg commented Mar 26, 2020

@symat: Not asking you to do extra work! I just thought I'd make you aware of this PR, as I keep seeing you foraging (almost) all dark corners of the ZK code base :)

@ztzg
Copy link
Contributor Author

ztzg commented Apr 6, 2020

@nkalmar: Pinging you again :)

Copy link
Contributor

@nkalmar nkalmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to build and try on linux. LGTM.

@asfgit asfgit closed this in f3c9697 Apr 8, 2020
@nkalmar
Copy link
Contributor

nkalmar commented Apr 8, 2020

pushed to master only, as ZOOKEEPER-1112 is only on that branch.
Thanks @ztzg

@ztzg
Copy link
Contributor Author

ztzg commented Apr 8, 2020

Thanks!

(I would love to have ZOOKEEPER-1112 and this in 3.6.x, btw. Should I prepare a PR?)

stickyhipp pushed a commit to stickyhipp/zookeeper that referenced this pull request Aug 19, 2020
…rl client

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a `--with-sasl2` flag (and, optionally, header and lib locations):

        perl Makefile.PL \
            --with-sasl2 \
            --sasl2-include=/path/to/sasl2/include \
            --sasl2-lib=/path/to/sasl2/lib

When enabled, `Net::ZooKeeper->new(...)` admits a new key, `sasl_options`, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix [ZOOKEEPER-3303](https://issues.apache.org/jira/browse/ZOOKEEPER-3303), which is about compilation issues.  The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

Author: Damien Diederen <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>

Closes apache#1243 from ztzg/ZOOKEEPER-3714-zkperl-sasl-support
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…rl client

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a `--with-sasl2` flag (and, optionally, header and lib locations):

        perl Makefile.PL \
            --with-sasl2 \
            --sasl2-include=/path/to/sasl2/include \
            --sasl2-lib=/path/to/sasl2/lib

When enabled, `Net::ZooKeeper->new(...)` admits a new key, `sasl_options`, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix [ZOOKEEPER-3303](https://issues.apache.org/jira/browse/ZOOKEEPER-3303), which is about compilation issues.  The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

Author: Damien Diederen <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>

Closes apache#1243 from ztzg/ZOOKEEPER-3714-zkperl-sasl-support
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…rl client

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a `--with-sasl2` flag (and, optionally, header and lib locations):

        perl Makefile.PL \
            --with-sasl2 \
            --sasl2-include=/path/to/sasl2/include \
            --sasl2-lib=/path/to/sasl2/lib

When enabled, `Net::ZooKeeper->new(...)` admits a new key, `sasl_options`, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix [ZOOKEEPER-3303](https://issues.apache.org/jira/browse/ZOOKEEPER-3303), which is about compilation issues.  The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

Author: Damien Diederen <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>

Closes apache#1243 from ztzg/ZOOKEEPER-3714-zkperl-sasl-support
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…rl client

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a `--with-sasl2` flag (and, optionally, header and lib locations):

        perl Makefile.PL \
            --with-sasl2 \
            --sasl2-include=/path/to/sasl2/include \
            --sasl2-lib=/path/to/sasl2/lib

When enabled, `Net::ZooKeeper->new(...)` admits a new key, `sasl_options`, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix [ZOOKEEPER-3303](https://issues.apache.org/jira/browse/ZOOKEEPER-3303), which is about compilation issues.  The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

Author: Damien Diederen <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>

Closes apache#1243 from ztzg/ZOOKEEPER-3714-zkperl-sasl-support
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
…rl client

This patch allows one to access the C client Cyrus SASL support (ZOOKEEPER-1112) from the Perl binding by passing a `--with-sasl2` flag (and, optionally, header and lib locations):

        perl Makefile.PL \
            --with-sasl2 \
            --sasl2-include=/path/to/sasl2/include \
            --sasl2-lib=/path/to/sasl2/lib

When enabled, `Net::ZooKeeper->new(...)` admits a new key, `sasl_options`, which can be used to automatically authenticate with the server during connections (including reconnects).

Some of the preparatory work for this contribution, which is available in the other commits, may also fix [ZOOKEEPER-3303](https://issues.apache.org/jira/browse/ZOOKEEPER-3303), which is about compilation issues.  The resulting patch builds with GCC 8.3.0 in a (moderately) "hardened" environment; it also passes all enabled tests.

Author: Damien Diederen <[email protected]>

Reviewers: Norbert Kalmar <[email protected]>

Closes apache#1243 from ztzg/ZOOKEEPER-3714-zkperl-sasl-support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants