semantics
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
# [DEF:CreateAdminScript:Module]
|
||||
# #region CreateAdminScript [C:3] [TYPE Module] [SEMANTICS admin, setup, user, auth, cli]
|
||||
# @BRIEF CLI tool for creating the initial admin user.
|
||||
# @LAYER Scripts
|
||||
# @INVARIANT Admin user must have the "Admin" role.
|
||||
# @RELATION USES -> [AuthSecurityModule]
|
||||
# @RELATION USES -> [DatabaseModule]
|
||||
# @RELATION USES -> [AuthModels]
|
||||
#
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: admin, setup, user, auth, cli
|
||||
# @PURPOSE: CLI tool for creating the initial admin user.
|
||||
# @LAYER: Scripts
|
||||
# @RELATION: USES -> [AuthSecurityModule]
|
||||
# @RELATION: USES -> [DatabaseModule]
|
||||
# @RELATION: USES -> [AuthModels]
|
||||
#
|
||||
# @INVARIANT: Admin user must have the "Admin" role.
|
||||
|
||||
# [SECTION: IMPORTS]
|
||||
import sys
|
||||
@@ -25,10 +23,10 @@ from src.core.logger import logger, belief_scope
|
||||
# [/SECTION]
|
||||
|
||||
|
||||
# [DEF:create_admin:Function]
|
||||
# @PURPOSE: Creates an admin user and necessary roles/permissions.
|
||||
# @PRE: username and password provided via CLI.
|
||||
# @POST: Admin user exists in auth.db.
|
||||
# #region create_admin [TYPE Function]
|
||||
# @BRIEF Creates an admin user and necessary roles/permissions.
|
||||
# @PRE username and password provided via CLI.
|
||||
# @POST Admin user exists in auth.db.
|
||||
#
|
||||
# @PARAM: username (str) - Admin username.
|
||||
# @PARAM: password (str) - Admin password.
|
||||
@@ -79,7 +77,7 @@ def create_admin(username, password, email=None):
|
||||
db.close()
|
||||
|
||||
|
||||
# [/DEF:create_admin:Function]
|
||||
# #endregion create_admin
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Create initial admin user")
|
||||
@@ -96,4 +94,4 @@ if __name__ == "__main__":
|
||||
except Exception:
|
||||
sys.exit(1)
|
||||
|
||||
# [/DEF:CreateAdminScript:Module]
|
||||
# #endregion CreateAdminScript
|
||||
|
||||
Reference in New Issue
Block a user