2021-08-21 00:34:10 -04:00
|
|
|
from zope.interface import Attribute, Interface
|
|
|
|
|
|
|
|
|
|
|
|
class IDatabaseService(Interface):
|
|
|
|
"""Interface to create databases for users."""
|
|
|
|
|
2021-08-24 02:14:28 -04:00
|
|
|
type = Attribute('the type of databases that will be created')
|
|
|
|
auth_username = Attribute('username to a privileged user on the database host')
|
|
|
|
auth_password = Attribute('password to a privileged user on the database host')
|
2021-08-21 00:34:10 -04:00
|
|
|
|
|
|
|
def create_db(username: str) -> str:
|
2021-08-26 15:42:18 -04:00
|
|
|
"""create a user and database and return the password"""
|
|
|
|
|
|
|
|
def reset_passwd(username: str) -> str:
|
|
|
|
"""reset user password and return it"""
|
2021-08-24 22:31:50 -04:00
|
|
|
|
|
|
|
def delete_db(username: str):
|
|
|
|
"""remove user and delete their database"""
|