)]}'
{"etc/keystone.conf.sample":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b86d546e6867423cdbfc822c99bca9e4131c0bb3","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"# Maximum number of roles a user can be assigned to a project (integer value)"},{"line_number":311,"context_line":"#max_role_assignments \u003d \u003cNone\u003e"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"[auth]"},{"line_number":315,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"da85f559_aca2ad49","line":312,"updated":"2015-11-10 03:00:40.000000000","message":"I think we have a job that will come through and generate the sample configuration automatically. There might not be a need to update it in this patch.","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b4c34e3c3b2f43beb89bdcf7853be682b7e5c82b","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"# Maximum number of roles a user can be assigned to a project (integer value)"},{"line_number":311,"context_line":"#max_role_assignments \u003d \u003cNone\u003e"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"[auth]"},{"line_number":315,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"ba8a016a_2b602b35","line":312,"in_reply_to":"da85f559_43042fbf","updated":"2015-11-16 15:17:34.000000000","message":"It generates the sample configuration file from config.py","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"31d9743f1731feb5d2d73b52086db8bc81595cf6","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"# Maximum number of roles a user can be assigned to a project (integer value)"},{"line_number":311,"context_line":"#max_role_assignments \u003d \u003cNone\u003e"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"[auth]"},{"line_number":315,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"da85f559_43042fbf","line":312,"in_reply_to":"da85f559_aca2ad49","updated":"2015-11-10 04:03:04.000000000","message":"Generate it from where?  Is it generated from the config.py file?  If so, how do I set a default value?","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"c41b06d11c986a7ac505be6dd3ca82912464e92b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"da85f559_b46d1306","updated":"2015-11-10 07:22:39.000000000","message":"There is an OpenStack proposal bot that will automatically update this file after your commit merges.  So you can undo this change.","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"df00efafc409a9757541e976fd2d97ac2637252b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"da85f559_4175e395","in_reply_to":"da85f559_b46d1306","updated":"2015-11-10 17:33:45.000000000","message":"Done","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"}],"keystone/assignment/core.py":[{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"6aadd5aa2ca48cdd42ec88b00a40b4b0ca17ee79","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            raise exception.ForbiddenAction(\"Adding role %s failed because \""},{"line_number":265,"context_line":"                                            \"the user has reached the maximum \""},{"line_number":266,"context_line":"                                            \"number of roles allowed\""},{"line_number":267,"context_line":"                                            % (role_id,))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_29324bf2","line":264,"updated":"2015-10-28 14:30:02.000000000","message":"This should be i18n compatible.   I think you should wrap the error with _(\"error\")   so it can be translated.","commit_id":"42ffc42b6ef9f9fd552d156fb8f3337488b1006f"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"37bed72c4022780347a1a241ca3096bc1fbbf5e2","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            raise exception.ForbiddenAction(\"Adding role %s failed because \""},{"line_number":265,"context_line":"                                            \"the user has reached the maximum \""},{"line_number":266,"context_line":"                                            \"number of roles allowed\""},{"line_number":267,"context_line":"                                            % (role_id,))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_0c919d99","line":264,"in_reply_to":"1a26ad4f_29324bf2","updated":"2015-10-28 15:02:27.000000000","message":"Done","commit_id":"42ffc42b6ef9f9fd552d156fb8f3337488b1006f"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"c48e627a9f6355837612b0ff81a8f87f94a5c531","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        self.role_api.get_role(role_id)"},{"line_number":247,"context_line":"        self.driver.add_role_to_user_and_project(user_id, project_id, role_id)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def add_role_to_user_and_project(self, user_id, tenant_id, role_id):"},{"line_number":250,"context_line":"        \"\"\"Adds a role to a user for a specific project"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        Args:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_4f4c6742","line":249,"updated":"2015-10-28 15:39:57.000000000","message":"I would base your docstring off one of these. Currently this docstring would not compile correctly\n\nhttps://review.openstack.org/#/c/226225/12/keystone/assignment/core.py","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"3955171db34c634d75cfc7b63cec446d7e6f6185","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        self.role_api.get_role(role_id)"},{"line_number":247,"context_line":"        self.driver.add_role_to_user_and_project(user_id, project_id, role_id)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def add_role_to_user_and_project(self, user_id, tenant_id, role_id):"},{"line_number":250,"context_line":"        \"\"\"Adds a role to a user for a specific project"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        Args:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_fdbe49fe","line":249,"in_reply_to":"1a26ad4f_4f4c6742","updated":"2015-10-28 16:27:45.000000000","message":"Done","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"c48e627a9f6355837612b0ff81a8f87f94a5c531","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        Raises:"},{"line_number":258,"context_line":"            exception.ForbiddenAction"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        \"\"\""},{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_4f7d471b","line":260,"updated":"2015-10-28 15:39:57.000000000","message":"\"\"\"Adds a role to a user for a specific project\n\n        :param user_id:  what is user_id\n        : type user_id:  whats the type\n        :param tenant_id: what is tenant_id\n        : type tenant_id:  whats the type\n        :param role_id: what is role_id\n        : type role_id:  whats the type\n\n        :raises keystone.exception.ForbiddenAction: If the user has reached the maximum number of roles allowed\n\n        \"\"\"\n\nThis is just a start for you to build on. :)","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"3955171db34c634d75cfc7b63cec446d7e6f6185","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        Raises:"},{"line_number":258,"context_line":"            exception.ForbiddenAction"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        \"\"\""},{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_bd3771af","line":260,"in_reply_to":"1a26ad4f_4f7d471b","updated":"2015-10-28 16:27:45.000000000","message":"Done","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"c48e627a9f6355837612b0ff81a8f87f94a5c531","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        \"\"\""},{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            msg \u003d _(\"Adding role %s failed because the user has reached \""},{"line_number":265,"context_line":"                    \"the maximum number of roles allowed.\") % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_2f49eb5f","line":263,"updated":"2015-10-28 15:39:57.000000000","message":"if max_roles and len(roles) \u003e\u003d max_roles:","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"3955171db34c634d75cfc7b63cec446d7e6f6185","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        \"\"\""},{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            msg \u003d _(\"Adding role %s failed because the user has reached \""},{"line_number":265,"context_line":"                    \"the maximum number of roles allowed.\") % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_7d58f9fa","line":263,"in_reply_to":"1a26ad4f_2f49eb5f","updated":"2015-10-28 16:27:45.000000000","message":"Done","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"c48e627a9f6355837612b0ff81a8f87f94a5c531","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            msg \u003d _(\"Adding role %s failed because the user has reached \""},{"line_number":265,"context_line":"                    \"the maximum number of roles allowed.\") % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(msg)"},{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_6c0a9128","line":264,"updated":"2015-10-28 15:39:57.000000000","message":"I\u0027m sorry if i gave you the perception that this had to be in a double quotes. :(  Personally i think it should be in single quotes.","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"3955171db34c634d75cfc7b63cec446d7e6f6185","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":262,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":263,"context_line":"        if max_roles is not None and len(roles) \u003e\u003d max_roles:"},{"line_number":264,"context_line":"            msg \u003d _(\"Adding role %s failed because the user has reached \""},{"line_number":265,"context_line":"                    \"the maximum number of roles allowed.\") % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(msg)"},{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_9d9e3555","line":264,"in_reply_to":"1a26ad4f_6c0a9128","updated":"2015-10-28 16:27:45.000000000","message":"Done","commit_id":"a19184b33f259871f28f334d00466b75bf9990ab"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"2d0e958200ddddd54dfab2832984a9ff7438ec2b","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        :param role_id: Identifier of the role to add"},{"line_number":257,"context_line":"        : type role_id: unicode"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        :raises: exception.ForbiddenAction: If the user reaches the maximum"},{"line_number":260,"context_line":"            number of roles allowed."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_7e0c6f94","line":259,"updated":"2015-10-28 18:35:07.000000000","message":"The colon after raises needs to be removed\n\nthe exception needs to be keystone.exception.ForbiddenAction\n\nremove the space before type","commit_id":"3301caa828563de17143528aa7ea5db8a224ab86"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"ffa6db0fa5977b44a5ec0252c0d376b58eda220d","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        :param role_id: Identifier of the role to add"},{"line_number":257,"context_line":"        : type role_id: unicode"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        :raises: exception.ForbiddenAction: If the user reaches the maximum"},{"line_number":260,"context_line":"            number of roles allowed."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_d287b75f","line":259,"in_reply_to":"1a26ad4f_7e0c6f94","updated":"2015-10-28 20:31:39.000000000","message":"Done","commit_id":"3301caa828563de17143528aa7ea5db8a224ab86"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"88e67146c53770d205a132d2cd1d77dde619749c","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        :raises: exception.ForbiddenAction if the user reaches the maximum"},{"line_number":260,"context_line":"            number of roles allowed."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        if self._max_role_assignments_reached(user_id, tenant_id):"},{"line_number":264,"context_line":"            msg \u003d _(\u0027Adding role %s failed because the user has reached \u0027"},{"line_number":265,"context_line":"                    \u0027the maximum number of roles allowed.\u0027) % role_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_68f3540b","line":262,"updated":"2015-10-28 21:03:10.000000000","message":"Still missing some formatting.\n\nhttp://paste.openstack.org/show/477583/","commit_id":"104c9a0d2cbbb2ac78a1634a3e2d8cd8d4361a9a"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"db509755c406ea2108ded05b8ceb3b91e649c0ac","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        :raises: exception.ForbiddenAction if the user reaches the maximum"},{"line_number":260,"context_line":"            number of roles allowed."},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        if self._max_role_assignments_reached(user_id, tenant_id):"},{"line_number":264,"context_line":"            msg \u003d _(\u0027Adding role %s failed because the user has reached \u0027"},{"line_number":265,"context_line":"                    \u0027the maximum number of roles allowed.\u0027) % role_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_8b0eea32","line":262,"in_reply_to":"1a26ad4f_68f3540b","updated":"2015-11-05 21:34:25.000000000","message":"Done","commit_id":"104c9a0d2cbbb2ac78a1634a3e2d8cd8d4361a9a"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"88e67146c53770d205a132d2cd1d77dde619749c","unresolved":false,"context_lines":[{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"            max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":274,"context_line":"            if max_roles and len(roles) \u003e\u003d max_roles:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_a82c0c4b","line":271,"updated":"2015-10-28 21:03:10.000000000","message":"You always want to put as little as possible inside a try.  It looks like the exceptions are originating from get_roles_for_user_and_project could we move max_roles and the if statement out of the try? \nLike this: paste.openstack.org/show/477584/","commit_id":"104c9a0d2cbbb2ac78a1634a3e2d8cd8d4361a9a"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"db509755c406ea2108ded05b8ceb3b91e649c0ac","unresolved":false,"context_lines":[{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"            max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":274,"context_line":"            if max_roles and len(roles) \u003e\u003d max_roles:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_4b11b251","line":271,"in_reply_to":"1a26ad4f_a82c0c4b","updated":"2015-11-05 21:34:25.000000000","message":"Done","commit_id":"104c9a0d2cbbb2ac78a1634a3e2d8cd8d4361a9a"},{"author":{"_account_id":17860,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@gmail.com","username":"samueldmq"},"change_message_id":"9486c2b659390155142dc09006e71d7c02ce7d93","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        :type role_id: unicode"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        :raises exception.ForbiddenAction: if the user reaches the maximum"},{"line_number":260,"context_line":"            number of roles allowed"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        if self._is_max_role_assignments_reached(user_id, tenant_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_3c6b21f3","line":260,"updated":"2015-11-06 03:18:10.000000000","message":"I\u0027d say \u0027project role assingments\u0027 instead of just \u0027roles\u0027 in this context.","commit_id":"7e9da05a7d54ee846f38837aa10ce85bcace4972"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b86d546e6867423cdbfc822c99bca9e4131c0bb3","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self.driver.add_role_to_user_and_project(user_id, project_id, role_id)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def add_role_to_user_and_project(self, user_id, tenant_id, role_id):"},{"line_number":250,"context_line":"        \"\"\"Adds a role to a user for a specific project"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        :param user_id: Identifier of the user"},{"line_number":253,"context_line":"        :type user_id: unicode"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_acb94d7b","line":250,"updated":"2015-11-10 03:00:40.000000000","message":"nit: add period to the end of the doc string to keep convention with the rest of the module (i.e. line 203).","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"31d9743f1731feb5d2d73b52086db8bc81595cf6","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self.driver.add_role_to_user_and_project(user_id, project_id, role_id)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def add_role_to_user_and_project(self, user_id, tenant_id, role_id):"},{"line_number":250,"context_line":"        \"\"\"Adds a role to a user for a specific project"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        :param user_id: Identifier of the user"},{"line_number":253,"context_line":"        :type user_id: unicode"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_63ba930c","line":250,"in_reply_to":"da85f559_acb94d7b","updated":"2015-11-10 04:03:04.000000000","message":"Done","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b86d546e6867423cdbfc822c99bca9e4131c0bb3","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"},{"line_number":274,"context_line":"            return False"},{"line_number":275,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":276,"context_line":"        if max_roles and len(roles) \u003e\u003d max_roles:"},{"line_number":277,"context_line":"            return True"},{"line_number":278,"context_line":"        return False"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_2078018f","line":276,"updated":"2015-11-10 03:00:40.000000000","message":"should we be defaulting this to a certain value?","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"31d9743f1731feb5d2d73b52086db8bc81595cf6","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"},{"line_number":274,"context_line":"            return False"},{"line_number":275,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"},{"line_number":276,"context_line":"        if max_roles and len(roles) \u003e\u003d max_roles:"},{"line_number":277,"context_line":"            return True"},{"line_number":278,"context_line":"        return False"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_43566fd3","line":276,"in_reply_to":"da85f559_2078018f","updated":"2015-11-10 04:03:04.000000000","message":"It\u0027s hard to say what that default value should be.  However, since it is configurable, this can be added/changed later.","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"c41b06d11c986a7ac505be6dd3ca82912464e92b","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("},{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _is_max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_8f3d56bd","line":270,"updated":"2015-11-10 07:22:39.000000000","message":"i\u0027d drop the \"is\".  sounds a little awkward as \"is reached\"","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"df00efafc409a9757541e976fd2d97ac2637252b","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("},{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _is_max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_81918b9b","line":270,"in_reply_to":"da85f559_8f3d56bd","updated":"2015-11-10 17:33:45.000000000","message":"Done","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d6dfe983499257b5dd2a5ef3706699a31325c8dd","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        if self._max_role_assignments_reached(user_id, tenant_id):"},{"line_number":264,"context_line":"            msg \u003d _(\u0027Adding role %s failed because the user has reached \u0027"},{"line_number":265,"context_line":"                    \u0027the maximum number of roles allowed.\u0027) % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(action\u003dmsg)"},{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("},{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_f60d2638","line":265,"updated":"2015-11-16 15:22:39.000000000","message":"should we put the max number of role assignments in the exception?","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"cb0d09825978bd8e3384d44d749d6fb7de208c3a","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        if self._max_role_assignments_reached(user_id, tenant_id):"},{"line_number":264,"context_line":"            msg \u003d _(\u0027Adding role %s failed because the user has reached \u0027"},{"line_number":265,"context_line":"                    \u0027the maximum number of roles allowed.\u0027) % role_id"},{"line_number":266,"context_line":"            raise exception.ForbiddenAction(action\u003dmsg)"},{"line_number":267,"context_line":"        self._add_role_to_user_and_project_adapter("},{"line_number":268,"context_line":"            role_id, user_id\u003duser_id, project_id\u003dtenant_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_9f006aac","line":265,"in_reply_to":"ba8a016a_f60d2638","updated":"2015-11-16 17:15:11.000000000","message":"We could, however I don\u0027t think it is critical and I\u0027d prefer not to do another patch at this point.  However, if I do, I\u0027ll add it.","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d6dfe983499257b5dd2a5ef3706699a31325c8dd","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"},{"line_number":274,"context_line":"            return False"},{"line_number":275,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_4b36cf04","line":272,"updated":"2015-11-16 15:22:39.000000000","message":"when we do this check for v3 we will have to check for user -\u003e project assignments as well as the roles a user gets from group -\u003e projects too. I think that exposes the same vulnerability, right? \n\nJust thinking out loud.","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"cb0d09825978bd8e3384d44d749d6fb7de208c3a","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _max_role_assignments_reached(self, user_id, tenant_id):"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            roles \u003d self.get_roles_for_user_and_project(user_id, tenant_id)"},{"line_number":273,"context_line":"        except(exception.UserNotFound, exception.ProjectNotFound):"},{"line_number":274,"context_line":"            return False"},{"line_number":275,"context_line":"        max_roles \u003d CONF.assignment.max_role_assignments"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_5fd8c253","line":272,"in_reply_to":"ba8a016a_4b36cf04","updated":"2015-11-16 17:15:11.000000000","message":"Yes, agree.","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"}],"keystone/common/config.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b86d546e6867423cdbfc822c99bca9e4131c0bb3","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                        \u0027assignment driver.\u0027),"},{"line_number":360,"context_line":"        cfg.IntOpt(\u0027max_role_assignments\u0027,"},{"line_number":361,"context_line":"                   help\u003d\u0027Maximum number of roles a user can be assigned to \u0027"},{"line_number":362,"context_line":"                        \u0027a project\u0027),"},{"line_number":363,"context_line":"    ],"},{"line_number":364,"context_line":"    \u0027resource\u0027: ["},{"line_number":365,"context_line":"        cfg.StrOpt(\u0027driver\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_8069adc0","line":362,"updated":"2015-11-10 03:00:40.000000000","message":"nit: add a period to the end of this string to keep the existing convention. \n\nShould we add a default?","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"31d9743f1731feb5d2d73b52086db8bc81595cf6","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                        \u0027assignment driver.\u0027),"},{"line_number":360,"context_line":"        cfg.IntOpt(\u0027max_role_assignments\u0027,"},{"line_number":361,"context_line":"                   help\u003d\u0027Maximum number of roles a user can be assigned to \u0027"},{"line_number":362,"context_line":"                        \u0027a project\u0027),"},{"line_number":363,"context_line":"    ],"},{"line_number":364,"context_line":"    \u0027resource\u0027: ["},{"line_number":365,"context_line":"        cfg.StrOpt(\u0027driver\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_030627ce","line":362,"in_reply_to":"da85f559_8069adc0","updated":"2015-11-10 04:03:04.000000000","message":"Done","commit_id":"76450ad54a699fd15f0e8537c067f44f97727b41"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"c41b06d11c986a7ac505be6dd3ca82912464e92b","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                        \u0027ldap and sql. If an assignment driver is not \u0027"},{"line_number":358,"context_line":"                        \u0027specified, the identity driver will choose the \u0027"},{"line_number":359,"context_line":"                        \u0027assignment driver.\u0027),"},{"line_number":360,"context_line":"        cfg.IntOpt(\u0027max_role_assignments\u0027,"},{"line_number":361,"context_line":"                   help\u003d\u0027Maximum number of roles a user can be assigned to \u0027"},{"line_number":362,"context_line":"                        \u0027a project.\u0027),"},{"line_number":363,"context_line":"    ],"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_6fb03244","line":360,"updated":"2015-11-10 07:22:39.000000000","message":"Should there be a reasonable default?","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"df00efafc409a9757541e976fd2d97ac2637252b","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                        \u0027ldap and sql. If an assignment driver is not \u0027"},{"line_number":358,"context_line":"                        \u0027specified, the identity driver will choose the \u0027"},{"line_number":359,"context_line":"                        \u0027assignment driver.\u0027),"},{"line_number":360,"context_line":"        cfg.IntOpt(\u0027max_role_assignments\u0027,"},{"line_number":361,"context_line":"                   help\u003d\u0027Maximum number of roles a user can be assigned to \u0027"},{"line_number":362,"context_line":"                        \u0027a project.\u0027),"},{"line_number":363,"context_line":"    ],"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_61bee7d5","line":360,"in_reply_to":"da85f559_6fb03244","updated":"2015-11-10 17:33:45.000000000","message":"Done","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"}],"keystone/tests/unit/assignment/test_core.py":[{"author":{"_account_id":17860,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@gmail.com","username":"samueldmq"},"change_message_id":"9486c2b659390155142dc09006e71d7c02ce7d93","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self.role_id \u003d self.role_other[\"id\"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_add_role_to_user_and_project_greater_than_max(self):"},{"line_number":37,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d1)"},{"line_number":38,"context_line":"        self.assertRaises(exception.ForbiddenAction,"},{"line_number":39,"context_line":"                          self.assignment_api.add_role_to_user_and_project,"},{"line_number":40,"context_line":"                          user_id\u003dself.user_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_dc01b507","line":37,"updated":"2015-11-06 03:18:10.000000000","message":"I suppose there was 1 project role assignment created in the setup, as a fixture. Is that right ? Because the limit is 1 and you didn\u0027t create any role assignment by yourself.\n\nPlease assert it existed when you start your test. That way it will be clearer why the next statement expects an exception when you didn\u0027t create any assignment.","commit_id":"7e9da05a7d54ee846f38837aa10ce85bcace4972"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"e4a33459dd868ee0bb86393ae75ad61fd94c28b3","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self.role_id \u003d self.role_other[\"id\"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_add_role_to_user_and_project_greater_than_max(self):"},{"line_number":37,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d1)"},{"line_number":38,"context_line":"        self.assertRaises(exception.ForbiddenAction,"},{"line_number":39,"context_line":"                          self.assignment_api.add_role_to_user_and_project,"},{"line_number":40,"context_line":"                          user_id\u003dself.user_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_b8f3e672","line":37,"in_reply_to":"fa80f949_dc01b507","updated":"2015-11-09 16:10:03.000000000","message":"I\u0027ll set max_role_assignment to zero instead, so that it\u0027s clearer.","commit_id":"7e9da05a7d54ee846f38837aa10ce85bcace4972"},{"author":{"_account_id":17860,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@gmail.com","username":"samueldmq"},"change_message_id":"9486c2b659390155142dc09006e71d7c02ce7d93","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.assertFalse(self.role_id in roles)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_add_role_to_user_and_project_less_than_max(self):"},{"line_number":48,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d50)"},{"line_number":49,"context_line":"        roles \u003d self.assignment_api.get_roles_for_user_and_project("},{"line_number":50,"context_line":"            self.user_id, self.project_id)"},{"line_number":51,"context_line":"        self.assertFalse(self.role_id in roles)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_1713965c","line":48,"updated":"2015-11-06 03:18:10.000000000","message":"How about setting a lower limit, and then creating assignments up to the limit ? I think it would be a more useful test that way.","commit_id":"7e9da05a7d54ee846f38837aa10ce85bcace4972"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"e4a33459dd868ee0bb86393ae75ad61fd94c28b3","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.assertFalse(self.role_id in roles)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_add_role_to_user_and_project_less_than_max(self):"},{"line_number":48,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d50)"},{"line_number":49,"context_line":"        roles \u003d self.assignment_api.get_roles_for_user_and_project("},{"line_number":50,"context_line":"            self.user_id, self.project_id)"},{"line_number":51,"context_line":"        self.assertFalse(self.role_id in roles)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_b3a0e9f5","line":48,"in_reply_to":"fa80f949_1713965c","updated":"2015-11-09 16:10:03.000000000","message":"I think that would be more thorough, however I feel that this test is a good enough test for the function.","commit_id":"7e9da05a7d54ee846f38837aa10ce85bcace4972"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"c41b06d11c986a7ac505be6dd3ca82912464e92b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2012 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_2fba2a24","line":1,"updated":"2015-11-10 07:22:39.000000000","message":"2015","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"df00efafc409a9757541e976fd2d97ac2637252b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2012 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_c1a473a7","line":1,"in_reply_to":"da85f559_2fba2a24","updated":"2015-11-10 17:33:45.000000000","message":"Done","commit_id":"4d61ea91a1802c0cec2c7bd58d025ebfc7c58a00"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d6dfe983499257b5dd2a5ef3706699a31325c8dd","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.load_fixtures(default_fixtures)"},{"line_number":32,"context_line":"        self.project_id \u003d self.tenant_bar[\u0027id\u0027]"},{"line_number":33,"context_line":"        self.user_id \u003d self.user_foo[\u0027id\u0027]"},{"line_number":34,"context_line":"        self.role_id \u003d self.role_other[\"id\"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_add_role_to_user_and_project_greater_than_max(self):"},{"line_number":37,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d1)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_5690b295","line":34,"updated":"2015-11-16 15:22:39.000000000","message":"use single quotes here since that is already done in the previous two lines. \n\n    self.role_id \u003d self.role_other[\u0027id\u0027]","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"cb0d09825978bd8e3384d44d749d6fb7de208c3a","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.load_fixtures(default_fixtures)"},{"line_number":32,"context_line":"        self.project_id \u003d self.tenant_bar[\u0027id\u0027]"},{"line_number":33,"context_line":"        self.user_id \u003d self.user_foo[\u0027id\u0027]"},{"line_number":34,"context_line":"        self.role_id \u003d self.role_other[\"id\"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_add_role_to_user_and_project_greater_than_max(self):"},{"line_number":37,"context_line":"        self.config_fixture.config(group\u003d\u0027assignment\u0027, max_role_assignments\u003d1)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_825571c7","line":34,"in_reply_to":"ba8a016a_5690b295","updated":"2015-11-16 17:15:11.000000000","message":"Done","commit_id":"ca1dc9a566423759b54754dfd3b6bf52011fa15d"}]}
