whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Add cross-check of LDAP members and owners
Date Wed, 11 Jul 2018 08:11:00 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 18ce055  Add cross-check of LDAP members and owners
18ce055 is described below

commit 18ce055215b1f98ccd7b18abfe7bfe41ae57de00
Author: Sebb <sebb@apache.org>
AuthorDate: Wed Jul 11 09:10:58 2018 +0100

    Add cross-check of LDAP members and owners
---
 www/index.html               |  1 +
 www/secretary/ldap-check.cgi | 91 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git a/www/index.html b/www/index.html
index 11e005e..8656e71 100644
--- a/www/index.html
+++ b/www/index.html
@@ -181,6 +181,7 @@
               <ul>
                 <li><a href="secretary/workbench/">Secretary Workbench</a></li>
                 <li><a href="secretary/icla-lint">Lint test for iclas.txt</a></li>
+                <li><a href="secretary/ldap-check">LDAP members and owners checks</a></li>
                 <li><a href="secretary/memapp_check">Check members.txt against
members_apps</a></li>
                 <li><a href="secretary/public-names">Public names: LDAP vs icla.txt</a></li>
                 <li><a href="secretary/response-time">Response time test</a></li>
diff --git a/www/secretary/ldap-check.cgi b/www/secretary/ldap-check.cgi
new file mode 100755
index 0000000..6e50f3d
--- /dev/null
+++ b/www/secretary/ldap-check.cgi
@@ -0,0 +1,91 @@
+#!/usr/bin/env ruby
+
+=begin
+
+Compare LDAP lists
+
+project.memberids should agree with Group.memberids (if it exixts)
+project.ownerids should agree with Committee.memberids (if it exists)
+=end
+
+$LOAD_PATH.unshift '/srv/whimsy/lib'
+
+require 'whimsy/asf'
+require 'wunderbar'
+
+_html do
+  _style %{
+    table {border-collapse: collapse}
+    table, th, td {border: 1px solid black}
+    td {padding: 3px 6px}
+    tr:hover td {background-color: #FF8}
+    th {background-color: #a0ddf0}
+  }
+
+  _h1 'LDAP membership checks'
+
+  _p do
+    _ 'LDAP project members must agree with corresponding (unix) group members'
+    _ 'LDAP project owners must agree with corresponding committee members'
+    _ 'The lists below show the differences, if any'
+  end
+  
+  _table do
+    _tr do
+      _th 'Project'
+      _th 'GuineaPig?'
+      _th 'project members - group members'
+      _th 'group members - project members'
+      _th 'project owners - committee members'
+      _th 'committee-members - project owners'
+    end
+    projects = ASF::Project.list
+    
+    projects.sort_by(&:name).each do |p|
+      po_co=[]
+      co_po=[]
+      pm_um=[]
+      um_pm=[]
+      if c=ASF::Committee[p.name] # we have PMC 
+        po=p.ownerids
+        co=c.ownerids
+        po_co=po-co
+        co_po=co-po
+      end
+      if u=ASF::Group[p.name] # we have the unix group
+        pm=p.memberids
+        um=u.memberids
+        pm_um=pm-um
+        um_pm=um-pm
+      end
+      if pm_um.size > 0 or um_pm.size > 0 or po_co.size > 0 or co_po.size > 0
+        _tr do
+          _td do
+            _a p.name, href: '/roster/committee/' + p.name
+          end
+          _td ASF::Committee.isGuineaPig?(p.name)
+          _td do
+            pm_um.each do |id|
+              _a id, href: '/roster/committer/' + id
+            end
+          end
+          _td do
+            um_pm.each do |id|
+              _a id, href: '/roster/committer/' + id
+            end
+          end
+          _td do
+            po_co.each do |id|
+              _a id, href: '/roster/committer/' + id
+            end
+          end
+          _td do
+            co_po.each do |id|
+              _a id, href: '/roster/committer/' + id
+            end
+          end
+        end
+      end
+    end
+  end
+end
\ No newline at end of file


Mime
View raw message