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 e067cf9 Cross-ref id validation routines
e067cf9 is described below
commit e067cf94477b1c661bce5d84e7c23ba223e143c6
Author: Sebb <[email protected]>
AuthorDate: Sat Mar 2 10:53:46 2019 +0000
Cross-ref id validation routines
---
lib/whimsy/asf/icla.rb | 3 +++
lib/whimsy/asf/mail.rb | 3 +++
2 files changed, 6 insertions(+)
diff --git a/lib/whimsy/asf/icla.rb b/lib/whimsy/asf/icla.rb
index 8fd81ab..88ce8c7 100644
--- a/lib/whimsy/asf/icla.rb
+++ b/lib/whimsy/asf/icla.rb
@@ -212,17 +212,20 @@ module ASF
end
# list of all availids that are are taken or reserved
+ # See also ASF::Mail.taken?
def self.availids_taken()
self.availids_reserved + self.availids
end
# is the availid taken (in use or reserved)?
+ # See also ASF::Mail.taken?
def self.taken?(id)
return self.availids_reserved.include?(id) ||
self.availids.include?(id)
end
# is the id available?
+ # See also ASF::Mail.taken?
def self.available?(id)
return ! self.taken?(id)
end
diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index e3548c0..c8a6bc1 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -125,11 +125,14 @@ module ASF
end
end
+ # List of .qmail files that could clash with user ids (See: INFRA-14566)
def self.qmail_ids
return [] unless File.exist? '/srv/subscriptions/qmail.ids'
File.read('/srv/subscriptions/qmail.ids').split
end
+ # Is the id used by qmail?
+ # See also ASF::ICLA.taken?
def self.taken?(id)
self.qmail_ids.include? id
end