Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > SVN: r685 - trunk/current/src

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

current
Discussion topic

Back to topic list

SVN: r685 - trunk/current/src

Reply

Author jjneely at EOS dot NCSU dot EDU
Full name jjneely at EOS dot NCSU dot EDU
Date 2005-02-14 18:56:49 PST
Message Author: jjneely at EOS dot NCSU dot EDU
Date: 2005-02-14 21:56:43 -0500 (Mon, 14 Feb 2005)
New Revision: 685

Modified:
   trunk/current/src/auth.py
   trunk/current/src/cu​rrent_apache.py
   trunk/current/src/he​aderParse.py
Log:
Hook back up parsing of the header with the client's channel information.


Modified: trunk/current/src/auth.py
====================​====================​====================​=======
--- trunk/current/src/auth.py 2005-02-14 05:00:53 UTC (rev 684)
+++ trunk/current/src/auth.py 2005-02-15 02:56:43 UTC (rev 685)
@@ -16,7 +16,8 @@
 
 import exception
 import configure
-import ConstructParser
+
+from headerParse import *
 from logger import *
 
 # Program global authorization object setup by main().
@@ -184,13 +185,12 @@
         attr = 'X-RHN-Auth-Channels'
         if not headers.has_key(attr):
             raise AuthException("Missing authentication header: %s" % attr)
-
- # Parsing this header is not easy. Screw it. The server
- # knows the valid channels for this client from the DB
- # and the client knows because we told it. Don't parse.
- self.data['X-RHN-Aut​h-Channels'] = []
-
 
+ # This was really harry...now nice and clean
+ fsm = FSMParser(headers['X​-RHN-Auth-Channels']​)
+ self.data['X-RHN-Aut​h-Channels'] = fsm.parse()
+
+
     def setTimeValues(self):
         """ Set all the time related fields of the HeadersId. """
 
@@ -216,8 +216,8 @@
             str = str + self.data[attr]
 
         # Can't append a list of lists to a string
- #for chan in self.data['X-RHN-Aut​h-Channels']:
- # str = str + chan[0] + ':' + chan[1]
+ for chan in self.data['X-RHN-Aut​h-Channels']:
+ str = str + chan[0] + ':' + chan[1]
 
         sum = sha.new(str)
         return sum.hexdigest()

Modified: trunk/current/src/cu​rrent_apache.py
====================​====================​====================​=======
--- trunk/current/src/cu​rrent_apache.py 2005-02-14 05:00:53 UTC (rev 684)
+++ trunk/current/src/cu​rrent_apache.py 2005-02-15 02:56:43 UTC (rev 685)
@@ -121,7 +121,7 @@
         # Now we can actually check on the clients authorizations
         hi = auth.SysHeaders(req.headers_in)
         (valid, reason) = hi.isValid()
- except exception.CurrentException, e:
+ except CurrentException, e:
         log("ERROR: A CurrentException was raised -- in accesshandler().",
             MANDATORY)
         logException()

Modified: trunk/current/src/he​aderParse.py
====================​====================​====================​=======
--- trunk/current/src/he​aderParse.py 2005-02-14 05:00:53 UTC (rev 684)
+++ trunk/current/src/he​aderParse.py 2005-02-15 02:56:43 UTC (rev 685)
@@ -25,15 +25,14 @@
 import exception
 import string
 
-class Error(exception.Curr​entException):
- pass
 
-class ParseError(Error):
+class ParseError(exception​.CurrentException):
     """ We encountered an error in the parser, but the string we're parsing
     /appears/ to be valid"""
     pass
 
-class FormatError(Error):
+
+class FormatError(exceptio​n.CurrentException):​
     """ The string we're parsing is invalid"""
     pass
 
@@ -75,8 +74,8 @@
                 result.append(self._​parseList())
             else:
                 raise FormatError("Unexpected input in parse()")
-
- if type(result[0][0]) == ListType:
+
+ if len(result) > 0 and type(result[0][0]) == ListType:
             # Parse string was a list of lists
             return result[0]
 
@@ -173,7 +172,8 @@
     # We want to be able to handling strings of at least three formats
     test = ["['rawhide', '20050206212651'],['test', '20050119220409']",
             "[['rawhide', '20050206212651'], ['test', '20050119220409']]",
- "['test', '20050119220409']"]
+ "['test', '20050119220409']",
+ ""]
 
     for t in test:
         print "Testing: %s" % t


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@curr​ent.tigris.org
For additional commands, e-mail: cvs-help at current dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

SVN: r685 - trunk/current/src jjneely at EOS dot NCSU dot EDU jjneely at EOS dot NCSU dot EDU 2005-02-14 18:56:49 PST
Messages per page: