Ejemplo n.º 1
0
 def __init__(self, sid):
     '''
     Constructor
     Parameters:
         sid = session id associated to the nonce
     '''
     self.sid = sid
     self.uid = None
     # Initializes a value for the nonce (let's call that the nonce id)
     self.nid = bitid.generate_nonce()
     # Sets the creation date
     self.created = datetime.now()
Ejemplo n.º 2
0
 def __init__(self, sid):
     '''
     Constructor
     Parameters:
         sid = session id associated to the nonce
     '''
     self.sid = sid
     self.uid = None
     # Initializes a value for the nonce (let's call that the nonce id)
     self.nid = bitid.generate_nonce()
     # Sets the creation date
     self.created = datetime.now()
Ejemplo n.º 3
0
 def __init__(self, sid):
     '''
     Constructor
     Parameters:
         sid = session id associated to the nonce
     '''
     self.sid = sid
     self.uid = None
     # Initializes a value for the nonce (let's call that the nonce id)
     self.nid = bitid.generate_nonce()
     # Sets the creation date
     self.created = datetime.now()
     # Sets the redirect uri
     self.redirect_uri = ""
     # Sets the bitcoin address used for 2fa
     self.tfa_address = None
Ejemplo n.º 4
0
 def __init__(self, sid):
     '''
     Constructor
     Parameters:
         sid = session id associated to the nonce
     '''
     self.sid = sid
     self.uid = None
     # Initializes a value for the nonce (let's call that the nonce id)
     self.nid = bitid.generate_nonce()
     # Sets the creation date
     self.created = datetime.now()
     # Sets the redirect uri
     self.redirect_uri = ""
     # Sets the bitcoin address used for 2fa
     self.tfa_address = None
Ejemplo n.º 5
0
 def test_generate_nonce(self):
     len_nonce = len(bitid.generate_nonce())
     self.assertEqual(NONCE_LENGTH, len_nonce)  
Ejemplo n.º 6
0
 def test_generate_nonce(self):
     len_nonce = len(bitid.generate_nonce())
     self.assertEqual(NONCE_LENGTH, len_nonce)
Ejemplo n.º 7
0
    def save(self, *args, **kwargs):

        if self.pk is None:
            self.nid = bitid.generate_nonce()

        super(Nonce, self).save(*args, **kwargs)