Skip to content

Commit 432b332

Browse files
authored
Merge pull request #1137 from OpenConext/feature/stabilize-consent-hash
Add a stable consent hash
2 parents 834fae3 + 3abdc69 commit 432b332

42 files changed

Lines changed: 2144 additions & 396 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ Changes:
2727
* The `0000-00-00 00:00:00` is added for clarity/consistency, as this is probably the default behaviour of your database already.
2828
* Removed unused index `consent.deleted_at`. Delete this from your production database if it's there.
2929

30+
* Stabilized consent checks
31+
* In order to make the consent hashes more robust, a more consistent way of hashing the user attributes has been introduced
32+
* This feature automatically migrates from the old hashes to the new hashes, cleaning up the old hash.
33+
* However, if blue/green deployments are used or if you want to keep the option open to roll back the EB release, keep the `feature_stable_consent_hash_migration` set to false in order to preserve the old consent hashes.
34+
* Once the new release is fully rolled out, set `feature_stable_consent_hash_migration` to true. This will clean up the old consent hashes upon login. In the next EB release, the old consent hash column will be deleted.
35+
3036
## 7.1.0
3137
[SBS](https://github.com/SURFscz/SBS) integration
3238

config/packages/engineblock_features.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ parameters:
1616
eb.stepup.sfo.override_engine_entityid: "%feature_stepup_sfo_override_engine_entityid%"
1717
eb.stepup.send_user_attributes: "%feature_stepup_send_user_attributes%"
1818
eb.feature_enable_sram_interrupt: "%feature_enable_sram_interrupt%"
19+
eb.stable_consent_hash_migration: "%feature_stable_consent_hash_migration%"

config/packages/parameters.yml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ parameters:
227227
feature_stepup_sfo_override_engine_entityid: false
228228
feature_stepup_send_user_attributes: false
229229
feature_enable_sram_interrupt: false
230+
feature_stable_consent_hash_migration: false
230231

231232
##########################################################################################
232233
## PROFILE SETTINGS

config/services/ci/services.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ services:
6666
arguments:
6767
- "@engineblock.functional_testing.data_store.sbs_client_state_mananger"
6868

69+
engineblock.compat.corto_model_consent_factory:
70+
class: EngineBlock_Corto_Model_Consent_Factory
71+
arguments:
72+
- "@engineblock.service.consent.ConsentHashService"
73+
- "@engineblock.functional_testing.fixture.features"
74+
6975
#endregion Fixtures
7076

7177
#region Data Stores

config/services/compat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ services:
4949
engineblock.compat.corto_model_consent_factory:
5050
class: EngineBlock_Corto_Model_Consent_Factory
5151
arguments:
52-
- "@engineblock.compat.corto_filter_command_factory"
53-
- "@engineblock.compat.database_connection_factory"
52+
- "@engineblock.service.consent.ConsentHashService"
53+
- "@OpenConext\\EngineBlockBundle\\Configuration\\FeatureConfiguration"
5454

5555
engineblock.compat.saml2_id_generator:
5656
public: true

config/services/controllers/api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
- '@security.token_storage'
1717
- '@security.access.decision_manager'
1818
- '@OpenConext\EngineBlockBundle\Configuration\FeatureConfiguration'
19-
- '@OpenConext\EngineBlock\Service\ConsentService'
19+
- '@OpenConext\EngineBlock\Service\Consent\ConsentService'
2020

2121
OpenConext\EngineBlockBundle\Controller\Api\DeprovisionController:
2222
arguments:

config/services/services.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ services:
7474
- '@OpenConext\EngineBlock\Metadata\LoaRepository'
7575
- '@logger'
7676

77-
OpenConext\EngineBlock\Service\ConsentService:
77+
engineblock.service.consent.ConsentHashService:
78+
class: OpenConext\EngineBlock\Service\Consent\ConsentHashService
79+
public: false
80+
arguments:
81+
- '@OpenConext\EngineBlockBundle\Authentication\Repository\DbalConsentRepository'
82+
- '@OpenConext\EngineBlockBundle\Configuration\FeatureConfiguration'
83+
84+
OpenConext\EngineBlock\Service\Consent\ConsentService:
7885
arguments:
7986
- '@OpenConext\EngineBlockBundle\Authentication\Repository\DbalConsentRepository'
8087
- '@OpenConext\EngineBlock\Service\MetadataService'

library/EngineBlock/Application/DiContainer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ public function getAuthenticationLoopGuard()
161161
}
162162

163163
/**
164-
* @return OpenConext\EngineBlock\Service\ConsentService
164+
* @return OpenConext\EngineBlock\Service\Consent\ConsentService
165165
*/
166166
public function getConsentService()
167167
{
168-
return $this->container->get(\OpenConext\EngineBlock\Service\ConsentService::class);
168+
return $this->container->get(\OpenConext\EngineBlock\Service\Consent\ConsentService::class);
169169
}
170170

171171
/**

0 commit comments

Comments
 (0)