EasyEngine / auth-command

4 stars 9 forks source link

GH-34 Fix for `ee auth delete global` and `ee auth delete global --ip` #53

Open PiyushKhurana opened 3 years ago

PiyushKhurana commented 3 years ago

1st Issue

Reference #34

Approach

The additional code will ensure that if a site only have global auths , it will not be kept in separate site specific htpasswd file.

What was causing problem

When we create a auth on a site then again add a global auth on the site , and then remove auth (not global) from the site, the site specific htpasswd file is only storing global auths which is redundant as httpasswd/default file will be storing it.So when we delete global auth from site , the site specific htpasswd file will remain as it is.So the solution was to make sure that if a site only have global auths , it will not be kept in separate site specific htpasswd file.

2nd Issue

Reference https://github.com/EasyEngine/auth-command/issues/34#issuecomment-939787167

Approach

The additional code will ensure that if a site only have global ip whitelist , it will not be kept in separate site specific avl file.

What was causing problem

When on a site there are both global and site specific ip whitelist present and when we remove site specific ip whitelist first , the site specific avl file is only storing global ip whitelist which is redundant as vhost.d/default_avl file will be storing it.So when we delete global ip whitelist , the site specific avl file will remain as it is.So the solution was to make sure that if a site only have global ip whitelist , it will not be kept in separate site specific avl.