2022-05-07 21:07:55 +00:00
|
|
|
from app.classes.web.routes.api.index_handler import ApiIndexHandler
|
2022-05-18 12:58:54 +00:00
|
|
|
from app.classes.web.routes.api.jsonschema import (
|
|
|
|
ApiJsonSchemaHandler,
|
|
|
|
ApiJsonSchemaListHandler,
|
|
|
|
)
|
2022-05-07 21:07:55 +00:00
|
|
|
from app.classes.web.routes.api.not_found import ApiNotFoundHandler
|
2022-04-14 12:33:53 +00:00
|
|
|
from app.classes.web.routes.api.auth.invalidate_tokens import (
|
|
|
|
ApiAuthInvalidateTokensHandler,
|
|
|
|
)
|
|
|
|
from app.classes.web.routes.api.auth.login import ApiAuthLoginHandler
|
2022-05-07 21:07:55 +00:00
|
|
|
from app.classes.web.routes.api.roles.index import ApiRolesIndexHandler
|
|
|
|
from app.classes.web.routes.api.roles.role.index import ApiRolesRoleIndexHandler
|
|
|
|
from app.classes.web.routes.api.roles.role.servers import ApiRolesRoleServersHandler
|
|
|
|
from app.classes.web.routes.api.roles.role.users import ApiRolesRoleUsersHandler
|
2023-09-02 19:51:28 +00:00
|
|
|
|
2022-04-14 12:33:53 +00:00
|
|
|
from app.classes.web.routes.api.servers.index import ApiServersIndexHandler
|
|
|
|
from app.classes.web.routes.api.servers.server.action import (
|
|
|
|
ApiServersServerActionHandler,
|
|
|
|
)
|
|
|
|
from app.classes.web.routes.api.servers.server.index import ApiServersServerIndexHandler
|
|
|
|
from app.classes.web.routes.api.servers.server.logs import ApiServersServerLogsHandler
|
|
|
|
from app.classes.web.routes.api.servers.server.public import (
|
|
|
|
ApiServersServerPublicHandler,
|
|
|
|
)
|
2023-09-02 19:51:28 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.status import (
|
|
|
|
ApiServersServerStatusHandler,
|
|
|
|
)
|
2022-04-14 12:33:53 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.stats import ApiServersServerStatsHandler
|
2023-08-27 12:10:20 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.history import (
|
|
|
|
ApiServersServerHistoryHandler,
|
|
|
|
)
|
2022-05-30 21:11:17 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.stdin import ApiServersServerStdinHandler
|
2022-06-22 22:57:29 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.tasks.index import (
|
|
|
|
ApiServersServerTasksIndexHandler,
|
|
|
|
)
|
2023-05-20 21:49:13 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.backups.index import (
|
|
|
|
ApiServersServerBackupsIndexHandler,
|
|
|
|
)
|
|
|
|
from app.classes.web.routes.api.servers.server.backups.backup.index import (
|
|
|
|
ApiServersServerBackupsBackupIndexHandler,
|
|
|
|
)
|
2023-06-05 00:55:48 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.files import (
|
|
|
|
ApiServersServerFilesIndexHandler,
|
2023-09-03 20:15:38 +00:00
|
|
|
ApiServersServerFilesCreateHandler,
|
|
|
|
ApiServersServerFilesZipHandler,
|
2023-06-04 18:43:45 +00:00
|
|
|
)
|
2022-06-22 22:57:29 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.tasks.task.children import (
|
|
|
|
ApiServersServerTasksTaskChildrenHandler,
|
|
|
|
)
|
|
|
|
from app.classes.web.routes.api.servers.server.tasks.task.index import (
|
|
|
|
ApiServersServerTasksTaskIndexHandler,
|
|
|
|
)
|
2023-06-03 19:05:33 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.webhooks.index import (
|
|
|
|
ApiServersServerWebhooksIndexHandler,
|
|
|
|
)
|
|
|
|
from app.classes.web.routes.api.servers.server.webhooks.webhook.index import (
|
2023-09-27 21:35:44 +00:00
|
|
|
ApiServersServerWebhooksManagementIndexHandler,
|
2023-06-03 19:05:33 +00:00
|
|
|
)
|
2022-04-14 12:33:53 +00:00
|
|
|
from app.classes.web.routes.api.servers.server.users import ApiServersServerUsersHandler
|
|
|
|
from app.classes.web.routes.api.users.index import ApiUsersIndexHandler
|
|
|
|
from app.classes.web.routes.api.users.user.index import ApiUsersUserIndexHandler
|
2022-05-24 21:55:49 +00:00
|
|
|
from app.classes.web.routes.api.users.user.permissions import (
|
|
|
|
ApiUsersUserPermissionsHandler,
|
|
|
|
)
|
2023-09-04 03:30:26 +00:00
|
|
|
from app.classes.web.routes.api.users.user.api import ApiUsersUserKeyHandler
|
2022-04-14 12:33:53 +00:00
|
|
|
from app.classes.web.routes.api.users.user.pfp import ApiUsersUserPfpHandler
|
|
|
|
from app.classes.web.routes.api.users.user.public import ApiUsersUserPublicHandler
|
2023-09-01 21:04:56 +00:00
|
|
|
from app.classes.web.routes.api.crafty.announcements.index import (
|
|
|
|
ApiAnnounceIndexHandler,
|
|
|
|
)
|
2023-09-04 17:31:05 +00:00
|
|
|
from app.classes.web.routes.api.crafty.config.index import (
|
|
|
|
ApiCraftyConfigIndexHandler,
|
|
|
|
ApiCraftyCustomizeIndexHandler,
|
|
|
|
)
|
2023-09-04 16:34:39 +00:00
|
|
|
from app.classes.web.routes.api.crafty.config.server_dir import (
|
|
|
|
ApiCraftyConfigServerDirHandler,
|
|
|
|
)
|
2023-09-06 21:28:46 +00:00
|
|
|
from app.classes.web.routes.api.crafty.stats.stats import ApiCraftyHostStatsHandler
|
2023-08-20 21:03:01 +00:00
|
|
|
from app.classes.web.routes.api.crafty.clogs.index import ApiCraftyLogIndexHandler
|
2023-09-01 01:35:30 +00:00
|
|
|
from app.classes.web.routes.api.crafty.imports.index import ApiImportFilesIndexHandler
|
2023-09-09 00:27:47 +00:00
|
|
|
from app.classes.web.routes.api.crafty.exe_cache import ApiCraftyJarCacheIndexHandler
|
2024-01-16 20:36:14 +00:00
|
|
|
from app.classes.web.routes.api.crafty.antilockout.index import ApiCraftyLockoutHandler
|
2022-04-14 12:33:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
def api_handlers(handler_args):
|
|
|
|
return [
|
|
|
|
# Auth routes
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/auth/login/?",
|
|
|
|
ApiAuthLoginHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
(
|
2022-05-07 21:07:55 +00:00
|
|
|
r"/api/v2/auth/invalidate_tokens/?",
|
2022-04-14 12:33:53 +00:00
|
|
|
ApiAuthInvalidateTokensHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2024-01-16 20:36:14 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/resetPass/?",
|
|
|
|
ApiCraftyLockoutHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-01 18:48:20 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/announcements/?",
|
|
|
|
ApiAnnounceIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-08-15 20:09:06 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/config/?",
|
|
|
|
ApiCraftyConfigIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-04 17:31:05 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/config/customize/?",
|
|
|
|
ApiCraftyCustomizeIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-04 16:34:39 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/config/servers_dir/?",
|
|
|
|
ApiCraftyConfigServerDirHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-06 21:28:46 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/stats/?",
|
|
|
|
ApiCraftyHostStatsHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-08-20 21:03:01 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/logs/([a-z0-9_]+)/?",
|
|
|
|
ApiCraftyLogIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-19 20:08:49 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/crafty/JarCache/?",
|
|
|
|
ApiCraftyJarCacheIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-01 01:35:30 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/import/file/unzip/?",
|
|
|
|
ApiImportFilesIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
# User routes
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/?",
|
|
|
|
ApiUsersIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-04 03:30:26 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/([0-9]+)/key/?",
|
|
|
|
ApiUsersUserKeyHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-04 15:42:07 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/([0-9]+)/key/([0-9]+)/?",
|
|
|
|
ApiUsersUserKeyHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
2022-05-18 19:54:44 +00:00
|
|
|
r"/api/v2/users/([0-9]+)/?",
|
2022-05-18 12:58:54 +00:00
|
|
|
ApiUsersUserIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
|
|
|
r"/api/v2/users/(@me)/?",
|
|
|
|
ApiUsersUserIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2022-05-24 21:58:10 +00:00
|
|
|
r"/api/v2/users/([0-9]+)/permissions/?",
|
|
|
|
ApiUsersUserPermissionsHandler,
|
2022-05-18 12:58:54 +00:00
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-24 21:55:49 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/(@me)/permissions/?",
|
|
|
|
ApiUsersUserPermissionsHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-24 21:58:10 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/([0-9]+)/pfp/?",
|
|
|
|
ApiUsersUserPfpHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/(@me)/pfp/?",
|
|
|
|
ApiUsersUserPfpHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-07 21:07:55 +00:00
|
|
|
(
|
2022-05-18 19:54:44 +00:00
|
|
|
r"/api/v2/users/([0-9]+)/public/?",
|
2022-05-07 21:07:55 +00:00
|
|
|
ApiUsersUserPublicHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/users/(@me)/public/?",
|
|
|
|
ApiUsersUserPublicHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
# Server routes
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/servers/?",
|
|
|
|
ApiServersIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-04 16:12:02 +00:00
|
|
|
(
|
2023-09-02 19:51:28 +00:00
|
|
|
r"/api/v2/servers/status/?",
|
|
|
|
ApiServersServerStatusHandler,
|
2023-09-04 16:12:02 +00:00
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/?",
|
2022-05-18 12:58:54 +00:00
|
|
|
ApiServersServerIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-05-20 21:49:13 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/backups/?",
|
2023-05-20 21:49:13 +00:00
|
|
|
ApiServersServerBackupsIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/backups/backup/?",
|
2023-05-20 21:49:13 +00:00
|
|
|
ApiServersServerBackupsBackupIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-06-04 18:43:45 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/files/?",
|
2023-06-05 00:55:48 +00:00
|
|
|
ApiServersServerFilesIndexHandler,
|
2023-06-04 18:43:45 +00:00
|
|
|
handler_args,
|
|
|
|
),
|
2023-09-03 20:15:38 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/files/create/?",
|
2023-09-03 20:15:38 +00:00
|
|
|
ApiServersServerFilesCreateHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/files/zip/?",
|
2023-09-03 20:15:38 +00:00
|
|
|
ApiServersServerFilesZipHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-06-22 22:57:29 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/tasks/?",
|
2022-06-22 22:57:29 +00:00
|
|
|
ApiServersServerTasksIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/tasks/([0-9]+)/?",
|
2022-06-22 22:57:29 +00:00
|
|
|
ApiServersServerTasksTaskIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/tasks/([0-9]+)/children/?",
|
2022-06-22 22:57:29 +00:00
|
|
|
ApiServersServerTasksTaskChildrenHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-07 21:07:55 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/stats/?",
|
2022-05-07 21:07:55 +00:00
|
|
|
ApiServersServerStatsHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-08-27 11:50:22 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/history/?",
|
2023-08-27 11:50:22 +00:00
|
|
|
ApiServersServerHistoryHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2023-06-03 19:05:33 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/webhook/([0-9]+)/?",
|
2023-09-27 21:35:44 +00:00
|
|
|
ApiServersServerWebhooksManagementIndexHandler,
|
2023-06-03 19:05:33 +00:00
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/webhook/?",
|
2023-06-03 19:05:33 +00:00
|
|
|
ApiServersServerWebhooksIndexHandler,
|
2023-09-28 18:57:18 +00:00
|
|
|
handler_args,
|
2023-06-03 19:05:33 +00:00
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/action/([a-z_]+)/?",
|
2022-04-14 12:33:53 +00:00
|
|
|
ApiServersServerActionHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/logs/?",
|
2022-05-18 12:58:54 +00:00
|
|
|
ApiServersServerLogsHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/users/?",
|
2022-05-07 21:07:55 +00:00
|
|
|
ApiServersServerUsersHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/public/?",
|
2022-04-14 12:33:53 +00:00
|
|
|
ApiServersServerPublicHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-30 21:11:17 +00:00
|
|
|
(
|
2023-11-01 17:44:56 +00:00
|
|
|
r"/api/v2/servers/([a-z0-9-]+)/stdin/?",
|
2022-05-30 21:11:17 +00:00
|
|
|
ApiServersServerStdinHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/roles/?",
|
|
|
|
ApiRolesIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2022-05-18 19:34:33 +00:00
|
|
|
r"/api/v2/roles/([0-9]+)/?",
|
2022-05-18 12:58:54 +00:00
|
|
|
ApiRolesRoleIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-07 21:07:55 +00:00
|
|
|
(
|
2022-05-18 19:34:33 +00:00
|
|
|
r"/api/v2/roles/([0-9]+)/servers/?",
|
2022-05-07 21:07:55 +00:00
|
|
|
ApiRolesRoleServersHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
2022-05-18 19:34:33 +00:00
|
|
|
r"/api/v2/roles/([0-9]+)/users/?",
|
2022-05-07 21:07:55 +00:00
|
|
|
ApiRolesRoleUsersHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-05-18 12:58:54 +00:00
|
|
|
(
|
|
|
|
r"/api/v2/jsonschema/?",
|
|
|
|
ApiJsonSchemaListHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
|
|
|
r"/api/v2/jsonschema/([a-z0-9_]+)/?",
|
|
|
|
ApiJsonSchemaHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
|
|
|
r"/api/v2/?",
|
|
|
|
ApiIndexHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
|
|
|
(
|
|
|
|
r"/api/v2/(.*)",
|
|
|
|
ApiNotFoundHandler,
|
|
|
|
handler_args,
|
|
|
|
),
|
2022-04-14 12:33:53 +00:00
|
|
|
]
|