Skip to content

Validate APCB Token before applying PATCH#60

Open
ankitaprasad2206 wants to merge 1 commit intointeg_sp8from
PATCH-Validation-for-APCB-Token
Open

Validate APCB Token before applying PATCH#60
ankitaprasad2206 wants to merge 1 commit intointeg_sp8from
PATCH-Validation-for-APCB-Token

Conversation

@ankitaprasad2206
Copy link
Copy Markdown
Collaborator

There is a corner case where, if invalid APCB Token is passed through Redfish, the operation should throw invalid error.

Tested: tested on Kenya system. PATCH is failing
for invalid tokens.

There is a corner case where, if invalid APCB Token is passed
through Redfish, the operation should throw invalid error.

Tested: tested on Kenya system. PATCH is failing
for invalid tokens.

Signed-off-by: ankprasa <ankprasa@amd.com>
const sdbusplus::message_t&, const ObjectPath& objPath) {
if (ec)
{
BMCWEB_LOG_ERROR("RDE: operationGet failed: {}",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BMCWEB_LOG_ERROR("RDE: operationGet failed: {}",
BMCWEB_LOG_ERROR("RDE: operationPATCH failed: {}",

??

rdeEncodingFormatJSON, self->schema);
};

if (self->subUri != socConfigurationTokenSubUri)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know what this check is for?

Copy link
Copy Markdown
Collaborator Author

@ankitaprasad2206 ankitaprasad2206 Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is for other URI which is not "Oem/AMD/SocConfiguration/Token". For such URIs, no need to call validateSocConfigurationPatchTokenKeys() and startPatchOperation() can be directly called.

auto expectedTokenIt = payloadTokenMap.find(key);
if (key.empty() || expectedTokenIt == payloadTokenMap.end())
{
messages::propertyValueIncorrect(response, key, value);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:
Please add a log in error cases. It will be useful during the debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants