diff --git a/Manifest.txt b/Manifest.txt index af91cb5..06a3b1a 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,10 +1,14 @@ .autotest History.txt Manifest.txt -README.txt +README.rdoc Rakefile bin/pg_ldap_sync -config/config.yaml +config/sample-config.yaml +config/schema.yaml lib/pg_ldap_sync.rb lib/pg_ldap_sync/application.rb +test/fixtures/config-ldapdb.yaml +test/fixtures/ldapdb.yaml +test/ldap_server.rb test/test_pg_ldap_sync.rb diff --git a/README.rdoc b/README.rdoc index 25b012f..deff4fc 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,25 +1,35 @@ = Use LDAP permissions in PostgreSQL -* https://github.com/larskanis/pg-ldap-sync +* Homepage: http://github.com/larskanis/pg-ldap-sync == DESCRIPTION: -PostgreSQL offers different authentication methods, like LDAP, SSPI, GSSAPI or SSL. -For any method the user must already exist in the database, before -the authentication can be used. LDAP is often used to do a centralized -user and role management in an enterprise environment. +LDAP is often used to do a centralized user and role management +in an enterprise environment. PostgreSQL offers different +authentication methods, like LDAP, SSPI, GSSAPI or SSL. +However, for any method the user must already exist in the database, +before the authentication can be used. There is currently +no authorization of database users directly based on LDAP. -This program synchronizes users, groups and memberships from LDAP to -PostgreSQL. +This program solves the issue by synchronizing users, groups and +memberships from LDAP to PostgreSQL. +It is meant to be started as a cron job. == FEATURES/PROBLEMS: -* Use Active Directory as LDAP-Server * Configurable per YAML config file +* Use Active Directory as LDAP-Server +* Runs with pg.gem (C-library) or postgres-pr.gem (pure Ruby) +* Should run on any platform when using postgres-pr.gem + +* There is currently no way to set certain user attributes in PG + based on individual attributes in LDAP == SYNOPSIS: - pg_ldap_sync -vv -t +Create a config file based on config/sample-config.yaml . + + pg_ldap_sync -c my_config.yaml -vv -t == REQUIREMENTS: @@ -33,13 +43,24 @@ Install Ruby and rubygems: * apt-get install ruby rubygems on Debian Install pg-ldap-sync and a database driver for PostgreSQL: -* gem install pg-ldap-sync postgres-pr +* gem install pg-ldap-sync pg +* or gem install pg-ldap-sync postgres-pr for the + pure ruby version with less connection options than pg Or install from Git: git clone https://github.com/larskanis/pg-ldap-sync.git cd pg-ldap-sync rake install_gem +== TEST: +There is a small test suite in the test directory that runs +against an internal ruby-ldapserver and PostgreSQL server. Ensure gem +ruby-ldapserver is installed and pg_ctl, initdb and psql +commands are in the PATH. Then: + + cd pg-ldap-sync + rake test + == LICENSE: diff --git a/Rakefile b/Rakefile index e543e12..a99e97f 100644 --- a/Rakefile +++ b/Rakefile @@ -5,9 +5,13 @@ require 'hoe' Hoe.spec 'pg-ldap-sync' do developer('Lars Kanis', 'kanis@comcard.de') - + extra_deps << ['net-ldap', '>= 0.2'] extra_deps << ['kwalify', '>= 0.7'] + + self.readme_file = 'README.rdoc' + spec_extras[:rdoc_options] = ['--main', readme_file, "--charset=UTF-8"] + self.extra_rdoc_files << self.readme_file end # vim: syntax=ruby