Giter VIP home page Giter VIP logo

sasl_auth's Introduction

sasl_auth

sasl_auth is a simple wrapper for cyrus sasl library. It helps to implement SASL GSSAPI auth mechanism support in your Erlang application.

Dependencies

Ubuntu

On Ubuntu the following packages should be installed to build and use sasl_auth: libkrb5, libkrb5-dev, libsasl2, libsasl2-dev, libsasl2-modules-gssapi-mit.

See the dockerfiles in scripts/setup_and_run_rebar3_ct_in_docker for information about which packages are needed for other Linux distributions.

Redhat based distributions

Redhat 7 based distribution or compatabile

The following packages are required on Redhat 7 based or compatible distributions : cyrus-sasl, cyrus-sasl-devel, cyrus-sasl-gssapi, krb5-devel, and krb5-libs.

Use either yum or dnf (depending on redhat base version) to install cyrus-sasl, cyrus-sasl-gssapi, and krb5-libs.

yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi krb5-devel krb5-libs

Redhat 8 based distributions or compatabile

The following packages are required on Redhat 8 based or compatible distributions : cyrus-sasl-libs, cyrus-sasl-devel, cyrus-sasl-gssapi, krb5-devel, and krb5-libs.

dnf install cyrus-sasl-libs cyrus-sasl-devel cyrus-sasl-gssapi krb5-devel krb5-libs

Mac OS

Install cyrus-sasl via homebrew, this includes the gssapi module, as well MIT krb5 as a dependency :

brew install cyrus-sasl

Build

$ rebar3 compile

Test

You can execute the tests with the following command (if you have Docker installed):

$ `./scripts/setup_and_run_rebar3_ct_in_docker.sh`

By default, the script above runs the test in a docker container that is created from a docker image that is described in the file scripts/setup_and_run_rebar3_ct_in_docker/Dockerfile.ubuntu22.04. You can change the dockerfile by specifying the environment variable SASL_AUTH_DOCKER_FILE. The following command will run the tests in a Centos7 docker image:

$ `SASL_AUTH_DOCKER_FILE=scripts/setup_and_run_rebar3_ct_in_docker/Dockerfile.centos7 ./scripts/setup_and_run_rebar3_ct_in_docker.sh`

You can execute the following command to run the tests in a docker container with Erlang/OTP and the NIF library compiled with address sanitizer (finds memory errors and leaks):

$ `./scripts/setup_and_run_rebar3_ct_in_docker.sh` asan

It is a little bit more complicated to run the tests without Docker and the exact steps may depend on the operating system you are using. The following steps outlines what needs to be done:

  1. Install necessary packages

    • The dockerfile scripts/setup_and_run_rebar3_ct_in_docker/Dockerfile.ubuntu22.04 contains information about which packages need to be installed in Ubuntu.
  2. Configure a Kerberos server and create a keytab for a user

    • This can be done by following the steps in scripts/setup_and_run_rebar3_ct_in_docker/setup_and_run.sh until the command echo RUN TESTS.
  3. Export and set the following environment variables to appropriate values:

    export SASL_AUTH_TEST_HOST=example.com  # Host that Kerberos is running on
    export SASL_AUTH_TEST_PRINCIPAL=user  # A user name
    export SASL_AUTH_TEST_KEY_TAB=user.keytab  # Keytab for user
    
  4. Run the tests:

    rebar3 ct

Use

sasl_auth is used in brod_gssapi (a GSSAPI authentication backend for the Apache Kafka client library for Erlang/Elixir brod. See usage details in the README file for brod_gssapi.

sasl_auth's People

Contributors

chvish avatar elmaxo avatar f3c0 avatar kjellwinblad avatar starbelly avatar terry-xiaoyu avatar zmstone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.