Exemple #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()
Exemple #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()
Exemple #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
Exemple #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
Exemple #5
0
 def test_generate_nonce(self):
     len_nonce = len(bitid.generate_nonce())
     self.assertEqual(NONCE_LENGTH, len_nonce)  
Exemple #6
0
 def test_generate_nonce(self):
     len_nonce = len(bitid.generate_nonce())
     self.assertEqual(NONCE_LENGTH, len_nonce)
Exemple #7
0
    def save(self, *args, **kwargs):

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

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