Issue Feature Rejected

#98665New stdWrap property to generate HMAC hash

Henrik Ziegenhain 10/20/22, 08:40 updated 06/07/24, 06:24

Description

Hi all,

would it be a helpful feature to add a new property “hmac” to stdWrap?

Currently there is a property to generate a simple hash for given values.
This is lacking same “salt”.

The new property stdWrap.hmac could be a simple wrapper for GeneralUtility::hmac method at the end

It could look like this:

public function stdWrap_hmac($content = '', array $conf = [])
{
    $additionalSecret = '';
    $hmacDot = $this->stdWrapValue('hmac.', $conf ?? []);
    if (is_array($hmacDot)) {
        $additionalSecret = (string)$this->stdWrapValue('additionalSecret', $hmacDot ?? []);
    }
    if (!empty($content)) {
        return GeneralUtility::hmac($content, $additionalSecret);
    }
    // Non-existing content
    return '';
}
lib.currentUserHmac = TEXT
lib.currentUserHmac {
    data = TSFE:fe_user|user|username
    stdWrap.hmac = 1
    stdWrap.hmac {
        additionalSecret = MyAdditionalSecret
    }
}

Looking forward to your comments :-)
Henrik

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.