-
Notifications
You must be signed in to change notification settings - Fork 63
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
Identity/set update should work on existing server-set Identities #4427
Comments
Should we move the merging stuff to IdentityRepository?
|
This means that we have identities with Ids in both places (auto provisionned ones and the repo) correct? -> This means that the repo need to store Ids being a sha256 in base64. So not just UUIDs. We thus need to adapt the Cassandra storage accordingly. |
How about just change server-set Identities id from sha256 to UUID.fromString(address.asString) ? |
How about only 1 update API at IdentityRepository for all kinds of updates:
|
With hash keep in mind hash collision chances. Here the risk is low (as the set of address is pre-defined) so your proposal ikely make perfect sense but I would oppose it if the user could gain control on the hash generation... |
This leads to much more duplicated code, no?
Then when we have business logic, we should have a separate DAO layer. Given that the dao layer blindly stores ids generated by the repository layer, this would make sense. |
Where is the more duplicated code you mean? |
Why
Users should be able to customize server-set identities.
Requires
How
Merge server-set identities and custom identities at Repository layer (list API). Here is a hint how to merge them:
IdentityRepository
toIdentityGetMethod
.List<Identity>
fromIdentityFactory
andIdentityRepository
. We need to merge it.List<Identity>
from custom identities first, call itlistCustomIdentities
.listCustomIdentities
we get it ids, call itidsCustomIdentities
.listServerIdentities
, filter which one is not inidsCustomIdentities
(this avoid having 2 duplicated record from server identities (maybe outdated one) and custom identities (maybe updated one), we just care about updated one) then we getlistServerIdentitiesFiltered
listCustomIdentities
andlistServerIdentitiesFiltered
Then filter element equals input Identity Id: If present call do updateX(Username username, IdentityId id, Identity newIdentity), if empty return notUpdated.
And this updateX API call DAO' update API which should just be an insert into query.
DoD
Note
The text was updated successfully, but these errors were encountered: