)]}'
{"barbican/api/controllers/orders.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"33eb9e4aa38938938644ef757da423ffdac9ab88","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                container_ref \u003d order_meta.get(\u0027container_ref\u0027)"},{"line_number":207,"context_line":"                validators.validate_stored_key_rsa_container("},{"line_number":208,"context_line":"                    external_project_id,"},{"line_number":209,"context_line":"                    container_ref, pecan.request)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        new_order \u003d models.Order()"},{"line_number":212,"context_line":"        new_order.meta \u003d body.get(\u0027meta\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_d22b4a32","line":209,"updated":"2015-05-27 03:49:56.000000000","message":"if what\u0027s really needed is the context, why not pass that instead? Either way, I think the policy in enforcement should go here instead of in the validators.","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"a6ef167a653f5210615950c7284732671125e530","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                container_ref \u003d order_meta.get(\u0027container_ref\u0027)"},{"line_number":207,"context_line":"                validators.validate_stored_key_rsa_container("},{"line_number":208,"context_line":"                    external_project_id,"},{"line_number":209,"context_line":"                    container_ref, pecan.request)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        new_order \u003d models.Order()"},{"line_number":212,"context_line":"        new_order.meta \u003d body.get(\u0027meta\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_ebfe3304","line":209,"in_reply_to":"7a016987_d22b4a32","updated":"2015-05-27 17:24:30.000000000","message":"Yes, context can be passed-in instead of request though will need to get that populated beforehand. Added logic there as validation logic is implemented in that specific module/ method.","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"}],"barbican/common/validators.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"33eb9e4aa38938938644ef757da423ffdac9ab88","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        inst \u003d controllers.containers.ContainerController(container)"},{"line_number":115,"context_line":"        controllers._do_enforce_rbac(inst, req,"},{"line_number":116,"context_line":"                                     controllers.containers.CONTAINER_GET,"},{"line_number":117,"context_line":"                                     ctxt)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_920ef2e3","line":117,"updated":"2015-05-27 03:49:56.000000000","message":"Somehow it feels weird that rbac is being enforced in the validator. Pretty much breaks the semantics here. I would prefer this to be moved outside, where this function is called. This would even make things simpler as then you wouldn\u0027t need to pass the request","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3af79e8827e3ca51b7ae10377bc91705cb748ac6","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        inst \u003d controllers.containers.ContainerController(container)"},{"line_number":115,"context_line":"        controllers._do_enforce_rbac(inst, req,"},{"line_number":116,"context_line":"                                     controllers.containers.CONTAINER_GET,"},{"line_number":117,"context_line":"                                     ctxt)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_8442bb3c","line":117,"in_reply_to":"7a016987_31449572","updated":"2015-05-29 14:31:22.000000000","message":"Oz, I don\u0027t see any reason elements in the requests should not be validated here.  Part of the reason for this is to extract the validation code for each order type so as to not clutter the controller.\n\nAlso, remember that this is not rbac on the request, but rather rbac on the specific resources being referred to in the request.","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"},{"author":{"_account_id":11561,"name":"Dave McCowan","email":"dmccowan@cisco.com","username":"dave-mccowan"},"change_message_id":"6ffa381ed83b9fcbdcbbecdeda1a4c0ffd706f78","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        inst \u003d controllers.containers.ContainerController(container)"},{"line_number":115,"context_line":"        controllers._do_enforce_rbac(inst, req,"},{"line_number":116,"context_line":"                                     controllers.containers.CONTAINER_GET,"},{"line_number":117,"context_line":"                                     ctxt)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_31449572","line":117,"in_reply_to":"7a016987_920ef2e3","updated":"2015-05-28 15:24:10.000000000","message":"I think it makes sense to do this enforcement here.  Also, we need the request and context in the validators for other purposes.  Take a look at https://review.openstack.org/#/c/171023/ and also the CA ID validator needs the context.","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"},{"author":{"_account_id":1091,"name":"Arun Kant","email":"arukant@cisco.com","username":"arunkant-uws"},"change_message_id":"a6ef167a653f5210615950c7284732671125e530","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        inst \u003d controllers.containers.ContainerController(container)"},{"line_number":115,"context_line":"        controllers._do_enforce_rbac(inst, req,"},{"line_number":116,"context_line":"                                     controllers.containers.CONTAINER_GET,"},{"line_number":117,"context_line":"                                     ctxt)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a016987_f0b982ed","line":117,"in_reply_to":"7a016987_920ef2e3","updated":"2015-05-27 17:24:30.000000000","message":"I was thinking of this more like one additional validation step. And this module/method seems to include validation  logic for controller layer. If added in controller class side, then lines# 93 to 104 will need to be duplicated and above container read will become additional database call .\n\nI am not sure if implemented in controller side, a question may come up around why its not added in validators module. I don\u0027t have strong preference in having this logic here or in controller class.","commit_id":"7dc48c5f73b643a8afbaf0dfa1a9b8de1c1807f8"}],"barbican/tests/api/controllers/test_orders.py":[{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"9aae3402b303911d5d4c7b9c00fa3de9667cfa8d","unresolved":false,"context_lines":[{"line_number":622,"context_line":""},{"line_number":623,"context_line":"        self.app.extra_environ \u003d {"},{"line_number":624,"context_line":"            \u0027barbican.context\u0027: self._build_context("},{"line_number":625,"context_line":"                self.project_id, roles\u003d[\u0027creator\u0027], user\u003d\u0027anyUserId\u0027,"},{"line_number":626,"context_line":"                is_admin\u003dFalse, policy_enforcer\u003dself.policy_enforcer)"},{"line_number":627,"context_line":"        }"},{"line_number":628,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bab921fb_e11a036e","line":625,"updated":"2015-04-23 20:18:45.000000000","message":"The only difference between this test and the one above (up to this point) is the user\u003d setting there. Could some of these create_container, manage_acls, and extra_environ lines be put into private helper method on this class to reduce the total number of lines?","commit_id":"f75629d231eee55e443bf95741e45dfbe6eab2ce"}]}
