mifi / cognito-backup

CLI for backing up AWS Cogntito User Pools
MIT License
154 stars 26 forks source link

Would you accept a PR to disable users during restore? #34

Open WGriffing opened 1 year ago

WGriffing commented 1 year ago

The backup json files include the Enabled boolean attribute, but in my experience this value is not utilized during the restore.

As a result, previously disabled, backed-up accounts are no longer disabled after restoring from that backup.

It's easy enough to handle this case outside of this tool, but since I've gotten a lot of mileage out of the tool I would be happy to contribute back if there is interest.

mifi commented 1 year ago

How would you do that during restore? sounds like somethign we could add, maybe behind a CLI flag

WGriffing commented 1 year ago

How would you do that during restore? sounds like somethign we could add, maybe behind a CLI flag

Similar to how you are doing the groups. At some point after the user is created, add logic to the effect of:

if( user.Disabled === false) {
  AdminDisableUser(...)
}

I'd try to make the case that this should be the default behavior so the restored state more closely matches the backed-up state, but I wouldn't argue against a CLI flag to disable the proposed behavior.

mifi commented 1 year ago

sound good to me