2023-09-04 12:12:02 -04:00
|
|
|
from app.classes.web.base_api_handler import BaseApiHandler
|
|
|
|
|
|
|
|
|
2023-09-08 20:27:47 -04:00
|
|
|
class ApiCraftyJarCacheIndexHandler(BaseApiHandler):
|
2023-09-04 12:12:02 -04:00
|
|
|
def get(self):
|
|
|
|
auth_data = self.authenticate_user()
|
|
|
|
if not auth_data:
|
|
|
|
return
|
|
|
|
(
|
|
|
|
_,
|
|
|
|
_,
|
|
|
|
_,
|
|
|
|
_,
|
|
|
|
_,
|
2024-05-10 19:31:20 -04:00
|
|
|
_,
|
2023-09-04 12:12:02 -04:00
|
|
|
) = auth_data
|
|
|
|
|
|
|
|
if not auth_data[4]["superuser"]:
|
|
|
|
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
|
|
|
|
2024-05-04 15:15:43 -04:00
|
|
|
self.controller.big_bucket.manual_refresh_cache()
|
2023-09-04 12:12:02 -04:00
|
|
|
self.finish_json(
|
|
|
|
200,
|
|
|
|
{
|
|
|
|
"status": "ok",
|
2024-05-04 15:15:43 -04:00
|
|
|
"data": self.controller.big_bucket.get_bucket_data(),
|
2023-09-04 12:12:02 -04:00
|
|
|
},
|
|
|
|
)
|