)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"bf64c491733215ff84cf9e13b2efe8a715035f1f","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to either the domain scoped by the token"},{"line_number":16,"context_line":"or finally the default domain."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_a3769ba3","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":29},"updated":"2017-08-01 18:49:33.000000000","message":"\"domain scoped by the token\" (assuming that means either domain_id or project_domain_id from the token, as the code is doing today) should always yield an id, so you shouldn\u0027t need to rely on default domain as a backstop.\n\nAnd I didn\u0027t see anything for default domain in the code... did I miss it?","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"c1bf017f0486aaf24234b875ffb74616d6249332","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to either the domain scoped by the token"},{"line_number":16,"context_line":"or finally the default domain."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_8a05e4c4","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":29},"in_reply_to":"df3967d1_540e878d","updated":"2017-08-01 21:17:36.000000000","message":"Done","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"fe7969e39bc0a011e8aaa57c2443df42ab263776","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to either the domain scoped by the token"},{"line_number":16,"context_line":"or finally the default domain."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_540e878d","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":29},"in_reply_to":"df3967d1_a3769ba3","updated":"2017-08-01 20:12:13.000000000","message":"Yeah it\u0027s here:\n\nhttps://github.com/openstack/keystone/blob/master/keystone/common/controller.py#L620-L662\n\nBut realistically we should never hit this, so I can update the message.","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"9f6b4b875c94b56824bd7cc4f1a896735ff2aacd","unresolved":false,"context_lines":[{"line_number":12,"context_line":"consideration if the parent is a domain or not."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to either the domain scoped by the token."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"df3967d1_aaa66852","line":15,"range":{"start_line":15,"start_character":19,"end_line":15,"end_character":25},"updated":"2017-08-01 21:43:15.000000000","message":"remove \"either\"","commit_id":"401d07a4d99e27b02b64b53e9f5b007798ffbe80"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4dd2555dc01f96b39cc1ac47bf75e32b1754dd3a","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to the domain scoped by the token."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f436f4f_fb536de1","line":16,"updated":"2017-08-08 16:32:58.000000000","message":"Was the need for this behavior reported in a bug?","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"dc6a9b3b6f3dc3905654af9a64a8432d7fef2e5b","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If the project cannot get the domain from the parent, then"},{"line_number":15,"context_line":"it will default to the domain scoped by the token."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ieec37b884463216711d2f201a1f3e30a185824ef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f436f4f_d631a0ee","line":16,"in_reply_to":"9f436f4f_fb536de1","updated":"2017-08-08 16:55:08.000000000","message":"I don\u0027t think there is a bug for this currently (maybe there should be?). This change was spawned from [0] in which it was pointed out that we are currently not following the api-ref in terms of what the domain defaults to[1] (parent vs token). I am also curious to why the test-skipping which is removed in this change exists.\n\n[0] https://review.openstack.org/#/c/462670/\n\n[1] https://github.com/openstack/keystone/blob/master/api-ref/source/v3/parameters.yaml#L1162-L1168","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"}],"keystone/resource/controllers.py":[{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"bf64c491733215ff84cf9e13b2efe8a715035f1f","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"},{"line_number":265,"context_line":"            if parent_id:"},{"line_number":266,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":267,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":268,"context_line":"                    domain_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":269,"context_line":"                if not domain_id:"},{"line_number":270,"context_line":"                    domain_id \u003d parent_ref.get(\u0027domain_id\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_a31a1b7a","line":267,"range":{"start_line":267,"start_character":16,"end_line":267,"end_character":47},"updated":"2017-08-01 18:49:33.000000000","message":"the way you\u0027ve got this written, parent_id takes precedence over domain_id if both are present. Based on the comment above, I\u0027m thinking that\u0027s probably not intentional. May need an irc discussion of what the behavior should be in that case.\n\nWhatever we decide, we probably want to make clear in a comment here.","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"c1bf017f0486aaf24234b875ffb74616d6249332","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"},{"line_number":265,"context_line":"            if parent_id:"},{"line_number":266,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":267,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":268,"context_line":"                    domain_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":269,"context_line":"                if not domain_id:"},{"line_number":270,"context_line":"                    domain_id \u003d parent_ref.get(\u0027domain_id\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_6a0880d8","line":267,"range":{"start_line":267,"start_character":16,"end_line":267,"end_character":47},"in_reply_to":"df3967d1_a31a1b7a","updated":"2017-08-01 21:17:36.000000000","message":"Done","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"bf64c491733215ff84cf9e13b2efe8a715035f1f","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":267,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":268,"context_line":"                    domain_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":269,"context_line":"                if not domain_id:"},{"line_number":270,"context_line":"                    domain_id \u003d parent_ref.get(\u0027domain_id\u0027)"},{"line_number":271,"context_line":"            if not domain_id:"},{"line_number":272,"context_line":"                domain_id \u003d request.context.domain_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_00cb1d72","line":269,"range":{"start_line":269,"start_character":16,"end_line":269,"end_character":32},"updated":"2017-08-01 18:49:33.000000000","message":"I\u0027d prefer this just be an else. Would be a lot more readable, and consistent with whatever decision we make on parent_id vs. domain_id precedence.","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"fe7969e39bc0a011e8aaa57c2443df42ab263776","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":267,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":268,"context_line":"                    domain_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":269,"context_line":"                if not domain_id:"},{"line_number":270,"context_line":"                    domain_id \u003d parent_ref.get(\u0027domain_id\u0027)"},{"line_number":271,"context_line":"            if not domain_id:"},{"line_number":272,"context_line":"                domain_id \u003d request.context.domain_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_74098b93","line":269,"range":{"start_line":269,"start_character":16,"end_line":269,"end_character":32},"in_reply_to":"df3967d1_00cb1d72","updated":"2017-08-01 20:12:13.000000000","message":"sure!","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4dd2555dc01f96b39cc1ac47bf75e32b1754dd3a","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        # \"domain_id\" is not specified, but \"parent_id\" is specified, then"},{"line_number":259,"context_line":"        # the domain ID of the parent will be used. If neither \"domain_id\""},{"line_number":260,"context_line":"        # or \"parent_id\" is specified, we will default to the domain to"},{"line_number":261,"context_line":"        # which the client\u0027s token is scoped."},{"line_number":262,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":263,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_db9ae96c","line":261,"updated":"2017-08-08 16:32:58.000000000","message":"Is this behavior documented in the API reference for POST /v3/projects/ ?","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"eaae9d28253a9e87b2bcd595adb5d59343db9a53","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        # \"domain_id\" is not specified, but \"parent_id\" is specified, then"},{"line_number":259,"context_line":"        # the domain ID of the parent will be used. If neither \"domain_id\""},{"line_number":260,"context_line":"        # or \"parent_id\" is specified, we will default to the domain to"},{"line_number":261,"context_line":"        # which the client\u0027s token is scoped."},{"line_number":262,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":263,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_2a4ac054","line":261,"in_reply_to":"9f436f4f_1b3bd138","updated":"2017-08-08 17:39:41.000000000","message":"reading what you linked from the api ref, I realized this change is not handling the 400 case it describes [0].\n\n[0] https://github.com/openstack/keystone/blob/master/api-ref/source/v3/parameters.yaml#L1166-L1168","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"2aa4c483d3635bcbcae4d47159e7f327d554492b","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        # \"domain_id\" is not specified, but \"parent_id\" is specified, then"},{"line_number":259,"context_line":"        # the domain ID of the parent will be used. If neither \"domain_id\""},{"line_number":260,"context_line":"        # or \"parent_id\" is specified, we will default to the domain to"},{"line_number":261,"context_line":"        # which the client\u0027s token is scoped."},{"line_number":262,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":263,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_2a1be01b","line":261,"in_reply_to":"9f436f4f_2a4ac054","updated":"2017-08-08 17:49:50.000000000","message":"ah good catch!","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"dc6a9b3b6f3dc3905654af9a64a8432d7fef2e5b","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        # \"domain_id\" is not specified, but \"parent_id\" is specified, then"},{"line_number":259,"context_line":"        # the domain ID of the parent will be used. If neither \"domain_id\""},{"line_number":260,"context_line":"        # or \"parent_id\" is specified, we will default to the domain to"},{"line_number":261,"context_line":"        # which the client\u0027s token is scoped."},{"line_number":262,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":263,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":264,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_1b3bd138","line":261,"in_reply_to":"9f436f4f_db9ae96c","updated":"2017-08-08 16:55:08.000000000","message":"That comment was taken from [0].  This was brought up my edmondsw in this[1] change, which all this was pulled out from.\n\n[0] https://github.com/openstack/keystone/blob/master/api-ref/source/v3/parameters.yaml#L1162-L1168\n\n[1] https://review.openstack.org/#/c/462670/","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4dd2555dc01f96b39cc1ac47bf75e32b1754dd3a","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                domain_id \u003d request.context.domain_id"},{"line_number":273,"context_line":"            if not domain_id:"},{"line_number":274,"context_line":"                domain_id \u003d request.context.project_domain_id"},{"line_number":275,"context_line":"            ref[\u0027domain_id\u0027] \u003d domain_id"},{"line_number":276,"context_line":"            ref \u003d self._normalize_domain_id(request, ref)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # Our API requires that you specify the location in the hierarchy"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_3bf8d5c2","line":275,"updated":"2017-08-08 16:32:58.000000000","message":"Even though this logic is only used in this method - I\u0027m inclined to suggest pulling it out into its own method.","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"dc6a9b3b6f3dc3905654af9a64a8432d7fef2e5b","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                domain_id \u003d request.context.domain_id"},{"line_number":273,"context_line":"            if not domain_id:"},{"line_number":274,"context_line":"                domain_id \u003d request.context.project_domain_id"},{"line_number":275,"context_line":"            ref[\u0027domain_id\u0027] \u003d domain_id"},{"line_number":276,"context_line":"            ref \u003d self._normalize_domain_id(request, ref)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # Our API requires that you specify the location in the hierarchy"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_1bf63191","line":275,"in_reply_to":"9f436f4f_3bf8d5c2","updated":"2017-08-08 16:55:08.000000000","message":"I wondered about moving that logic into[0], but perhaps something for projects.\n\n[0] https://github.com/openstack/keystone/blob/master/keystone/common/controller.py#L620-L662","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"026f25a6bddae7dd7b5ff22504385251e1e2692b","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        validation.lazy_validate(schema.project_create, project)"},{"line_number":255,"context_line":"        ref \u003d self._assign_unique_id(self._normalize_dict(project))"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # For regular projects (i.e. those not acting as a domain), if"},{"line_number":258,"context_line":"        # \"domain_id\" is not specified, but \"parent_id\" is specified, then"},{"line_number":259,"context_line":"        # the domain ID of the parent will be used. If neither \"domain_id\""},{"line_number":260,"context_line":"        # or \"parent_id\" is specified, we will default to the domain to"},{"line_number":261,"context_line":"        # which the client\u0027s token is scoped. If both \"domain_id`\" and"},{"line_number":262,"context_line":"        # \"parent_id\" are specified, and they do not indicate the same"},{"line_number":263,"context_line":"        # domain, a \"Bad Request (400)\" will be returned."},{"line_number":264,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":265,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":266,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_f01c7e6b","line":263,"range":{"start_line":257,"start_character":8,"end_line":263,"end_character":57},"updated":"2017-08-09 23:26:35.000000000","message":"Could summarize this a bit imo","commit_id":"f19248b1854b2649ec40592c970ee2005f73b392"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"026f25a6bddae7dd7b5ff22504385251e1e2692b","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        # which the client\u0027s token is scoped. If both \"domain_id`\" and"},{"line_number":262,"context_line":"        # \"parent_id\" are specified, and they do not indicate the same"},{"line_number":263,"context_line":"        # domain, a \"Bad Request (400)\" will be returned."},{"line_number":264,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":265,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"},{"line_number":266,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"},{"line_number":267,"context_line":"            if parent_id and not domain_id:"},{"line_number":268,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":269,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":270,"context_line":"                    domain_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":271,"context_line":"                else:"},{"line_number":272,"context_line":"                    domain_id \u003d parent_ref.get(\u0027domain_id\u0027)"},{"line_number":273,"context_line":"            elif parent_id and domain_id:"},{"line_number":274,"context_line":"                parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":275,"context_line":"                msg \u003d _(\u0027Project domain_id does not match parent \u0027"},{"line_number":276,"context_line":"                        \u0027domain id.\u0027)"},{"line_number":277,"context_line":"                if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":278,"context_line":"                    if parent_ref.get(\u0027id\u0027) !\u003d domain_id:"},{"line_number":279,"context_line":"                        raise exception.ValidationError(msg)"},{"line_number":280,"context_line":"                else:"},{"line_number":281,"context_line":"                    if parent_ref.get(\u0027domain_id\u0027) !\u003d domain_id:"},{"line_number":282,"context_line":"                        raise exception.ValidationError(msg)"},{"line_number":283,"context_line":"            if not domain_id:"},{"line_number":284,"context_line":"                domain_id \u003d request.context.domain_id"},{"line_number":285,"context_line":"            if not domain_id:"},{"line_number":286,"context_line":"                domain_id \u003d request.context.project_domain_id"},{"line_number":287,"context_line":"            ref[\u0027domain_id\u0027] \u003d domain_id"},{"line_number":288,"context_line":"            ref \u003d self._normalize_domain_id(request, ref)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        # Our API requires that you specify the location in the hierarchy"},{"line_number":291,"context_line":"        # unambiguously. This could be by parent_id or, if it is a top level"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_3013265f","line":288,"range":{"start_line":264,"start_character":8,"end_line":288,"end_character":57},"updated":"2017-08-09 23:26:35.000000000","message":"This is gross and needs to be moved/refactored.","commit_id":"f19248b1854b2649ec40592c970ee2005f73b392"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"da639050c9dcd0205030cea9579b2d43c608e058","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        return domain_id"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _check_parent_domain_ids_match(self, ref_id, domain_id):"},{"line_number":214,"context_line":"        if domain_id and ref_id !\u003d domain_id:"},{"line_number":215,"context_line":"            msg \u003d _(\u0027Project domain_id does not match parent \u0027"},{"line_number":216,"context_line":"                    \u0027domain id.\u0027)"},{"line_number":217,"context_line":"            raise exception.ValidationError(msg)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    @controller.filterprotected(\u0027domain_id\u0027, \u0027enabled\u0027, \u0027name\u0027,"},{"line_number":220,"context_line":"                                \u0027parent_id\u0027, \u0027is_domain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_31081a27","line":217,"range":{"start_line":214,"start_character":0,"end_line":217,"end_character":48},"updated":"2017-11-20 07:39:33.000000000","message":"I thike this is duplicated with https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L105\none should be removed right?","commit_id":"bc11b4327bcbd16a3567bb49c9e0933bd334766b"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"bb6910fe86ec4a0dc76cfe5dc7da3ba53b035173","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        return domain_id"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _check_parent_domain_ids_match(self, ref_id, domain_id):"},{"line_number":214,"context_line":"        if domain_id and ref_id !\u003d domain_id:"},{"line_number":215,"context_line":"            msg \u003d _(\u0027Project domain_id does not match parent \u0027"},{"line_number":216,"context_line":"                    \u0027domain id.\u0027)"},{"line_number":217,"context_line":"            raise exception.ValidationError(msg)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    @controller.filterprotected(\u0027domain_id\u0027, \u0027enabled\u0027, \u0027name\u0027,"},{"line_number":220,"context_line":"                                \u0027parent_id\u0027, \u0027is_domain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_63f3f80b","line":217,"range":{"start_line":214,"start_character":0,"end_line":217,"end_character":48},"in_reply_to":"ff82abbf_31081a27","updated":"2017-11-22 04:16:06.000000000","message":"We could reuse the core resource check, but that method is private so this simple check was added here.","commit_id":"bc11b4327bcbd16a3567bb49c9e0933bd334766b"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"457fa192c398dafd68c6abd6b5dc71e6b79656f4","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        return domain_id"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _check_parent_domain_ids_match(self, ref_id, domain_id):"},{"line_number":214,"context_line":"        if domain_id and ref_id !\u003d domain_id:"},{"line_number":215,"context_line":"            msg \u003d _(\u0027Project domain_id does not match parent \u0027"},{"line_number":216,"context_line":"                    \u0027domain id.\u0027)"},{"line_number":217,"context_line":"            raise exception.ValidationError(msg)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    @controller.filterprotected(\u0027domain_id\u0027, \u0027enabled\u0027, \u0027name\u0027,"},{"line_number":220,"context_line":"                                \u0027parent_id\u0027, \u0027is_domain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_6f5af9f3","line":217,"range":{"start_line":214,"start_character":0,"end_line":217,"end_character":48},"in_reply_to":"ff82abbf_63f3f80b","updated":"2017-11-22 07:23:23.000000000","message":"I don\u0027t mean that reuse the private code here.  I mean you don\u0027t need check it here since it will be checked in core.py as well.","commit_id":"bc11b4327bcbd16a3567bb49c9e0933bd334766b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"40d10ea86b2f82105510e382af90b722c7609bdd","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # For projects that are not acting as a domain, if \"domain_id\""},{"line_number":186,"context_line":"        # is not specified, but \"parent_id\" is, then the domain ID of"},{"line_number":187,"context_line":"        # the parent will be used. If neither ID is specified, we will"},{"line_number":188,"context_line":"        # default to the domain that the client\u0027s token is scoped. If"},{"line_number":189,"context_line":"        # both IDs are specified, but they do not indicate the same"},{"line_number":190,"context_line":"        # domain, a \"Bad Request (400)\" will be returned."},{"line_number":191,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":192,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"},{"line_number":193,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_fe43ca6a","line":190,"range":{"start_line":188,"start_character":67,"end_line":190,"end_character":57},"updated":"2017-12-07 20:29:57.000000000","message":"Was this possible before without a 4XX http status code being returned? If so, we might be breaking API compatibility (similar to Colleen\u0027s concern).","commit_id":"f96dfde0494eb3163783163a674d47331cd37b4a"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"f86ea5cc7139cc904f7db3713682a05e70d2203d","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # For projects that are not acting as a domain, if \"domain_id\""},{"line_number":186,"context_line":"        # is not specified, but \"parent_id\" is, then the domain ID of"},{"line_number":187,"context_line":"        # the parent will be used. If neither ID is specified, we will"},{"line_number":188,"context_line":"        # default to the domain that the client\u0027s token is scoped. If"},{"line_number":189,"context_line":"        # both IDs are specified, but they do not indicate the same"},{"line_number":190,"context_line":"        # domain, a \"Bad Request (400)\" will be returned."},{"line_number":191,"context_line":"        if not ref.get(\u0027is_domain\u0027):"},{"line_number":192,"context_line":"            parent_id \u003d ref.get(\u0027parent_id\u0027)"},{"line_number":193,"context_line":"            domain_id \u003d ref.get(\u0027domain_id\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_fbd0f3cb","line":190,"range":{"start_line":188,"start_character":67,"end_line":190,"end_character":57},"in_reply_to":"df87a7cf_fe43ca6a","updated":"2017-12-16 03:05:05.000000000","message":"Previous logic was:\n\nif not ref.get(\u0027domain_id\u0027):\n            ref[\u0027domain_id\u0027] \u003d self._get_domain_id_from_token(request)\n\nhttp://git.openstack.org/cgit/openstack/keystone/tree/keystone/common/controller.py#n551\n\nI think the logic here looks right.  This is a case where the token data would have won out, which is right, but we ignored suspect data.  The error is the more correct response.","commit_id":"f96dfde0494eb3163783163a674d47331cd37b4a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4345e935b124d064d3fb45a38badf5bc46976fc1","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                             request.context.project_domain_id)"},{"line_number":200,"context_line":"            ref[\u0027domain_id\u0027] \u003d domain_id"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    def _check_parent_domain_id(self, parent_id, domain_id):"},{"line_number":203,"context_line":"        if domain_id:"},{"line_number":204,"context_line":"            return domain_id"},{"line_number":205,"context_line":"        parent_ref \u003d self.resource_api.get_project(parent_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf659307_c88adf19","line":202,"range":{"start_line":202,"start_character":49,"end_line":202,"end_character":58},"updated":"2018-04-10 22:19:54.000000000","message":"We should try and avoid passing None if we can. It usually leads to extra if checks. We could try something like: \n\nhttp://paste.openstack.org/show/718866/","commit_id":"323e4447887c3093e499e117168f6e260744dbda"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4345e935b124d064d3fb45a38badf5bc46976fc1","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    def _check_parent_domain_id(self, parent_id, domain_id):"},{"line_number":203,"context_line":"        if domain_id:"},{"line_number":204,"context_line":"            return domain_id"},{"line_number":205,"context_line":"        parent_ref \u003d self.resource_api.get_project(parent_id)"},{"line_number":206,"context_line":"        if parent_ref.get(\u0027is_domain\u0027):"},{"line_number":207,"context_line":"            ref_id \u003d parent_ref.get(\u0027id\u0027)"},{"line_number":208,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf659307_a8368b50","line":205,"range":{"start_line":205,"start_character":21,"end_line":205,"end_character":25},"updated":"2018-04-10 22:19:54.000000000","message":"This should use the provider_api.","commit_id":"323e4447887c3093e499e117168f6e260744dbda"}],"keystone/tests/unit/test_v3_resource.py":[{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"bf64c491733215ff84cf9e13b2efe8a715035f1f","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        ref[\u0027domain_id\u0027] \u003d self.domain[\u0027id\u0027]"},{"line_number":671,"context_line":"        self.assertValidProjectResponse(r, ref)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_create_project_with_parent_id_and_no_domain_id(self):"},{"line_number":674,"context_line":"        \"\"\"Call ``POST /projects``.\"\"\""},{"line_number":675,"context_line":"        # With only the parent_id, the domain_id should be"},{"line_number":676,"context_line":"        # normalized to the parent\u0027s domain_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_964d1774","line":673,"updated":"2017-08-01 18:49:33.000000000","message":"we should test the cases that:\n1) both parent_id and domain_id are specified.\n2) neither is specified and it\u0027s a domain-scoped token\n3) neither is specified and it\u0027s a project-scoped token","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"c1bf017f0486aaf24234b875ffb74616d6249332","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        ref[\u0027domain_id\u0027] \u003d self.domain[\u0027id\u0027]"},{"line_number":671,"context_line":"        self.assertValidProjectResponse(r, ref)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_create_project_with_parent_id_and_no_domain_id(self):"},{"line_number":674,"context_line":"        \"\"\"Call ``POST /projects``.\"\"\""},{"line_number":675,"context_line":"        # With only the parent_id, the domain_id should be"},{"line_number":676,"context_line":"        # normalized to the parent\u0027s domain_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_4a0ffce0","line":673,"in_reply_to":"df3967d1_2af6f8fa","updated":"2017-08-01 21:17:36.000000000","message":"Done","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"a2604d3bc2ae1698b89f7a1b4ef3a767df46e711","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        ref[\u0027domain_id\u0027] \u003d self.domain[\u0027id\u0027]"},{"line_number":671,"context_line":"        self.assertValidProjectResponse(r, ref)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_create_project_with_parent_id_and_no_domain_id(self):"},{"line_number":674,"context_line":"        \"\"\"Call ``POST /projects``.\"\"\""},{"line_number":675,"context_line":"        # With only the parent_id, the domain_id should be"},{"line_number":676,"context_line":"        # normalized to the parent\u0027s domain_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_2af6f8fa","line":673,"in_reply_to":"df3967d1_964d1774","updated":"2017-08-01 21:14:36.000000000","message":"It looks like 2 is tested here: https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_v3_resource.py#L616-L672\n\nBut we can definitely test 1 and 3","commit_id":"97278557a0b817583fa8dd3a741ea34b01217f8c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4dd2555dc01f96b39cc1ac47bf75e32b1754dd3a","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        auth \u003d self.build_authentication_request("},{"line_number":702,"context_line":"            user_id\u003dself.user[\u0027id\u0027],"},{"line_number":703,"context_line":"            password\u003dself.user[\u0027password\u0027],"},{"line_number":704,"context_line":"            project_id\u003dself.project[\u0027id\u0027])"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"        # Without domain_id and parent_id, the domain_id should be"},{"line_number":707,"context_line":"        # normalized to the domain of the project on the token, when"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_5baf1994","line":704,"updated":"2017-08-08 16:32:58.000000000","message":"This seems somewhat backwards incompatible. What happened before when domain_id wasn\u0027t specified in project reference?","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":21420,"name":"Gage Hugo","email":"gagehugo@gmail.com","username":"ghugo"},"change_message_id":"dc6a9b3b6f3dc3905654af9a64a8432d7fef2e5b","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        auth \u003d self.build_authentication_request("},{"line_number":702,"context_line":"            user_id\u003dself.user[\u0027id\u0027],"},{"line_number":703,"context_line":"            password\u003dself.user[\u0027password\u0027],"},{"line_number":704,"context_line":"            project_id\u003dself.project[\u0027id\u0027])"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"        # Without domain_id and parent_id, the domain_id should be"},{"line_number":707,"context_line":"        # normalized to the domain of the project on the token, when"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f436f4f_bbbde569","line":704,"in_reply_to":"9f436f4f_5baf1994","updated":"2017-08-08 16:55:08.000000000","message":"It defaults to the domain_id scoped from the token.[0]\n\n[0] https://github.com/openstack/keystone/blob/master/keystone/common/controller.py#L620-L662","commit_id":"8483006312406f7b95b1673acbfaa48c2fec3b91"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"40d10ea86b2f82105510e382af90b722c7609bdd","unresolved":false,"context_lines":[{"line_number":675,"context_line":"            password\u003dself.user[\u0027password\u0027],"},{"line_number":676,"context_line":"            project_id\u003dself.project[\u0027id\u0027])"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"        # Without domain_id and parent_id, the domain_id should be"},{"line_number":679,"context_line":"        # normalized to the domain of the project on the token, when"},{"line_number":680,"context_line":"        # using a project scoped token."},{"line_number":681,"context_line":"        ref \u003d unit.new_project_ref()"},{"line_number":682,"context_line":"        r \u003d self.post("},{"line_number":683,"context_line":"            \u0027/projects\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_9e295e9c","line":680,"range":{"start_line":678,"start_character":8,"end_line":680,"end_character":39},"updated":"2017-12-07 20:29:57.000000000","message":"What happens if I use a domain-scoped token?","commit_id":"f96dfde0494eb3163783163a674d47331cd37b4a"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"f86ea5cc7139cc904f7db3713682a05e70d2203d","unresolved":false,"context_lines":[{"line_number":675,"context_line":"            password\u003dself.user[\u0027password\u0027],"},{"line_number":676,"context_line":"            project_id\u003dself.project[\u0027id\u0027])"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"        # Without domain_id and parent_id, the domain_id should be"},{"line_number":679,"context_line":"        # normalized to the domain of the project on the token, when"},{"line_number":680,"context_line":"        # using a project scoped token."},{"line_number":681,"context_line":"        ref \u003d unit.new_project_ref()"},{"line_number":682,"context_line":"        r \u003d self.post("},{"line_number":683,"context_line":"            \u0027/projects\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_9b4a07aa","line":680,"range":{"start_line":678,"start_character":8,"end_line":680,"end_character":39},"in_reply_to":"df87a7cf_9e295e9c","updated":"2017-12-16 03:05:05.000000000","message":"I think that is explicitly outside the \"scope\" of this test.  Wow we use that word a lot.","commit_id":"f96dfde0494eb3163783163a674d47331cd37b4a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4345e935b124d064d3fb45a38badf5bc46976fc1","unresolved":false,"context_lines":[{"line_number":678,"context_line":"        # normalized to the parent\u0027s domain_id"},{"line_number":679,"context_line":"        ref_child \u003d unit.new_project_ref(parent_id\u003dself.project[\u0027id\u0027])"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        r \u003d self.post("},{"line_number":682,"context_line":"            \u0027/projects\u0027,"},{"line_number":683,"context_line":"            body\u003d{\u0027project\u0027: ref_child})"},{"line_number":684,"context_line":"        self.assertEqual(self.project[\u0027domain_id\u0027],"},{"line_number":685,"context_line":"                         r.result[\u0027project\u0027][\u0027domain_id\u0027])"},{"line_number":686,"context_line":"        ref_child[\u0027domain_id\u0027] \u003d self.domain[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf659307_7a78382a","line":683,"range":{"start_line":681,"start_character":8,"end_line":683,"end_character":40},"updated":"2018-04-10 22:19:54.000000000","message":"So - previously this was failing because it was selecting the `default` domain because the request wasn\u0027t being made with a domain-scoped token and the domain_id wasn\u0027t set on the request [0][1].\n\n[0] https://github.com/openstack/keystone/blob/7c4c6a5fb3e77723f3866c99fdf0825ba7cc0c5c/keystone/resource/controllers.py#L169\n[1] https://github.com/openstack/keystone/blob/7c4c6a5fb3e77723f3866c99fdf0825ba7cc0c5c/keystone/common/controller.py#L532-L549","commit_id":"323e4447887c3093e499e117168f6e260744dbda"}]}
