Closed (fixed)
Project:
External Authentication
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2016 at 18:22 UTC
Updated:
4 Apr 2017 at 11:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
roderikAgreed.
I don't think an extra explicit check is needed; if we change the database index, the save() will throw an exception, so that should be enough.
And the exception is pretty easy to prevent by a depending module; just call authmap->getUid($authname, $provider) or externalauth->load($authname, $provider). (I implemented this patch when I thought I really needed it to harden a module's code... but that turns out to be a mistake.)
I don't know if this exception should be documented in the interface; I just added comments (in a related and an only vaguely related place, to un-confuse myself).
Comment #3
snufkin commentedYeah this makes sense. The change itself doesn't mean that the module will do extra validation, simply by making the authname and provider fields together a unique index prevents other modules and extensions from saving duplicate information, helping modules that depend on this one from making a mistake.
Comment #5
svendecabooterThank you for the patch and review.
It didn't apply to current HEAD, but I rerolled and committed.