[CORE-3421] Multi-Factor ID Sync implementation#1306
Conversation
| @ExcludedFromGeneratedTestCoverageReports("Data class with generated code") | ||
| data class ExternalCredential( | ||
| val value: TokenizableString.Tokenized, | ||
| val subjectId: String, |
There was a problem hiding this comment.
Have we abandoned the idea for many-to-many relationship between subjects and external credentials?
Also, do both subject and external credentials need pointers to each other? If they are in a parent-child relationship, usually only the parent needs a pointer to its children.
There was a problem hiding this comment.
This is done the same way as it is implemented in Subject and FingerprintSample/FaceSample - the subject has list of samples, and the samples have referenceId pointing to the subject.
It's important to remember that these are the domain-level models that are used for our convenience, and sometimes we require the external credentials of a subject, and sometimes - a subject id from the external credential. Pointing to each other shouldn't bring any technical overhead or confusion, as such approach has already been implemented in different models
There was a problem hiding this comment.
Sure, if it's needed, doesn't hurt.
What about the many-to-many relationship?
There was a problem hiding this comment.
It is already implemented. A subject can have multiple external credentials, an external credential can refer any subject. I.e.
Subject 1
- Credentials: ['ABC', 'DCE']
Subject 2
- Credentials: ['ABC']
Credential 1
- Name: 'ABC'
- Subject ref: 'Subject 1'
Credential 2
- Name: 'ABC'
- Subject ref: 'Subject 2'
Credential 3
- Name: 'DCE'
- Subject ref: 'Subject 1'
There was a problem hiding this comment.
That is not a "many-to-many" relationship? 😕 In your example, you are mixing up values and IDs; it should have been something like:
Subject 1
- Credentials: ['Credential 1', 'Credential 3']
Subject 2
- Credentials: ['Credential 2']
Credential 1
- Name: 'ABC'
- Subject ref: 'Subject 1'
Credential 2
- Name: 'ABC'
- Subject ref: 'Subject 2'
Credential 3
- Name: 'DCE'
- Subject ref: 'Subject 1'
Which is actually one-to-many. Unless the name is part of the ID, but then it should not be possible to have separate "Credential 1" and "Credential 2".
Nothing wrong with the approach, we just need to be on the same page about the terminology.
There was a problem hiding this comment.
OK, I see. The confusion comes from the discrepancy between the semantic meaning of "a credential" ('ABC') and what the ExternalCredential model represents ('ABC'+subjectId).
BurningAXE
left a comment
There was a problem hiding this comment.
In general looks good but we must decide on the relationship between subjects and external credentials because it will be much harder to change later.
…entRecordCreationEvent. Renaming `DbDbExternalCredential` to `DbExternalCredential`
…trics class. Otherwise, it creates more overhead to populate the credentials field
|



JIRA ticket
Will be released in: 2025.3.0
Notable changes
External Credentialmodel is added to the domain and data layersExternal Credentialcan now be linked to aSubjectTesting guidance
Additional work checklist