summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@linux.vnet.ibm.com>2019-03-04 13:30:50 +0530
committerEd Tanous <ed.tanous@intel.com>2019-03-12 23:26:47 +0000
commit19fb6e719849aea2f0cafdee64cd7da8a7a2b67b (patch)
tree06807c999ef65f2eea811d5cd48bfae56e10de04
parentf65af9e8c0d28a4b725c0d05ecbeb3007e2a09cf (diff)
downloadbmcweb-19fb6e719849aea2f0cafdee64cd7da8a7a2b67b.tar.gz
bmcweb-19fb6e719849aea2f0cafdee64cd7da8a7a2b67b.zip
Redfish(AccountService): Send the correct error message for the read only property
MinPasswordLength and MaxPasswordLength is a readOnly property in the account service schema, so send the correct message if the user tries to PATCH these properties. Change-Id: If231ca13ef97fc05928435ac14a8190a186beb06 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
-rw-r--r--redfish-core/lib/account_service.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 045f40c..1b7b4b8 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -167,12 +167,28 @@ class AccountService : public Node
std::optional<uint32_t> unlockTimeout;
std::optional<uint16_t> lockoutThreshold;
+ std::optional<uint16_t> minPasswordLength;
+ std::optional<uint16_t> maxPasswordLength;
+
if (!json_util::readJson(req, res, "AccountLockoutDuration",
unlockTimeout, "AccountLockoutThreshold",
- lockoutThreshold))
+ lockoutThreshold, "MaxPasswordLength",
+ maxPasswordLength, "MinPasswordLength",
+ minPasswordLength))
{
return;
}
+
+ if (minPasswordLength)
+ {
+ messages::propertyNotWritable(asyncResp->res, "MinPasswordLength");
+ }
+
+ if (maxPasswordLength)
+ {
+ messages::propertyNotWritable(asyncResp->res, "MaxPasswordLength");
+ }
+
if (unlockTimeout)
{
crow::connections::systemBus->async_method_call(
OpenPOWER on IntegriCloud