🔐 Removes auth from backend

This commit is contained in:
Rune Harlyk
2024-10-29 20:47:02 +01:00
parent 9923b66208
commit 1c6b9f79c5
41 changed files with 1389 additions and 2212 deletions
@@ -22,8 +22,7 @@ static char md5[33] = "\0";
static FileType fileType = ft_none;
UploadFirmwareService::UploadFirmwareService(PsychicHttpServer *server, SecurityManager *securityManager)
: _server(server), _securityManager(securityManager) {}
UploadFirmwareService::UploadFirmwareService(PsychicHttpServer *server) : _server(server) {}
void UploadFirmwareService::begin() {
_server->maxUploadSize = 2300000; // 2.3 MB
@@ -42,12 +41,6 @@ void UploadFirmwareService::begin() {
esp_err_t UploadFirmwareService::handleUpload(PsychicRequest *request, const String &filename, uint64_t index,
uint8_t *data, size_t len, bool final) {
// quit if not authorized
Authentication authentication = _securityManager->authenticateRequest(request);
if (!AuthenticationPredicates::IS_ADMIN(authentication)) {
return handleError(request, 403); // forbidden
}
// at init
if (!index) {
// check details of the file, to see if its a valid bin or json file