Giter Club home page Giter Club logo

javert's Introduction

Javert

A LDAP mapper-ish library to build ruby classes that connect to LDAP objects.

Why?

Javert was created with a very narrow scope in mind. The initial focus was to be able to pull user and group data out of Active Directory without some of the pain that comes along with querying Active Directory/LDAP.

Required knowledge

One should hope to have a basic understanding of LDAP - mainly OU's, objectClasses, attributes.

Requirements

  • ActiveModel 3.0
  • ActiveSupport 3.0
  • Net-Ldap 0.2-ish

Installation

TODO

Usage

An example user class mapping into Active Directory

class User
  include Javert::Entity

  attribute :cn, :as => :full_name
  attribute :givenName, :as => first_name
  attribute :sn, :as => :last_name
  attribute :mail
  
  set_object_class "user" # The actual objectClass in AD/LDAP
  @@conf = { 
    :host => "localhost", 
    :port => "389", 
    :auth => {
      :method => :simple,
      :username => "ldap_user",
      :password => "password"
    }
    :base => "ou=Users"
  }
end

IRB Output

irb(main):031:0> User.attributes
=> ["location", "hiredate", "title", "id", "last_name", "full_name", "department", "email", "first_name"]

irb(main):032:0> User.ldap_attributes
=> ["l", "hiredate", "title", "employeeid", "sn", "cn", "department", "mail", "givenName"]

irb(main):036:0> User.attribute_map
=> {"location"=>"l", "hiredate"=>"hiredate", "title"=>"title", "id"=>"employeeid", "last_name"=>"sn", "full_name"=>"cn", "department"=>"department", "email"=>"mail", "first_name"=>"givenName"}

Problems or Questions?

TODO

TODO List

  • Pull connection information into a common configuration file
  • Handle multi-value attributes (memberof, etc.)
  • Various other things I can't think of right now
  • Should this accept query parameter arrays?
  • Better handling of symbols vs strings for keys

javert's People

Contributors

climyao avatar

Stargazers

 avatar

Watchers

 avatar LSI IT - Development avatar  avatar

Forkers

climyao

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.