{"action":"created","issue":{"url":"https://api.github.com/repos/SSSD/sssd/issues/11","repository_url":"https://api.github.com/repos/SSSD/sssd","labels_url":"https://api.github.com/repos/SSSD/sssd/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/SSSD/sssd/issues/11/comments","events_url":"https://api.github.com/repos/SSSD/sssd/issues/11/events","html_url":"https://github.com/SSSD/sssd/pull/11","id":174527674,"number":11,"title":"SECRETS: Don't remove a container when it has children","user":{"login":"fidencio","id":112762,"avatar_url":"https://avatars.githubusercontent.com/u/112762?v=3","gravatar_id":"","url":"https://api.github.com/users/fidencio","html_url":"https://github.com/fidencio","followers_url":"https://api.github.com/users/fidencio/followers","following_url":"https://api.github.com/users/fidencio/following{/other_user}","gists_url":"https://api.github.com/users/fidencio/gists{/gist_id}","starred_url":"https://api.github.com/users/fidencio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidencio/subscriptions","organizations_url":"https://api.github.com/users/fidencio/orgs","repos_url":"https://api.github.com/users/fidencio/repos","events_url":"https://api.github.com/users/fidencio/events{/privacy}","received_events_url":"https://api.github.com/users/fidencio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-01T13:46:08Z","updated_at":"2016-09-14T10:15:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SSSD/sssd/pulls/11","html_url":"https://github.com/SSSD/sssd/pull/11","diff_url":"https://github.com/SSSD/sssd/pull/11.diff","patch_url":"https://github.com/SSSD/sssd/pull/11.patch"},"body":"Let's return and log an error in case the container to be removed has\r\nchildren.\r\n\r\nThe approach taken introduced at least one new search in every delete\r\noperation. As far as I understand searching in the BASE scope is quite\r\ncheap and that's the reason I decided to just do the search in the\r\nONELEVEL scope when the deleted dn is for sure a container.\r\n\r\nWhile the first patch is not needed for solving this issue, it's needed for adding something to a container.\r\n\r\nThe easiest way to test would be:\r\n- Create a container: curl -H \"Content-Type: application/json\" --unix-socket /var/run/secrets.socket -XPOST http://localhost/secrets/bar/\r\n- Create a container inside the firstly created container: curl -H \"Content-Type: application/json\" --unix-socket /var/run/secrets.socket -XPOST http://localhost/secrets/bar/foo/\r\n- Add a secret to the container: curl -H \"Content-Type: application/json\" --unix-socket /var/run/secrets.socket -XPUT http://localhost/secrets/bar/foo/test -d'{\"type\":\"simple\",\"value\":\"foosecret\"}'\r\n- Try to remove the container bar: curl -H \"Content-Type: application/json\" --unix-socket /var/run/secrets.socket -XDELETE http://localhost/secrets/bar/\r\n\r\nWith the patch you won't be able to remove unless it has no children. Without, you will be able to remove the container."},"comment":{"url":"https://api.github.com/repos/SSSD/sssd/issues/comments/246967824","html_url":"https://github.com/SSSD/sssd/pull/11#issuecomment-246967824","issue_url":"https://api.github.com/repos/SSSD/sssd/issues/11","id":246967824,"user":{"login":"jhrozek","id":715522,"avatar_url":"https://avatars.githubusercontent.com/u/715522?v=3","gravatar_id":"","url":"https://api.github.com/users/jhrozek","html_url":"https://github.com/jhrozek","followers_url":"https://api.github.com/users/jhrozek/followers","following_url":"https://api.github.com/users/jhrozek/following{/other_user}","gists_url":"https://api.github.com/users/jhrozek/gists{/gist_id}","starred_url":"https://api.github.com/users/jhrozek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhrozek/subscriptions","organizations_url":"https://api.github.com/users/jhrozek/orgs","repos_url":"https://api.github.com/users/jhrozek/repos","events_url":"https://api.github.com/users/jhrozek/events{/privacy}","received_events_url":"https://api.github.com/users/jhrozek/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T10:15:18Z","updated_at":"2016-09-14T10:15:18Z","body":"The first patch was already pushed.\r\n\r\nThe second looks good to me visually and I wrote a simple patch to verify the fix:\r\nhttps://github.com/jhrozek/sssd/commit/374eff89472a3181548495ed74deadaa690e921e"}}
{"actor":{"display_login":"jhrozek"}}