Improved structure and added basics for database module
This commit is contained in:
@@ -21,6 +21,7 @@ from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
from .console import Console
|
||||
from .credential_manager import CredentialManager
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major=2020, minor=12, micro=5)
|
||||
|
17
src/sh_edraft/utils/credential_manager.py
Normal file
17
src/sh_edraft/utils/credential_manager.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import base64
|
||||
|
||||
|
||||
class CredentialManager:
|
||||
|
||||
@staticmethod
|
||||
def encrypt(string: str) -> str:
|
||||
return base64.b64encode(string.encode('utf-8')).decode('utf-8')
|
||||
|
||||
@staticmethod
|
||||
def decrypt(string: str) -> str:
|
||||
return base64.b64decode(string).decode('utf-8')
|
||||
|
||||
@staticmethod
|
||||
def build_string(string: str, credentials: str):
|
||||
return string.replace('$credentials', CredentialManager.decrypt(credentials))
|
||||
|
Reference in New Issue
Block a user