Giter VIP home page Giter VIP logo

paddle's Introduction

Paddle

hex.pm version Build Status Inline docs

A library simplifying LDAP usage in Elixir projects.

Documentation

Why another LDAP library?

If you want to communicate with an LDAP server in Elixir, you probably know that there are other libraries out there. However, I didn't find one that suited me:

  • The :eldap library is great, but very low-level, with no high-level features.

  • EctoLdap is very interesting, but I needed the add / modify / delete operations (in fact, I even wanted to do an Ecto adapter at first).

  • Exldap and LDAPEx are both a translation of the LDAP :eldap in Elixir, which is nice, but are still missing some higher-level features.

Usage

Once installed and configured, it allows you to quickly authenticate users:

iex> Paddle.authenticate("myUser", "password")
:ok

Get meaningful information using Paddle.Class structs:

iex> Paddle.get %MyApp.PosixAccount{uid: "myUser"}
{:ok,
 [%MyApp.PosixAccount{cn: ["My User"], description: nil,
   gecos: ["My User,,,,"], gidNumber: ["120"],
   homeDirectory: ["/home/myuser"], host: nil, l: nil,
   loginShell: ["/bin/bash"], o: nil, ou: nil, seeAlso: nil, uid: ["myUser"],
   uidNumber: ["500"],
   userPassword: ["{SSHA}AIzygLSXlArhAMzddUriXQxf7UlkqopP"]}]}

Or get information just about anything:

iex> Paddle.get base: [ou: "People"], filter: [objectClass: "organizationalUnit"]
{:ok,
 [%{"dn" => "ou=People,dc=test,dc=com",
    "objectClass" => ["top", "organizationalUnit"], "ou" => ["People"]}]}

Add, delete, modify operations are supported. If you want to know more, just go to the documentation.

Installation

The package can be installed as:

  1. Add paddle to your list of dependencies in mix.exs:

    def deps do
      [{:paddle, "~> 0.1.0"}]
    end
  2. Ensure paddle is started before your application:

    def application do
      [applications: [:paddle]]
    end
  3. Add your configuration in your config files:

    config :paddle, Paddle,
      host: "ldap.my-organisation.org",
      base: "dc=myorganisation,dc=org",
      ssl: true,
      port: 636

    For more configurations, see the Paddle module docmumentation.

Testing

If you want to test this application, you can use the linux commands described in the .travis.yml file in the before_script block to start a local test LDAP server.

Keep in mind that you may need to change the .travis/ldap/slapd.conf for your system by changing some configuration paths.

If you want to add some more data to the test server, please feel free to issue a pull request.

paddle's People

Contributors

minijackson avatar kleylima avatar dependabot-preview[bot] avatar gmile avatar shamanime avatar rbino avatar srivathsanmurali avatar

Watchers

James Cloos 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.