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 b0112588 Allow for digests in private/security checks
b0112588 is described below
commit b01125884acd739f2dccf174e2f2f57dd51ff9c9
Author: Sebb <[email protected]>
AuthorDate: Sun May 7 23:49:48 2023 +0100
Allow for digests in private/security checks
---
lib/whimsy/asf/mlist.rb | 31 +++++++++++++++++++++++++------
www/roster/models/committer.rb | 5 ++++-
www/roster/views/person/main.js.rb | 2 --
www/roster/views/pmc/members.js.rb | 4 ----
www/roster/views/ppmc/members.js.rb | 2 --
5 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index dbe6b1b2..c8a5d3a9 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -41,7 +41,8 @@ module ASF
return list_filter('sub', 'apache.org', 'members-notify', archivers),
File.mtime(LIST_TIME)
end
- # Return an array of private@pmc subscribers followed by the file update
time
+ # Return an array of private@pmc subscribers (including digests) followed
by the file update time
+ # Returns nil if the subs file does not exist
# By default does not return the standard archivers
# pmc can either be a pmc name, in which case it uses
private@<pmc>.apache.org
# or it can be an ASF list name, e.g. [email protected]
@@ -49,17 +50,35 @@ module ASF
return [] unless Dir.exist? LIST_BASE
parts = pmc.split('@', 3) # want to detect trailing '@'
if parts.length == 1
- return list_filter('sub', "#{pmc}.apache.org", 'private', archivers),
File.mtime(LIST_TIME)
+ dom = "#{pmc}.apache.org"
+ list = 'private'
elsif parts.length == 2 && parts[1] == 'apache.org'
- return list_filter('sub', parts[1], parts[0], archivers),
File.mtime(LIST_TIME)
+ dom = parts[1]
+ list = parts[0]
else
raise "Unexpected parameter: #{pmc}"
end
- end
+ subs = list_filter('sub', dom, list, archivers)
+ digs = list_filter('digest', dom, list, archivers)
+ if subs.nil?
+ subs = digs # may also be nil
+ elsif !digs.nil? # i.e. neither nil, so merge
+ subs = (subs + digs).uniq
+ end
+ return subs, File.mtime(LIST_TIME)
+ end
+ # Return security subscribers (including digests)
def self.security_subscribers(pmc, archivers=false)
return [] unless Dir.exist? LIST_BASE
- return list_filter('sub', "#{pmc}.apache.org", 'security', archivers),
File.mtime(LIST_TIME)
+ subs = list_filter('sub', "#{pmc}.apache.org", 'security', archivers)
+ digs = list_filter('digest', "#{pmc}.apache.org", 'security', archivers)
+ if subs.nil?
+ subs = digs # may also be nil
+ elsif !digs.nil? # i.e. neither nil, so merge
+ subs = (subs + digs).uniq
+ end
+ return subs, File.mtime(LIST_TIME)
end
# return a hash of subscriptions for the list of emails provided
@@ -321,7 +340,7 @@ module ASF
# Filter the appropriate list, matching on domain and list
# Params:
- # - type: 'mod' or 'sub' or 'dig'
+ # - type: 'mod' or 'sub' or 'digest' or 'allow'
# - matchdom: must match the domain (e.g. 'httpd.apache.org')
# - matchlist: must match the list (e.g. 'dev')
# - archivers: whether to include standard ASF archivers (default true)
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index 67176e04..415fc037 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -215,7 +215,10 @@ class Committer
if response[:subscriptions] # did we get access to the mail?
pmail = "private@#{pmc.mail_list}.apache.org" rescue ''
subbed = false
- response[:subscriptions].each do |sub|
+ subs = response[:subscriptions]
+ digs = response[:digests]
+ subs += digs if digs
+ subs.each do |sub|
if sub[0] == pmail
subbed = true
end
diff --git a/www/roster/views/person/main.js.rb
b/www/roster/views/person/main.js.rb
index df1cb8f7..6354f04c 100644
--- a/www/roster/views/person/main.js.rb
+++ b/www/roster/views/person/main.js.rb
@@ -58,8 +58,6 @@ class Person < Vue
_ '(*) could not find a subscription to the private@ mailing
list for this PMC'
_br
_ 'Perhaps the subscription address is not listed in the LDAP
record'
- _br
- _ '(Note that digest subscriptions are not currently included)'
}
end
end
diff --git a/www/roster/views/pmc/members.js.rb
b/www/roster/views/pmc/members.js.rb
index 1c0a1aa9..cf6e26f2 100644
--- a/www/roster/views/pmc/members.js.rb
+++ b/www/roster/views/pmc/members.js.rb
@@ -51,8 +51,6 @@ class PMCMembers < Vue
_br
_ 'Or they could be ex-PMC members who are still subscribed.'
_br
- _ '(Note that digest subscriptions are not currently included)'
- _br
_br
_ul {
unknownSubs.each do |sub|
@@ -114,8 +112,6 @@ class PMCMembers < Vue
_br
_ 'Or they could be ex-PMC members who are still subscribed.'
_br
- _ '(Note that digest subscriptions are not currently included)'
- _br
_br
_ul {
unknownSecSubs.each do |sub|
diff --git a/www/roster/views/ppmc/members.js.rb
b/www/roster/views/ppmc/members.js.rb
index 7953f37c..5864eabc 100644
--- a/www/roster/views/ppmc/members.js.rb
+++ b/www/roster/views/ppmc/members.js.rb
@@ -46,8 +46,6 @@ class PPMCMembers < Vue
_br
_ 'Or they could be ex-PPMC members who are still subscribed.'
_br
- _ '(Note that digest subscriptions are not currently included)'
- _br
_br
_ul {
unknownSubs.each do |sub|