You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/03/09 18:12:33 UTC
[whimsy.git] [1/1] Commit f8b4407: reuse auth parser
Commit f8b440731ff98fe11851babd5ab1990a595cb273:
reuse auth parser
Branch: refs/heads/reuse-auth-parser
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@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]