whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: comments for 'A' classses
Date Sat, 17 Jun 2017 22:03:24 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 8729bb7  comments for 'A' classses
8729bb7 is described below

commit 8729bb7834ca756fc0071d03de67b26798fa5200
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Jun 17 18:03:10 2017 -0400

    comments for 'A' classses
---
 lib/whimsy/asf/auth.rb |  7 +++++++
 lib/whimsy/asf/ldap.rb |  6 +++++-
 lib/whimsy/asf/rack.rb | 22 ++++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/auth.rb b/lib/whimsy/asf/auth.rb
index 158c5a6..1091ff6 100644
--- a/lib/whimsy/asf/auth.rb
+++ b/lib/whimsy/asf/auth.rb
@@ -1,16 +1,23 @@
 module ASF
 
+  # parse the <tt>-authorization-template</tt> files contained within
+  # <tt>infrastructure-puppet/modules/subversion_server/files/authorization</tt>
   class Authorization
     include Enumerable
 
+    # Return the set of authorizations a given user (availid) has access to.
     def self.find_by_id(value)
       new.select {|auth, ids| ids.include? value}.map(&:first)
     end
 
+    # Select a given <tt>-authorization-template</tt>, valid values are
+    # <tt>asf</tt> and <tt>pit</tt>.
     def initialize(file='asf')
       @file = file
     end
 
+    # Iteratively return each entry in the authorization file as a pair
+    # of values: a name and list of ids.
     def each
       # TODO - should this read the Git repo directly?
       auth = ASF::Git.find('infrastructure-puppet')
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index a72cb1b..46fedd8 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -1028,14 +1028,18 @@ module ASF
     end
   end
 
+  # <tt>ou=apps</tt> subtree of <tt>ou=groups,dc=apache,dc=org</tt>,
currently
+  # only used for <tt>hudson-jobadmin</tt>
   class AppGroup < Service
     @base = 'ou=apps,ou=groups,dc=apache,dc=org'
   end
 
+  # <tt>ou=auth</tt> subtree of <tt>ou=groups,dc=apache,dc=org</tt>,
used for
+  # subprojects and a variety of organizational constructs (accounting,
+  # exec-officers, fundraising, trademarks, ...)
   class AuthGroup < Service
     @base = 'ou=auth,ou=groups,dc=apache,dc=org'
   end
-
 end
 
 if __FILE__ == $0
diff --git a/lib/whimsy/asf/rack.rb b/lib/whimsy/asf/rack.rb
index 7da0771..1387847 100644
--- a/lib/whimsy/asf/rack.rb
+++ b/lib/whimsy/asf/rack.rb
@@ -4,6 +4,8 @@ require 'etc'
 require 'thread'
 
 module ASF
+  # Rack support for HTTP Authorization, contains a number of classes that
+  # can be <tt>use</tt>d within a <tt>config.ru</tt> of a Passenger
application.
   module Auth
     # decode HTTP authorization, when present
     def self.decode(env)
@@ -27,10 +29,13 @@ module ASF
     # 'use' the following class in config.ru to limit access
     # to the application to ASF committers
     class Committers < Rack::Auth::Basic
+      # Specify 'ASF Committers' as the HTTP auth Realm
       def initialize(app)
         super(app, "ASF Committers", &proc {})
       end
 
+      # Returns <tt>unauthorized</tt> unless running in test mode or
+      # the authenticated user is an ASF Committer
       def call(env)
         authorized = ( ENV['RACK_ENV'] == 'test' )
 
@@ -47,11 +52,17 @@ module ASF
     # 'use' the following class in config.ru to limit access
     # to the application to ASF members and officers and the accounting group.
     class MembersAndOfficers < Rack::Auth::Basic
+      # Specify 'ASF Members and Officers' as the HTTP auth Realm
       def initialize(app, &block)
         super(app, "ASF Members and Officers", &proc {})
         @block = block 
       end
 
+      # Returns <tt>unauthorized</tt> unless running in test mode or
+      # the authenticated user is an ASF Member, a PMC Chair, or if a
+      # block is specified on the <tt>new</tt> call, and that block
+      # returns a <tt>true</tt> value.  Block is used by the board agenda
+      # to allow invited guests to see the agenda.
       def call(env)
         authorized = ( ENV['RACK_ENV'] == 'test' )
 
@@ -83,6 +94,10 @@ module ASF
   class AutoGC
     @@background = nil
 
+    # Define the frequency with which GC should be run (as in every 'n'
+    # requests), and the maximum number of idle minutes between GC runs.
+    # This class also will make use of PhusionPassenger's out of band GC,
+    # if available.
     def initialize(app, frequency=100, minutes=15)
       @app = app
       @frequency = frequency
@@ -118,6 +133,11 @@ module ASF
       end
     end
 
+    # Rack middleware used to push an object onto the queue prior to the
+    # request (this stops AutoGC from running during the request), and popping
+    # it afterward the request completes.  Also will spin off a thread to
+    # run GC after the reply completes (using rack.after_reply if available),
+    # otherwise using a standard Thread.
     def call(env)
       @queue.push 1
 
@@ -139,6 +159,8 @@ module ASF
       @queue.pop
     end
 
+    # Run GC when no requests are active and after every <tt>@frequency</tt>
+    # events.  
     def maybe_perform_gc
       @mutex.synchronize do
         @request_count += 1

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message