mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add option unsecure.allow_all_passwords to disable password restrictions and allow any type of passwords (even empty ones)
This commit is contained in:
parent
30ff0a84ef
commit
a567bd3780
@ -51,7 +51,7 @@ Poco::JSON::Object* JsonCreateUser::handle(Poco::Dynamic::Var params)
|
|||||||
|
|
||||||
if (password.size()) {
|
if (password.size()) {
|
||||||
ErrorList errors;
|
ErrorList errors;
|
||||||
if (!sm->checkPwdValidation(password, &errors)) {
|
if (!(ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_ALLOW_ALL_PASSWORDS) && !sm->checkPwdValidation(password, &errors)) {
|
||||||
Poco::JSON::Object* result = new Poco::JSON::Object;
|
Poco::JSON::Object* result = new Poco::JSON::Object;
|
||||||
result->set("state", "error");
|
result->set("state", "error");
|
||||||
result->set("msg", errors.getLastError()->getString(false));
|
result->set("msg", errors.getLastError()->getString(false));
|
||||||
|
|||||||
@ -37,6 +37,10 @@ void JsonRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Po
|
|||||||
if (parsedResult.size() != 0) {
|
if (parsedResult.size() != 0) {
|
||||||
json_result = handle(parsedResult);
|
json_result = handle(parsedResult);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
json_result = stateError("empty body");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(method == "GET") {
|
else if(method == "GET") {
|
||||||
Poco::URI uri(request.getURI());
|
Poco::URI uri(request.getURI());
|
||||||
|
|||||||
@ -246,6 +246,9 @@ namespace ServerConfig {
|
|||||||
if (cfg.getInt("unsecure.allow_cors_all", 0) == 1) {
|
if (cfg.getInt("unsecure.allow_cors_all", 0) == 1) {
|
||||||
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_CORS_ALL);
|
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_CORS_ALL);
|
||||||
}
|
}
|
||||||
|
if (cfg.getInt("unsecure.allow_all_passwords", 0) == 1) {
|
||||||
|
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_ALLOW_ALL_PASSWORDS);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,8 @@ namespace ServerConfig {
|
|||||||
NOT_UNSECURE = 0,
|
NOT_UNSECURE = 0,
|
||||||
UNSECURE_PASSWORD_REQUESTS = 1,
|
UNSECURE_PASSWORD_REQUESTS = 1,
|
||||||
UNSECURE_AUTO_SIGN_TRANSACTIONS = 2,
|
UNSECURE_AUTO_SIGN_TRANSACTIONS = 2,
|
||||||
UNSECURE_CORS_ALL = 4
|
UNSECURE_CORS_ALL = 4,
|
||||||
|
UNSECURE_ALLOW_ALL_PASSWORDS = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user