-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt prefill to new auth context #4472
Adapt prefill to new auth context #4472
Conversation
27244ce
to
0d96730
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4472 +/- ##
==========================================
- Coverage 96.57% 96.56% -0.02%
==========================================
Files 720 720
Lines 24000 24017 +17
Branches 2843 2847 +4
==========================================
+ Hits 23179 23192 +13
- Misses 559 562 +3
- Partials 262 263 +1 ☔ View full report in Codecov by Sentry. |
0d96730
to
9544ff4
Compare
c1e5444
to
46e2784
Compare
The value will need to be updated too, but that will involve some migrations and import shims to update the prefill configuration.
…ext data The legacy machtigen data-structure is deprecated, instead, we check more strictly for a BSN in a mandate context set by authentication.
Updating the values of the choices means we need to update the values of existing form definitions and variables, otherwise the code will get non-matching equality comparisons.
authorised_person is a confusing value when the authorizee is actually a company identified by KVK or RSIN, so we rename the value to authorizee instead.
The TODO was handled in previous commits and can be removed.
46e2784
to
1d6a2b1
Compare
@@ -143,7 +143,18 @@ def get_identifier_value( | |||
return submission.auth_info.value | |||
|
|||
if identifier_role == IdentifierRoles.authorizee: | |||
return submission.auth_info.machtigen.get("identifier_value") | |||
legacy_fallback = submission.auth_info.machtigen.get("identifier_value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the code is duplicated but I guess we want that in this explicit way. I would have this in one place to be honest, in contrib for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO that breaks the isolation of plugins and ties them too much to generic open-forms code. in 3.0 we will probably remove the fallback behaviour and then it's just a similar-but-not-the-same pattern. maybe it could become a method on AuthInfo
at some point, but the extra checks if it's a BSN/KVK kind of make it plugin-specific what needs to be checked.
In essence this is one-time only code, but because StUF-BG and HaalCentraal BRP plugins are alternatives for the same functionality, this code is duplicated.
Closes #4246
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Commit hygiene