about summary refs log tree commit diff
path: root/gn_auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2026-08-28 14:14:36 -0500
committerFrederick Muriuki Muriithi2026-08-28 14:14:36 -0500
commitd9b8803bd808a338a72b03aa55932c8d589892d8 (patch)
tree453da3cba282ebb739e07143e900e39898289cee /gn_auth
parentcdf3daefaa6b7870b2f36da440c59c327ea1d62f (diff)
downloadgn-auth-d9b8803bd808a338a72b03aa55932c8d589892d8.tar.gz
Add package for administrative endpoints.
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/auth/authorisation/resources/views.py3
-rw-r--r--gn_auth/auth/system/__init__.py5
-rw-r--r--gn_auth/auth/system/admin/resources.py8
-rw-r--r--gn_auth/auth/system/admin/views.py8
-rw-r--r--gn_auth/auth/system/views.py8
-rw-r--r--gn_auth/auth/views.py13
6 files changed, 44 insertions, 1 deletions
diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py
index 76cf416..fc9d90e 100644
--- a/gn_auth/auth/authorisation/resources/views.py
+++ b/gn_auth/auth/authorisation/resources/views.py
@@ -62,12 +62,15 @@ from .models import (
     get_resource_id, delete_resource as _delete_resource,
     edit_resource as _edit_resource)
 
+from .system.views import system
+
 logger = logging.getLogger(__name__)
 
 resources = Blueprint("resources", __name__)
 resources.register_blueprint(popbp, url_prefix="/")
 resources.register_blueprint(genobp, url_prefix="/")
 resources.register_blueprint(phenobp, url_prefix="/")
+resources.register_blueprint(system, url_prefix="/system")
 
 @resources.route("/categories", methods=["GET"])
 @require_oauth("profile group resource")
diff --git a/gn_auth/auth/system/__init__.py b/gn_auth/auth/system/__init__.py
new file mode 100644
index 0000000..5455f73
--- /dev/null
+++ b/gn_auth/auth/system/__init__.py
@@ -0,0 +1,5 @@
+"""This is for system-specific functionality, e.g. administration.
+
+This is not meant for day-to-day user activities, more for administrative tasks
+to fix things.
+"""
diff --git a/gn_auth/auth/system/admin/resources.py b/gn_auth/auth/system/admin/resources.py
new file mode 100644
index 0000000..d3a9f54
--- /dev/null
+++ b/gn_auth/auth/system/admin/resources.py
@@ -0,0 +1,8 @@
+"""Administrative endpoints concerning resources."""
+
+from flask import Blueprint
+
+resources = Blueprint("resources", __name__)
+
+
+# TODO: assign-owner and revoke-owner go here.
diff --git a/gn_auth/auth/system/admin/views.py b/gn_auth/auth/system/admin/views.py
new file mode 100644
index 0000000..1ea8acd
--- /dev/null
+++ b/gn_auth/auth/system/admin/views.py
@@ -0,0 +1,8 @@
+"""Administrative endpoints."""
+
+from flask import Blueprint
+
+from .resources import resources
+
+admin = Blueprint("admin", __name__)
+admin.register_blueprint(resources, url_prefix="/resources")
diff --git a/gn_auth/auth/system/views.py b/gn_auth/auth/system/views.py
new file mode 100644
index 0000000..2cebfbc
--- /dev/null
+++ b/gn_auth/auth/system/views.py
@@ -0,0 +1,8 @@
+"""The Blueprints for this package."""
+
+from flask import Blueprint
+
+from .admin.views import admin
+
+systembp = Blueprint("sysadm", __name__)
+systembp.register_blueprint(admin, url_prefix="/administration")
diff --git a/gn_auth/auth/views.py b/gn_auth/auth/views.py
index 6867f38..cee92e7 100644
--- a/gn_auth/auth/views.py
+++ b/gn_auth/auth/views.py
@@ -10,8 +10,14 @@ from .authorisation.roles.views import roles
 from .authorisation.resources.views import resources
 from .authorisation.privileges.views import privileges
 from .authorisation.resources.groups.views import groups
+
+from .system.views import systembp
+
+
+# T0DO: Remove this once consumers are changed
 from .authorisation.resources.system.views import system
 
+
 oauth2 = Blueprint("oauth2", __name__)
 
 oauth2.register_blueprint(auth, url_prefix="/")
@@ -20,6 +26,11 @@ oauth2.register_blueprint(users, url_prefix="/user")
 oauth2.register_blueprint(roles, url_prefix="/role")
 oauth2.register_blueprint(admin, url_prefix="/admin")
 oauth2.register_blueprint(groups, url_prefix="/group")
-oauth2.register_blueprint(system, url_prefix="/system")
 oauth2.register_blueprint(resources, url_prefix="/resource")
 oauth2.register_blueprint(privileges, url_prefix="/privileges")
+oauth2.register_blueprint(systembp, url_prefix="/system")
+
+
+
+# T0DO: Remove this once consumers are changed
+oauth2.register_blueprint(system, url_prefix="/system")