-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpasswords.py
More file actions
26 lines (20 loc) · 821 Bytes
/
passwords.py
File metadata and controls
26 lines (20 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""This module has one class for managing password hashing with passlib."""
from hashing.hashing import get_password_hashed
class Password:
"""This class helps to implement password hashing with passlib library."""
def __init__(self, password):
"""
Get the string to converts into a property of the class.
:params: password: the string to become a property of the class.
"""
self.password = password
@property
def password(self):
"""If this property is read, an exception is raised."""
raise AttributeError('This property can\'t be read')
@password.setter
def password(self, password):
'''Password setter.
:params: password: String to be hashed
'''
self.password_hash = get_password_hashed(password, 8)