class documentation

class ShadowDatabase: (source)

View In Hierarchy

ShadowDatabase holds a shadow user database in memory and makes it available via the same API as spwd.

Present Since
12.0
Method __init__ Undocumented
Method addUser Add a new user record to this database.
Method getspall Return a list of all shadow user records.
Method getspnam Return the shadow user record corresponding to the given username.
Instance Variable _users A list of _ShadowRecord instances holding all user data added to this database.
def __init__(self): (source)

Undocumented

def addUser(self, username: str, password: str, lastChange: int, min: int, max: int, warn: int, inact: int, expire: int, flag: int): (source)

Add a new user record to this database.

Parameters
username:strThe value for the sp_nam field of the user record to add.
password:strThe value for the sp_pwd field of the user record to add.
lastChange:intThe value for the sp_lstchg field of the user record to add.
min:intThe value for the sp_min field of the user record to add.
max:intThe value for the sp_max field of the user record to add.
warn:intThe value for the sp_warn field of the user record to add.
inact:intThe value for the sp_inact field of the user record to add.
expire:intThe value for the sp_expire field of the user record to add.
flag:intThe value for the sp_flag field of the user record to add.
def getspall(self): (source)

Return a list of all shadow user records.

def getspnam(self, username: str) -> _ShadowRecord: (source)

Return the shadow user record corresponding to the given username.

A list of _ShadowRecord instances holding all user data added to this database.