)]}'
{"refstack/api/controllers/vendors.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"fe055fbcd73795ed3645379d4cd91f591b4f13fe","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        db.update_organization(org_info)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def deny(self, vendor_id, reason):"},{"line_number":245,"context_line":"        \"\"\"Handler for making vendor official.\"\"\""},{"line_number":246,"context_line":"        if not reason:"},{"line_number":247,"context_line":"            raise api_exc.ValidationError(\u0027Param \"reason\" can not be empty\u0027)"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_a162b9d6","line":245,"range":{"start_line":245,"start_character":11,"end_line":245,"end_character":46},"updated":"2016-04-12 04:42:10.000000000","message":"Update this doc string to reflect \"denying a vendor\".","commit_id":"2d2a1ddda040abdb2d926c336fe644dd1113ad29"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"3a38f840be6f677e93fe44998cbad5985e1e604e","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    vendor[\u0027can_manage\u0027] \u003d True"},{"line_number":147,"context_line":"            else:"},{"line_number":148,"context_line":"                result \u003d dict()"},{"line_number":149,"context_line":"                types \u003d [const.FOUNDATION, const.OFFICIAL_VENDOR]"},{"line_number":150,"context_line":"                vendors \u003d db.get_organizations_by_types("},{"line_number":151,"context_line":"                    types, allowed_keys\u003dallowed_keys)"},{"line_number":152,"context_line":"                for vendor in vendors:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_c394e2e3","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":41},"updated":"2016-04-13 02:54:26.000000000","message":"Should we allow everyone to list the FOUNDATION vendor object?  What would be the use case?  Other than the foundation members, I do not see a need for anyone else to list this object.","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"18e5012a71e5c14c24eaa0ffab2fd7b96bdaa1b9","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    vendor[\u0027can_manage\u0027] \u003d True"},{"line_number":147,"context_line":"            else:"},{"line_number":148,"context_line":"                result \u003d dict()"},{"line_number":149,"context_line":"                types \u003d [const.FOUNDATION, const.OFFICIAL_VENDOR]"},{"line_number":150,"context_line":"                vendors \u003d db.get_organizations_by_types("},{"line_number":151,"context_line":"                    types, allowed_keys\u003dallowed_keys)"},{"line_number":152,"context_line":"                for vendor in vendors:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_7cb7043a","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":41},"in_reply_to":"5a18252c_3a281586","updated":"2016-04-14 16:14:30.000000000","message":"I see your point and agree to keep Foundation here.  \n\nI don\u0027t see that Foundation will own Products, but I do see that it would own Guidelines.","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"b7d6a24cfcce94a690a743e76cd175939cc9bc94","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    vendor[\u0027can_manage\u0027] \u003d True"},{"line_number":147,"context_line":"            else:"},{"line_number":148,"context_line":"                result \u003d dict()"},{"line_number":149,"context_line":"                types \u003d [const.FOUNDATION, const.OFFICIAL_VENDOR]"},{"line_number":150,"context_line":"                vendors \u003d db.get_organizations_by_types("},{"line_number":151,"context_line":"                    types, allowed_keys\u003dallowed_keys)"},{"line_number":152,"context_line":"                for vendor in vendors:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_17398bd7","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":41},"in_reply_to":"5a18252c_7cb7043a","updated":"2016-04-14 16:27:19.000000000","message":"Foundation will own OpenStack :)","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"96c389a02cbe89ce3920bee52358e1e63b8243f8","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    vendor[\u0027can_manage\u0027] \u003d True"},{"line_number":147,"context_line":"            else:"},{"line_number":148,"context_line":"                result \u003d dict()"},{"line_number":149,"context_line":"                types \u003d [const.FOUNDATION, const.OFFICIAL_VENDOR]"},{"line_number":150,"context_line":"                vendors \u003d db.get_organizations_by_types("},{"line_number":151,"context_line":"                    types, allowed_keys\u003dallowed_keys)"},{"line_number":152,"context_line":"                for vendor in vendors:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_3a281586","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":41},"in_reply_to":"5a18252c_c394e2e3","updated":"2016-04-14 06:12:32.000000000","message":"I don\u0027t see why we should hide it.\nIn the future we will show another public objects like Product, Guidelines that will be linked to Foundation owner. And view is more correct user knows and can see what is it (foundation vendor)","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"d62a2ed5b0cc77bc070a313530910b684ca11ab6","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        allowed_keys \u003d None"},{"line_number":176,"context_line":"        is_admin \u003d (api_utils.check_user_is_foundation_admin()"},{"line_number":177,"context_line":"                    or api_utils.check_user_is_vendor_admin(vendor_id))"},{"line_number":178,"context_line":"        if not is_admin:"},{"line_number":179,"context_line":"            allowed_keys \u003d [\u0027id\u0027, \u0027type\u0027, \u0027name\u0027, \u0027description\u0027]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        vendor \u003d db.get_organization(vendor_id, allowed_keys\u003dallowed_keys)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_7d10d001","line":178,"range":{"start_line":178,"start_character":11,"end_line":178,"end_character":23},"updated":"2016-04-14 01:57:16.000000000","message":"Should also check whether the vendor type is of the allowed types like (const.OFFICIAL_VENDOR...)\n\nCurrently, anyone can perform get a vendor details with a known vendor_id.","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"18e5012a71e5c14c24eaa0ffab2fd7b96bdaa1b9","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        allowed_keys \u003d None"},{"line_number":176,"context_line":"        is_admin \u003d (api_utils.check_user_is_foundation_admin()"},{"line_number":177,"context_line":"                    or api_utils.check_user_is_vendor_admin(vendor_id))"},{"line_number":178,"context_line":"        if not is_admin:"},{"line_number":179,"context_line":"            allowed_keys \u003d [\u0027id\u0027, \u0027type\u0027, \u0027name\u0027, \u0027description\u0027]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        vendor \u003d db.get_organization(vendor_id, allowed_keys\u003dallowed_keys)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_e19b6d64","line":178,"range":{"start_line":178,"start_character":11,"end_line":178,"end_character":23},"in_reply_to":"5a18252c_1f51cb36","updated":"2016-04-14 16:14:30.000000000","message":"Agree that this should be correlated with the \u0027get\u0027 method. \n \nHere is my test scenario:\n\n1) A user logs in, creates a vendor (which will be of type private). The user notes the vendor_id.\n2) The User logs out.\n3) Without login (now as an anonymous user), with the current code, the user is able to get the record from \n  v1/vendors/{vendor_id}.\n4) Should the user be able to get this record? because he is now an anonymous user and does not own that private vendor object.\n\nI think if the user is not is_admin (that is not foundation or vendor user), he can only get record of allowed types (public or foundation as defined in the get method).\n\nThe get method works as intended, but the get_one does not as coded currently.","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"96c389a02cbe89ce3920bee52358e1e63b8243f8","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        allowed_keys \u003d None"},{"line_number":176,"context_line":"        is_admin \u003d (api_utils.check_user_is_foundation_admin()"},{"line_number":177,"context_line":"                    or api_utils.check_user_is_vendor_admin(vendor_id))"},{"line_number":178,"context_line":"        if not is_admin:"},{"line_number":179,"context_line":"            allowed_keys \u003d [\u0027id\u0027, \u0027type\u0027, \u0027name\u0027, \u0027description\u0027]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        vendor \u003d db.get_organization(vendor_id, allowed_keys\u003dallowed_keys)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_1f51cb36","line":178,"range":{"start_line":178,"start_character":11,"end_line":178,"end_character":23},"in_reply_to":"5a18252c_7d10d001","updated":"2016-04-14 06:12:32.000000000","message":"This is correlated with \u0027get\u0027 method.\nIf anonymous can list something then he can call \u0027get_one\u0027 for same data.\nAlso I treat your spec in a same way - https://github.com/openstack/refstack/blob/master/specs/mitaka/approved/vendor-registration-api.rst\n\n- Response for non-foundation or vendor admins:\n- Response for foundation or vendor admin users:","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"b7d6a24cfcce94a690a743e76cd175939cc9bc94","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        allowed_keys \u003d None"},{"line_number":176,"context_line":"        is_admin \u003d (api_utils.check_user_is_foundation_admin()"},{"line_number":177,"context_line":"                    or api_utils.check_user_is_vendor_admin(vendor_id))"},{"line_number":178,"context_line":"        if not is_admin:"},{"line_number":179,"context_line":"            allowed_keys \u003d [\u0027id\u0027, \u0027type\u0027, \u0027name\u0027, \u0027description\u0027]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        vendor \u003d db.get_organization(vendor_id, allowed_keys\u003dallowed_keys)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_7749df5f","line":178,"range":{"start_line":178,"start_character":11,"end_line":178,"end_character":23},"in_reply_to":"5a18252c_e19b6d64","updated":"2016-04-14 16:27:19.000000000","message":"ok, I\u0027ve got your point.\nWill rework this.","commit_id":"f068d6af4be66a9113d742a36375db249e08a79d"}],"refstack/api/validators.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"fe055fbcd73795ed3645379d4cd91f591b4f13fe","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    }"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def validate(self, request):"},{"line_number":194,"context_line":"        \"\"\"Validate uploaded test results.\"\"\""},{"line_number":195,"context_line":"        super(VendorValidator, self).validate(request)"},{"line_number":196,"context_line":"        body \u003d json.loads(request.body)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_e1c67115","line":194,"range":{"start_line":194,"start_character":11,"end_line":194,"end_character":42},"updated":"2016-04-12 04:42:10.000000000","message":"Change this to something like \u0027Validate uploaded vendor data\u0027","commit_id":"2d2a1ddda040abdb2d926c336fe644dd1113ad29"}],"refstack/tests/api/test_vendors.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"fe055fbcd73795ed3645379d4cd91f591b4f13fe","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @mock.patch(\u0027refstack.api.utils.get_user_id\u0027, return_value\u003d\u0027test-open-id\u0027)"},{"line_number":102,"context_line":"    def test_delete(self, mock_get_user):"},{"line_number":103,"context_line":"        \"\"\"Test get request.\"\"\""},{"line_number":104,"context_line":"        vendor \u003d json.dumps(FAKE_VENDOR)"},{"line_number":105,"context_line":"        post_response \u003d self.post_json(self.URL, params\u003dvendor)"},{"line_number":106,"context_line":"        self.delete(self.URL + post_response.get(\u0027id\u0027))"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_819cdd6a","line":103,"range":{"start_line":103,"start_character":11,"end_line":103,"end_character":27},"updated":"2016-04-12 04:42:10.000000000","message":"Don\u0027t forget to update these :)","commit_id":"2d2a1ddda040abdb2d926c336fe644dd1113ad29"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"fe055fbcd73795ed3645379d4cd91f591b4f13fe","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    @mock.patch(\u0027refstack.api.utils.get_user_id\u0027, return_value\u003d\u0027test-open-id\u0027)"},{"line_number":109,"context_line":"    def test_action(self, mock_get_user):"},{"line_number":110,"context_line":"        \"\"\"Test get request.\"\"\""},{"line_number":111,"context_line":"        vendor \u003d json.dumps(FAKE_VENDOR)"},{"line_number":112,"context_line":"        post_response \u003d self.post_json(self.URL, params\u003dvendor)"},{"line_number":113,"context_line":"        vendor_id \u003d post_response.get(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_c18c1538","line":110,"range":{"start_line":110,"start_character":11,"end_line":110,"end_character":27},"updated":"2016-04-12 04:42:10.000000000","message":"Here as well.","commit_id":"2d2a1ddda040abdb2d926c336fe644dd1113ad29"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"fe055fbcd73795ed3645379d4cd91f591b4f13fe","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @mock.patch(\u0027refstack.api.utils.get_user_id\u0027, return_value\u003d\u0027test-open-id\u0027)"},{"line_number":121,"context_line":"    def test_update(self, mock_get_user):"},{"line_number":122,"context_line":"        \"\"\"Test get request.\"\"\""},{"line_number":123,"context_line":"        vendor \u003d json.dumps(FAKE_VENDOR)"},{"line_number":124,"context_line":"        post_response \u003d self.post_json(self.URL, params\u003dvendor)"},{"line_number":125,"context_line":"        vendor_id \u003d post_response.get(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_01872d10","line":122,"range":{"start_line":122,"start_character":11,"end_line":122,"end_character":28},"updated":"2016-04-12 04:42:10.000000000","message":"And here.","commit_id":"2d2a1ddda040abdb2d926c336fe644dd1113ad29"}]}
