Reduce complexity of the account_update #5

Closed
opened 2023-07-30 20:23:55 +00:00 by silver · 10 comments
silver commented 2023-07-30 20:23:55 +00:00 (Migrated from gitlab.skynet.ie)

Currently it is complex af, see if it can be made cleaner

Currently it is complex af, see if it can be made cleaner
silver commented 2023-07-30 20:23:55 +00:00 (Migrated from gitlab.skynet.ie)

assigned to @silver

assigned to @silver
silver commented 2023-07-30 20:35:14 +00:00 (Migrated from gitlab.skynet.ie)

Thanks to 11b348326a we dont actually require this field in teh ldap so that on its own will reduce the complexity

Thanks to 11b348326a053b7b8798ca8aa08cb709df534263 we dont actually require this field in teh ldap so that on its own will reduce the complexity
evanc commented 2023-07-30 20:36:47 +00:00 (Migrated from gitlab.skynet.ie)

If password isn't secure, or they are updating password
skSecure or field == "userPassword`
change password to new password (or existing one if not changing it)
mark secure

if not changing password
Mod::Replace(field, HashSet::from([value]))

image

If password isn't secure, or they are updating password `skSecure` or field == "userPassword` change password to new password (or existing one if not changing it) mark secure if not changing password Mod::Replace(field, HashSet::from([value])) ![image](/uploads/634824613fc32f7eaa3f09642ce39987/image.png)
evanc commented 2023-07-30 20:37:42 +00:00 (Migrated from gitlab.skynet.ie)

put all that in the if !rs.is_empty() { block and then you're done

put all that in the `if !rs.is_empty() {` block and then you're done
evanc commented 2023-07-30 20:38:22 +00:00 (Migrated from gitlab.skynet.ie)

IE replace lines 46 on

IE replace lines 46 on
evanc commented 2023-07-30 20:39:47 +00:00 (Migrated from gitlab.skynet.ie)

That second if should be if not the userPassword field. Not as an else to the above block

That second if should be if not the userPassword field. Not as an else to the above block
silver commented 2023-07-30 20:41:32 +00:00 (Migrated from gitlab.skynet.ie)

mentioned in commit bf1d91e110

mentioned in commit bf1d91e110a40f854e4c51a3b560cb4d38831b8c
evanc commented 2023-07-30 20:43:16 +00:00 (Migrated from gitlab.skynet.ie)

specifically because you don't want to continue on doing stuff if you can't get anything back from the ldap or the user doesn't exist or something

specifically because you don't want to continue on doing stuff if you can't get anything back from the ldap or the user doesn't exist or something
silver commented 2023-07-30 20:44:12 +00:00 (Migrated from gitlab.skynet.ie)

That commit should fix it up

That commit should fix it up
silver commented 2023-07-30 21:20:24 +00:00 (Migrated from gitlab.skynet.ie)

mentioned in commit 344d958aec

mentioned in commit 344d958aec4ba2750713f76e63d310e83e040584
silver (Migrated from gitlab.skynet.ie) closed this issue 2023-08-02 12:38:44 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Skynet/ldap_backend#5
No description provided.