pg-ldap-sync 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a08af19305647e9c74adbf8d4354f826d95eea24e3ac9d362e1f32df2e347f2e
4
- data.tar.gz: b07f7ef2e6eee98529979b8b935dcf0d1a5b5e29535ba499824b36cfb71ebbca
3
+ metadata.gz: 0d2b110ac0eeff29e7a02739a4756afd30b38436b9c2387da186f0be4b0841d5
4
+ data.tar.gz: b371cb0096dfa5762d794f49ec955c30e55fee908e0b01861f9806e8c5d85e61
5
5
  SHA512:
6
- metadata.gz: ab386f3df54231fd962696446d38ce9cf2fa0bdef9bd383b9e9af72a96eb67527be1bb7ddf09133f80fd92a5e2868e5d07269a87bf0b45d648c732b5ae643017
7
- data.tar.gz: 05631b8dea00b093943017f425cb82dd64edb2323afda113bafee01235368c1526f2386236de84979654c2c495c102ff1e7f441a1538199581730772d5845721
6
+ metadata.gz: f0643dba267c51ceef5c3c5efbd3db17c7a63622573b6ae33d39d6fec254b80b160fe80b6f8179f16c581f11d74f3784873aec55914f7d6a765c4269ccc604ec
7
+ data.tar.gz: 438e1178f11d9b7ff848ec582172f5a21b3a6269ea763370aa31a74b5d5c6ed097ea6ba975d466ab1df54907374ff5f7350ed94ac701b28eeae2db129b187634
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,6 +1,18 @@
1
1
  name: CI
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: "0 1 2 * *" # At 01:00 on the second day of each month - https://crontab.guru/#0_1_2_*_*
7
+ push:
8
+ branches:
9
+ - master
10
+ tags:
11
+ - "*.*.*"
12
+ pull_request:
13
+ types: [opened, synchronize]
14
+ branches:
15
+ - "*"
4
16
 
5
17
  jobs:
6
18
  job_test_gem:
@@ -11,23 +23,23 @@ jobs:
11
23
  include:
12
24
  - os: windows
13
25
  ruby: "head"
14
- PGVERSION: 15.1-1-windows-x64
15
- PGVER: "15"
26
+ PGVERSION: 17.0-1-windows-x64
27
+ PGVER: "17"
16
28
  - os: windows
17
29
  ruby: "2.4"
18
30
  PGVERSION: 9.4.26-1-windows-x64
19
31
  PGVER: "9.4"
20
32
  - os: ubuntu
21
33
  ruby: "head"
22
- PGVER: "15"
34
+ PGVER: "17"
23
35
  - os: ubuntu
24
- os_ver: "20.04"
36
+ os_ver: "22.04"
25
37
  ruby: "2.3"
26
38
  PGVER: "9.3"
27
39
  - os: macos
28
40
  ruby: "head"
29
- PGVERSION: 15.1-1-osx
30
- PGVER: "15"
41
+ PGVERSION: 17.0-1-osx
42
+ PGVER: "17"
31
43
 
32
44
  runs-on: ${{ matrix.os }}-${{ matrix.os_ver || 'latest' }}
33
45
  env:
@@ -52,7 +64,7 @@ jobs:
52
64
 
53
65
  $(new-object net.webclient).DownloadFile("http://get.enterprisedb.com/postgresql/postgresql-$env:PGVERSION-binaries.zip", "postgresql-binaries.zip")
54
66
  Unzip "postgresql-binaries.zip" "."
55
- echo "$pwd/pgsql/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
67
+ echo "$env:RI_DEVKIT$env:MINGW_PREFIX/bin;$env:RI_DEVKIT/usr/bin;$pwd/pgsql/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
56
68
  echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
57
69
  echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
58
70
  md temp
@@ -73,6 +85,7 @@ jobs:
73
85
  wget https://get.enterprisedb.com/postgresql/postgresql-$PGVERSION-binaries.zip && \
74
86
  sudo mkdir -p /Library/PostgreSQL && \
75
87
  sudo unzip postgresql-$PGVERSION-binaries.zip -d /Library/PostgreSQL/$PGVER && \
88
+ sudo mv /Library/PostgreSQL/$PGVER/pgsql/* /Library/PostgreSQL/$PGVER/ && \
76
89
  echo /Library/PostgreSQL/$PGVER/bin >> $GITHUB_PATH
77
90
 
78
91
  - run: bundle install
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ ruby_version: 2.3
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
+ ## 0.5.2 / 2025-09-01
2
+
3
+ * Replace `kwalify` by `json-schema` to remove hundreds of warnings about keyword arguments in modern Ruby. #51
4
+ * Allow ERb syntax in config file. #52
5
+ This can be used to insert password from environment variable like so: `password: <%= ENV["PASSWORD"] %>`
6
+ * Update documentation.
7
+
8
+
9
+ ## 0.5.1 / 2025-03-22
10
+
11
+ * Add dependent gems for compat with ruby-3.5
12
+ * Add predefined roles for compat with PostgreSQL-16 and 17
13
+
14
+
1
15
  ## 0.5.0 / 2023-08-24
2
16
 
3
- * Add Kerberos and NTLM authentication support
17
+ * Add Kerberos and NTLM authentication support to LDAP connection
4
18
  * Fix retrieval of groups with over 1500 users in Active Directory server. #45
5
19
 
6
20
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  [![Build Status](https://app.travis-ci.com/larskanis/pg-ldap-sync.svg?branch=master)](https://app.travis-ci.com/larskanis/pg-ldap-sync) [![Build status](https://ci.appveyor.com/api/projects/status/09xn9q5p64jbxtka/branch/master?svg=true)](https://ci.appveyor.com/project/larskanis/pg-ldap-sync/branch/master)
2
2
 
3
- # Use LDAP permissions in PostgreSQL
3
+ # Sync users and groups from LDAP to PostgreSQL
4
4
 
5
- * http://github.com/larskanis/pg-ldap-sync
5
+ * https://github.com/larskanis/pg-ldap-sync
6
6
 
7
7
  ## DESCRIPTION:
8
8
 
@@ -27,7 +27,7 @@ It is meant to be started as a cron job.
27
27
  * Set scope of considered users/groups on LDAP and PG side
28
28
  * Test mode which doesn't do any changes to the DBMS
29
29
  * Both LDAP and PG connections can be secured by SSL/TLS
30
- * NTLM and Kerberos authentication to LDAP server
30
+ * Password, NTLM and Kerberos authentication to LDAP server
31
31
 
32
32
  ## REQUIREMENTS:
33
33
 
@@ -37,23 +37,31 @@ It is meant to be started as a cron job.
37
37
 
38
38
  ## INSTALL:
39
39
 
40
+ pg-ldap-sync is included in Ubuntu-22.04 and Debian-11 and newer.
41
+ It can be installed by
42
+
43
+ ```sh
44
+ sudo apt install ruby-pg-ldap-sync
45
+ ```
46
+
47
+ ### Install from source
48
+
40
49
  Install Ruby:
41
50
 
42
- * on Windows: http://rubyinstaller.org
43
- * on Debian/Ubuntu: `apt-get install ruby libpq-dev`
51
+ * on Windows: https://rubyinstaller.org
52
+ * on Debian/Ubuntu: `apt-get install ruby`
44
53
 
45
54
  Install pg-ldap-sync and required dependencies:
46
55
  ```sh
47
- gem install pg-ldap-sync
56
+ gem install pg-ldap-sync
48
57
  ```
49
58
 
50
59
  ### Install from Git:
51
60
  ```sh
52
- git clone https://github.com/larskanis/pg-ldap-sync.git
53
- cd pg-ldap-sync
54
- gem install bundler
55
- bundle install
56
- bundle exec rake install
61
+ git clone https://github.com/larskanis/pg-ldap-sync.git
62
+ cd pg-ldap-sync
63
+ bundle install
64
+ bundle exec rake install
57
65
  ```
58
66
 
59
67
  ## USAGE:
@@ -65,11 +73,11 @@ or even better
65
73
 
66
74
  Run in test-mode:
67
75
  ```sh
68
- pg_ldap_sync -c my_config.yaml -vv -t
76
+ pg_ldap_sync -c my_config.yaml -vv -t
69
77
  ```
70
78
  Run in modify-mode:
71
79
  ```sh
72
- pg_ldap_sync -c my_config.yaml -vv
80
+ pg_ldap_sync -c my_config.yaml -vv
73
81
  ```
74
82
 
75
83
  It is recommended to avoid granting permissions to synchronized users on the PostgreSQL server, but to grant permissions to groups instead.
@@ -80,9 +88,9 @@ This is because `DROP USER` statements invoked when a user leaves otherwise fail
80
88
  ## TEST:
81
89
  There is a small test suite in the `test` directory that runs against an internal LDAP server and a PostgreSQL server. Ensure `pg_ctl`, `initdb` and `psql` commands are in the `PATH` like so:
82
90
  ```sh
83
- cd pg-ldap-sync
84
- bundle install
85
- PATH=$PATH:/usr/lib/postgresql/10/bin/ bundle exec rake test
91
+ cd pg-ldap-sync
92
+ bundle install
93
+ PATH=$PATH:/usr/lib/postgresql/10/bin/ bundle exec rake test
86
94
  ```
87
95
 
88
96
  ## ISSUES:
data/Rakefile CHANGED
@@ -10,4 +10,4 @@ Rake::TestTask.new(:test) do |t|
10
10
  t.test_files = FileList["test/**/test_*.rb"]
11
11
  end
12
12
 
13
- task :gem => :build
13
+ task gem: :build
data/appveyor.yml CHANGED
@@ -1,4 +1,4 @@
1
- image: Visual Studio 2019
1
+ image: Visual Studio 2022
2
2
 
3
3
  init:
4
4
  - set PATH=C:/Ruby%ruby_version%/bin;c:/Program Files/Git/cmd;c:/Windows/system32;C:/Windows/System32/WindowsPowerShell/v1.0
@@ -21,7 +21,8 @@ test_script:
21
21
 
22
22
  environment:
23
23
  matrix:
24
+ # ruby-3.3.6 currently fails installing stringio-3.1.5.gem
25
+ # - ruby_version: "33-x64"
26
+ # PGVER: 16
24
27
  - ruby_version: "27-x64"
25
- PGVER: 13
26
- - ruby_version: "24"
27
- PGVER: 10
28
+ PGVER: 11
@@ -3,7 +3,7 @@
3
3
  # is considered as LDAP-synchronized.
4
4
 
5
5
  # Connection parameters to LDAP server
6
- # see also: http://net-ldap.rubyforge.org/Net/LDAP.html#method-c-new
6
+ # see also: https://www.rubydoc.info/gems/net-ldap/Net%2FLDAP:initialize
7
7
  ldap_connection:
8
8
  host: ldapserver
9
9
  port: 389
@@ -44,7 +44,7 @@ ldap_groups:
44
44
  member_attribute: member
45
45
 
46
46
  # Connection parameters to PostgreSQL server
47
- # see also: http://rubydoc.info/gems/pg/PG/Connection#initialize-instance_method
47
+ # see also: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
48
48
  pg_connection:
49
49
  host:
50
50
  dbname: postgres
@@ -9,7 +9,7 @@
9
9
  #
10
10
 
11
11
  # Connection parameters to LDAP server
12
- # see also: http://net-ldap.rubyforge.org/Net/LDAP.html#method-c-new
12
+ # see also: https://www.rubydoc.info/gems/net-ldap/Net%2FLDAP:initialize
13
13
  ldap_connection:
14
14
  host: ldapserver
15
15
  port: 636
@@ -45,7 +45,7 @@ ldap_groups:
45
45
  member_attribute: member
46
46
 
47
47
  # Connection parameters to PostgreSQL server
48
- # see also: http://rubydoc.info/gems/pg/PG/Connection#initialize-instance_method
48
+ # see also: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
49
49
  pg_connection:
50
50
  host:
51
51
  dbname: postgres
data/config/schema.yaml CHANGED
@@ -1,74 +1,78 @@
1
- type: map
2
- mapping:
3
- "ldap_connection":
4
- type: any
5
- required: yes
1
+ "$schema": "http://json-schema.org/draft-04/schema#"
2
+ "id": "https://github.com/larskanis/pg-ldap-sync/blob/-/config/schema.yaml"
3
+ title: pg-ldap-sync config file
4
+ type: object
5
+ required:
6
+ - ldap_connection
7
+ - ldap_users
8
+ - ldap_groups
9
+ - pg_connection
10
+ - pg_users
11
+ - pg_groups
12
+ properties:
13
+ ldap_connection:
14
+ type: object
6
15
 
7
- "ldap_users":
8
- type: map
9
- required: yes
10
- mapping:
11
- "base":
12
- type: str
13
- required: yes
14
- "filter":
15
- type: str
16
- required: yes
17
- "name_attribute":
18
- type: str
19
- required: yes
20
- "lowercase_name":
21
- type: bool
22
- required: no
23
- "bothcase_name":
24
- type: bool
25
- required: no
16
+ ldap_users:
17
+ type: object
18
+ required:
19
+ - base
20
+ - filter
21
+ - name_attribute
22
+ properties:
23
+ base:
24
+ type: string
25
+ filter:
26
+ type: string
27
+ name_attribute:
28
+ type: string
29
+ lowercase_name:
30
+ type: boolean
31
+ bothcase_name:
32
+ type: boolean
26
33
 
27
- "ldap_groups":
28
- type: map
29
- required: yes
30
- mapping:
31
- "base":
32
- type: str
33
- required: yes
34
- "filter":
35
- type: str
36
- required: yes
37
- "name_attribute":
38
- type: str
39
- required: yes
40
- "lowercase_name":
41
- type: bool
42
- required: no
43
- "bothcase_name":
44
- type: bool
45
- required: no
46
- "member_attribute":
47
- type: str
48
- required: yes
34
+ ldap_groups:
35
+ type: object
36
+ required:
37
+ - base
38
+ - filter
39
+ - name_attribute
40
+ - member_attribute
41
+ properties:
42
+ base:
43
+ type: string
44
+ filter:
45
+ type: string
46
+ name_attribute:
47
+ type: string
48
+ lowercase_name:
49
+ type: boolean
50
+ bothcase_name:
51
+ type: boolean
52
+ member_attribute:
53
+ type: string
49
54
 
50
- "pg_connection":
51
- type: any
52
- required: yes
55
+ pg_connection:
56
+ type: object
53
57
 
54
- "pg_users":
55
- type: map
56
- required: yes
57
- mapping:
58
- "filter":
59
- type: str
60
- required: yes
61
- "create_options":
62
- type: str
58
+ pg_users:
59
+ type: object
60
+ required:
61
+ - filter
62
+ properties:
63
+ filter:
64
+ type: string
65
+ create_options:
66
+ type: ["string", "null"]
63
67
 
64
- "pg_groups":
65
- type: map
66
- required: yes
67
- mapping:
68
- "filter":
69
- type: str
70
- required: yes
71
- "create_options":
72
- type: str
73
- "grant_options":
74
- type: str
68
+ pg_groups:
69
+ type: object
70
+ required:
71
+ - filter
72
+ properties:
73
+ filter:
74
+ type: string
75
+ create_options:
76
+ type: ["string", "null"]
77
+ grant_options:
78
+ type: ["string", "null"]
data/exe/pg_ldap_sync CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'pg_ldap_sync'
3
+ require "pg_ldap_sync"
4
4
 
5
5
  begin
6
6
  PgLdapSync::Application.run(ARGV)