Example #1
0
    def test_constructor(self):
        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str,
                          hmac.new(b'mysecretkey', b'foo').hexdigest())
Example #2
0
    def test_constructor(self):
        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str,
                          hmac.new(b'mysecretkey', b'foo').hexdigest())
Example #3
0
    def test_constructor(self):
        from boto.utils import Password
        import hmac

        hmac_hashfunc = lambda msg: hmac.new('mysecretkey', msg )

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str, hmac.new('mysecretkey','foo').hexdigest())
Example #4
0
    def test_constructor(self):
        from boto.utils import Password
        import hmac

        hmac_hashfunc = lambda msg: hmac.new('mysecretkey', msg )

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str, hmac.new('mysecretkey', 'foo').hexdigest())
Example #5
0
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
Example #6
0
 def __get__(self, obj, objtype):
     return Password(StringProperty.__get__(self, obj, objtype))
Example #7
0
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
Example #8
0
 def make_value_from_datastore(self, value):
     p = Password(value)
     return p
Example #9
0
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)
Example #10
0
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)
Example #11
0
 def __get__(self, obj, objtype):
     return Password(ScalarProperty.__get__(self, obj, objtype))
Example #12
0
 def decode_password(self, value):
     value = self.get_text_value(value)
     return Password(value)