[ENH] ✨ Store certificate fingerprint without prefix in inseePropriete - #989
Conversation
inseeProprieteinseePropriete
| "inseePropriete", | ||
| "certificateId$" + certificateId)))); | ||
| "certificateId$" + certificateId, | ||
| certificateId)))); |
There was a problem hiding this comment.
Does it work if one of both values doesnt exist ?
There was a problem hiding this comment.
No, you're right
I'm splitting the plain fingerprint deletion into a separate request that tolerates NO_SUCH_ATTRIBUTE, so it won't break on existing data. Pushing a fix.
There was a problem hiding this comment.
not working case : an existing account created before this pr with a certificate has only the certificateId$... property.
After PR, this line try to remove two values, one with, one without certificateId, but the one without certificateId doesnt exist, so the modification fails.
There was a problem hiding this comment.
ok, so i think we can use your new method on the previous deletion of certificateId$ to be more readable
There was a problem hiding this comment.
Fixed — both values now go through the same tolerant deletion helper. Pushed.
#988) Signed-off-by: Amaury Cormier <amaury.cormier@insee.fr> Co-authored-by: Claude <noreply@anthropic.com>
d1b367e to
1d7a95f
Compare
Description
Closes #988
Keycloak's X.509 authentication module needs to look up a user from the raw SHA-256 fingerprint of the presented certificate, without knowing or reconstructing the existing
certificateId$prefix used ininseePropriete.This PR adds the plain fingerprint
<fingerprint>as a second value of the multivaluedinseeProprieteattribute, alongside the existingcertificateId$<fingerprint>value:updateUserCertificate: adds both values when a new certificate is set, and deletes both values (old fingerprint) when replacing an existing certificate.deleteUserCertificate: deletes both values when removing a certificate.Scope
sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapWriterStore.javaOut of scope
Checklist
inseePropriete(Keycloak X.509 authentication support) #988)mvn spotless:applyapplied