whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit f8b4407: reuse auth parser
Date Wed, 09 Mar 2016 17:12:33 GMT
Commit f8b440731ff98fe11851babd5ab1990a595cb273:
    reuse auth parser


Branch: refs/heads/reuse-auth-parser
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/roster/public_nonldap_groups.rb                          | ++ ----------
------------------------------------------------------------
12 changes: 2 additions, 10 deletions.
------------------------------------------------------------


diff --git a/www/roster/public_nonldap_groups.rb b/www/roster/public_nonldap_groups.rb
index 7189fd4..9f6d223 100644
--- a/www/roster/public_nonldap_groups.rb
+++ b/www/roster/public_nonldap_groups.rb
@@ -22,24 +22,16 @@
 
 require_relative 'public_json_common'
 
-require 'net/http'
 pods = Hash[ASF::Podlings.list.map {|podling| [podling.name, podling.status]}]
 
-file = '/apache/infrastructure-puppet/deployment/modules/subversion_server/files/authorization/asf-authorization-template'
-http = Net::HTTP.new('raw.githubusercontent.com', 443)
-http.use_ssl = true
-body = http.request(Net::HTTP::Get.new(file)).body
-  .sub(/^.*\[groups\]\s*$/m,'')
-  .sub(/^\[\/\].*/m,'')
-
 groups = {}
 
 # find the locally defined groups
-body.scan(/^(\w[^=\s]*)[ \t]*=[ \t]*(\w.*)$/) do |grp, mem|
+ASF::Authorization.new('asf').each do |grp, mem|
   groups[grp] = {
       # we use same syntax as for normal groups
       # this will allow future expansion e.g. if we can flag podlings somehow
-      roster: mem.gsub(/\s/,'').split(/,/).sort.uniq
+      roster: mem.sort.uniq
       }
   # add podling type entry if there is one
   groups[grp][:podling] = pods[grp] if pods[grp]

Mime
View raw message