[hg] galaxy 2753: Fix bug in security helpers encode_id and deco...
details: http://www.bx.psu.edu/hg/galaxy/rev/be3c27418de9 changeset: 2753:be3c27418de9 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Sep 23 09:24:10 2009 -0400 description: Fix bug in security helpers encode_id and decode_id methods that resulted in overriding the Python built in id - resolves ticket # 167. 1 file(s) affected in this change: lib/galaxy/web/security/__init__.py diffs (23 lines): diff -r afa7946a126c -r be3c27418de9 lib/galaxy/web/security/__init__.py --- a/lib/galaxy/web/security/__init__.py Tue Sep 22 21:51:11 2009 -0400 +++ b/lib/galaxy/web/security/__init__.py Wed Sep 23 09:24:10 2009 -0400 @@ -34,15 +34,15 @@ def __init__( self, **config ): self.id_secret = config['id_secret'] self.id_cipher = Blowfish.new( self.id_secret ) - def encode_id( self, id ): + def encode_id( self, obj_id ): # Convert to string - s = str( id ) + s = str( obj_id ) # Pad to a multiple of 8 with leading "!" s = ( "!" * ( 8 - len(s) % 8 ) ) + s # Encrypt return self.id_cipher.encrypt( s ).encode( 'hex' ) - def decode_id( self, id ): - return int( self.id_cipher.decrypt( id.decode( 'hex' ) ).lstrip( "!" ) ) + def decode_id( self, obj_id ): + return int( self.id_cipher.decrypt( obj_id.decode( 'hex' ) ).lstrip( "!" ) ) def encode_session_key( self, session_key ): # Session keys are strings # Pad to a multiple of 8 with leading "!"
participants (1)
-
Nate Coraor