)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"3675985516332d245b26251fcab7840c01b6aa8c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove db layer hard-code permission checks for services and compute_nodes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patches removes db layer hard-code permission checks for services"},{"line_number":10,"context_line":"and compute_nodes related extensions: availability_zone, hosts, hypervisors,"},{"line_number":11,"context_line":"services."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Partially implements bp v3-api-policy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da86d52c_8f0a2288","line":10,"updated":"2015-02-11 22:25:21.000000000","message":"guess you didn\u0027t change availability_zone here?","commit_id":"7f8a83c926a0bd7d28cf6ee0e8e1f3595428984b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9cddc8a74bede1bfce8044daacc237f552fdd3f9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove db layer hard-code permission checks for services and compute_nodes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patches removes db layer hard-code permission checks for services"},{"line_number":10,"context_line":"and compute_nodes related extensions: availability_zone, hosts, hypervisors,"},{"line_number":11,"context_line":"services."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Partially implements bp v3-api-policy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da86d52c_6849e931","line":10,"in_reply_to":"da86d52c_8f0a2288","updated":"2015-02-15 23:56:23.000000000","message":"yes, good catch :)","commit_id":"7f8a83c926a0bd7d28cf6ee0e8e1f3595428984b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ef8b978a0f24ea8492eb028b6944d6795bbb034","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch also correct the related unittest. For v2.1 unittest, all"},{"line_number":13,"context_line":"the test should run with normal user context that can ensure the v2.1"},{"line_number":14,"context_line":"code is un0winded by any other permission checks except policy enforcement."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Partially implements bp v3-api-policy"},{"line_number":17,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba7be1f8_98ccecbc","line":14,"updated":"2015-02-26 16:44:53.000000000","message":"un0winded?","commit_id":"3c011196d4e25ae57c951425aec763b6b6579af4"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch also correct the related unittest. For v2.1 unittest, all"},{"line_number":13,"context_line":"the test should run with normal user context that can ensure the v2.1"},{"line_number":14,"context_line":"code is un0winded by any other permission checks except policy enforcement."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Partially implements bp v3-api-policy"},{"line_number":17,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba7be1f8_54678925","line":14,"in_reply_to":"ba7be1f8_98ccecbc","updated":"2015-02-27 07:45:26.000000000","message":"oops, typo, thanks","commit_id":"3c011196d4e25ae57c951425aec763b6b6579af4"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"954ed4e9477ca4ecb98f0f3ca2d3717dd9511b49","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patches remove the hard-code permission checks for db call"},{"line_number":10,"context_line":"service_get_by_host*."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"There are elevated contexts in the code used to call those methods which"},{"line_number":13,"context_line":"aren\u0027t removed in this patch. The elevated context will be cleaned up in"},{"line_number":14,"context_line":"last step. This is safe if we forget removing some hard-code permission."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a80dd14_c82aa28f","line":11,"updated":"2015-03-12 12:36:00.000000000","message":"I think you can add detailed function name here to \navoid confusion of host*","commit_id":"00bb89c6773614ae3e74dcac5be98823e6f70cda"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3c4f581953c4a8759577774832b115860d21340a","unresolved":false,"context_lines":[{"line_number":342,"context_line":"###################"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"@require_admin_context"},{"line_number":346,"context_line":"def service_destroy(context, service_id):"},{"line_number":347,"context_line":"    session \u003d get_session()"},{"line_number":348,"context_line":"    with session.begin():"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_58319458","side":"PARENT","line":345,"updated":"2015-02-26 16:56:16.000000000","message":"For the nova compute v2 API we\u0027re requiring admin context for backwards compatibility and for v3 we\u0027re handling via the policy rules, but does this mean anything to cells, e.g.:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/cells/messaging.py#n758\n\nOr is that safe since you have to come in through the API anyway?","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"20d62c869da58618c4dd3ef79793a4ab3f18127b","unresolved":false,"context_lines":[{"line_number":342,"context_line":"###################"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"@require_admin_context"},{"line_number":346,"context_line":"def service_destroy(context, service_id):"},{"line_number":347,"context_line":"    session \u003d get_session()"},{"line_number":348,"context_line":"    with session.begin():"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_ebc6f466","side":"PARENT","line":345,"in_reply_to":"ba7be1f8_58319458","updated":"2015-02-26 17:06:45.000000000","message":"It should be safe since you have to come in through the API.  The policy check moved from one place unaffected by cells to another place unaffected by cells.\n\nIf it were moving to the compute api things would be a bit different.  It should still work but the failure would happen in the cell rather than in nova-api.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":342,"context_line":"###################"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"@require_admin_context"},{"line_number":346,"context_line":"def service_destroy(context, service_id):"},{"line_number":347,"context_line":"    session \u003d get_session()"},{"line_number":348,"context_line":"    with session.begin():"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_4eb535cf","side":"PARENT","line":345,"in_reply_to":"ba7be1f8_ebc6f466","updated":"2015-02-27 07:45:26.000000000","message":"Yes, I think so. whatever we use cell or not. The API is the entrance.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3c4f581953c4a8759577774832b115860d21340a","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        use_slave\u003duse_slave)"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"@require_admin_context"},{"line_number":383,"context_line":"def service_get_all(context, disabled\u003dNone):"},{"line_number":384,"context_line":"    query \u003d model_query(context, models.Service)"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_58cd1430","side":"PARENT","line":382,"updated":"2015-02-26 16:56:16.000000000","message":"I guess we don\u0027t have to worry about the nova-manage commands because they are already getting the admin context?\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/cmd/manage.py#n709\n\nSo if you have access to nova-manage you\u0027re already getting admin so I guess there is no regression here.  Same for service_get_by_args and service_update.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        use_slave\u003duse_slave)"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"@require_admin_context"},{"line_number":383,"context_line":"def service_get_all(context, disabled\u003dNone):"},{"line_number":384,"context_line":"    query \u003d model_query(context, models.Service)"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_eec5093e","side":"PARENT","line":382,"in_reply_to":"ba7be1f8_58cd1430","updated":"2015-02-27 07:45:26.000000000","message":"Yes, you are right. only admin can login into the compute node and execute the nova-manage cmd.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4acc72ac3e7c3c4e9eee3f46af98c7994119a466","unresolved":false,"context_lines":[{"line_number":380,"context_line":""},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"@require_admin_context"},{"line_number":383,"context_line":"def service_get_all(context, disabled\u003dNone):"},{"line_number":384,"context_line":"    query \u003d model_query(context, models.Service)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    if disabled is not None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_4ba700bd","side":"PARENT","line":383,"updated":"2015-02-26 17:11:26.000000000","message":"Looks like you missed this one:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/contrib/instance_usage_audit_log.py#n88\n\nWithout that non-admins can get instance usage audit logs.\n\n--\n\nI also saw hits in ec2.cloud and the availability zone extension using objects.Service.get_all but in those cases they are already elevating the context so it wouldn\u0027t matter (like nova-manage).\n\nSame with the usage of compute.api.availability_zones.get_availability_zones, everything using that passes in an elevated context.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":380,"context_line":""},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"@require_admin_context"},{"line_number":383,"context_line":"def service_get_all(context, disabled\u003dNone):"},{"line_number":384,"context_line":"    query \u003d model_query(context, models.Service)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    if disabled is not None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_4e78d5f8","side":"PARENT","line":383,"in_reply_to":"ba7be1f8_4ba700bd","updated":"2015-02-27 07:45:26.000000000","message":"Thanks! I should add back-compatible check for instance-usage-audit.\n\nFor availability zone in ec2 and v2, they expect to access by normal user. So I needn\u0027t add any back-compatible check.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"337e9cc77b633e38a67f1b3eda83e9ce6c0a7d8b","unresolved":false,"context_lines":[{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@require_admin_context"},{"line_number":393,"context_line":"def service_get_all_by_topic(context, topic):"},{"line_number":394,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":395,"context_line":"                filter_by(disabled\u003dFalse).\\"},{"line_number":396,"context_line":"                filter_by(topic\u003dtopic).\\"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_6ec932ab","side":"PARENT","line":393,"updated":"2015-02-26 17:26:18.000000000","message":"Used in nova.scheduler.driver.Scheduler.hosts_up which wasn\u0027t obvious that it had an admin context but nova.scheduler.chance.ChanceScheduler._schedule calls hosts_up with an elevated admin context so looks OK.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@require_admin_context"},{"line_number":393,"context_line":"def service_get_all_by_topic(context, topic):"},{"line_number":394,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":395,"context_line":"                filter_by(disabled\u003dFalse).\\"},{"line_number":396,"context_line":"                filter_by(topic\u003dtopic).\\"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_8ed00dcb","side":"PARENT","line":393,"in_reply_to":"ba7be1f8_6ec932ab","updated":"2015-02-27 07:45:26.000000000","message":"Yes, It\u0027s ok","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"337e9cc77b633e38a67f1b3eda83e9ce6c0a7d8b","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"@require_admin_context"},{"line_number":401,"context_line":"def service_get_by_host_and_topic(context, host, topic):"},{"line_number":402,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":403,"context_line":"                filter_by(disabled\u003dFalse).\\"},{"line_number":404,"context_line":"                filter_by(host\u003dhost).\\"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_6ed052c9","side":"PARENT","line":401,"updated":"2015-02-26 17:26:18.000000000","message":"Called via nova.objects.Service.get_by_host_and_topic in network manager deallocate_fixed_ip.  Looks like deallocate_for_instance calls that and elevates the context so that\u0027s OK.\n\nremove_fixed_ip_from_instance also calls deallocate_fixed_ip and in the nova-network API that has the @wrap_check_policy decorator and in policy.json we have:\n\n\"network:remove_fixed_ip_from_instance\": \"\",\n\nSo I guess we could now have a non-admin get a service when removing a fixed ip from an instance, is that bad?","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c5f098cbed9ca54dbeb397df79b2f3d33d917c64","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"@require_admin_context"},{"line_number":401,"context_line":"def service_get_by_host_and_topic(context, host, topic):"},{"line_number":402,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":403,"context_line":"                filter_by(disabled\u003dFalse).\\"},{"line_number":404,"context_line":"                filter_by(host\u003dhost).\\"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_099257f6","side":"PARENT","line":401,"in_reply_to":"ba7be1f8_6ed052c9","updated":"2015-02-27 07:45:26.000000000","message":"When normal user want to deallocated an fixed ip for his instance, the nova  code may call to admin requied db api to check something about nova service status, that is ok.\n\nFor this code https://github.com/openstack/nova/blob/master/nova/network/manager.py#L227\n\nI feel it\u0027s bug without elevated context, but it\u0027s fine for now we remove hard-code permission checks in this patch. \n\nAnd I feel we never have chance to execute that code, because that only can happen when this is False https://github.com/openstack/nova/blob/master/nova/network/manager.py#L221\n\nBut I can\u0027t find out is there a chance for a rpc call will call to a host which instance isn\u0027t running on.","commit_id":"708f78b95735a84a086f4051224200a28ac463d3"},{"author":{"_account_id":9459,"name":".Haifeng Yan","email":"yanheven@qq.com","username":"yan"},"change_message_id":"b7818b711283d4fa5ad7046f8ea83e650cad936f","unresolved":false,"context_lines":[{"line_number":464,"context_line":"                all()"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"@require_admin_context"},{"line_number":468,"context_line":"def service_get_by_host_and_topic(context, host, topic):"},{"line_number":469,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":470,"context_line":"                filter_by(disabled\u003dFalse).\\"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a016987_bb519f10","side":"PARENT","line":467,"updated":"2015-05-17 05:56:10.000000000","message":"Should we modify it to @require_context to make only context check before db operation, instead of admin permission check.","commit_id":"e6c8d624e92dc1c0312e49ba785bd2debd20f254"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0f3f04056dd3c4b785b458a4e13c087a9e399314","unresolved":false,"context_lines":[{"line_number":464,"context_line":"                all()"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"@require_admin_context"},{"line_number":468,"context_line":"def service_get_by_host_and_topic(context, host, topic):"},{"line_number":469,"context_line":"    return model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":470,"context_line":"                filter_by(disabled\u003dFalse).\\"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a016987_26f352d8","side":"PARENT","line":467,"in_reply_to":"7a016987_bb519f10","updated":"2015-05-17 13:19:59.000000000","message":"I think it\u0027s fine. \u0027require_context\u0027 only used by db call which filter result based on user or admin.","commit_id":"e6c8d624e92dc1c0312e49ba785bd2debd20f254"},{"author":{"_account_id":9459,"name":".Haifeng Yan","email":"yanheven@qq.com","username":"yan"},"change_message_id":"b7818b711283d4fa5ad7046f8ea83e650cad936f","unresolved":false,"context_lines":[{"line_number":480,"context_line":"                all()"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"@require_admin_context"},{"line_number":484,"context_line":"def service_get_by_host_and_binary(context, host, binary):"},{"line_number":485,"context_line":"    result \u003d model_query(context, models.Service, read_deleted\u003d\"no\").\\"},{"line_number":486,"context_line":"                    filter_by(host\u003dhost).\\"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a016987_9b582334","side":"PARENT","line":483,"updated":"2015-05-17 05:56:10.000000000","message":"the same as above.","commit_id":"e6c8d624e92dc1c0312e49ba785bd2debd20f254"}]}
