Skip to content

Commit 56c8f43

Browse files
committed
Add comment to getUnstableAttributesHash
This might prove usefull down the road
1 parent 0ef8a18 commit 56c8f43

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/OpenConext/EngineBlock/Service/Consent/ConsentHashService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ public function countTotalConsent($consentUid): int
6060
return $this->consentRepository->countTotalConsent($consentUid);
6161
}
6262

63+
/**
64+
* The old way of calculating the attribute hash, this is not stable as a change of the attribute order,
65+
* change of case, stray/empty attributes, and renumbered indexes can cause the hash to change. Leaving the
66+
* user to give consent once again for a service she previously gave consent for.
67+
*/
6368
public function getUnstableAttributesHash(array $attributes, bool $mustStoreValues): string
6469
{
65-
$hashBase = null;
6670
if ($mustStoreValues) {
6771
ksort($attributes);
6872
$hashBase = serialize($attributes);

0 commit comments

Comments
 (0)