)]}'
{"keystone/api/trusts.py":[{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    parameter_name\u003d\u0027trust_id\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def _trustor_trustee_only(trust):"},{"line_number":52,"context_line":"    user_id \u003d flask.request.environ.get(context.REQUEST_CONTEXT_ENV).user_id"},{"line_number":53,"context_line":"    if user_id not in [trust.get(\u0027trustee_user_id\u0027),"},{"line_number":54,"context_line":"                       trust.get(\u0027trustor_user_id\u0027)]:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_58f92b80","line":51,"updated":"2018-07-23 15:57:28.000000000","message":"I have confirmed this logic is the same as in the old file.","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def _normalize_trust_expires_at(trust):"},{"line_number":60,"context_line":"    # correct isotime"},{"line_number":61,"context_line":"    if trust.get(\u0027expires_at\u0027) is not None:"},{"line_number":62,"context_line":"        trust[\u0027expires_at\u0027] \u003d utils.isotime(trust[\u0027expires_at\u0027],"},{"line_number":63,"context_line":"                                            subsecond\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_d81a1bc6","line":60,"updated":"2018-07-23 15:57:28.000000000","message":"This is OK.  It was extracted from \"fill_in_roles\" which is a good clean up.","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    # fill in role data"},{"line_number":68,"context_line":"    trust_full_roles \u003d []"},{"line_number":69,"context_line":"    for trust_role in trust.get(\u0027roles\u0027, []):"},{"line_number":70,"context_line":"        trust_role \u003d trust_role[\u0027id\u0027]"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            matching_role \u003d PROVIDERS.role_api.get_role(trust_role)"},{"line_number":73,"context_line":"            # TODO(morgan): Correct the cross-subsystem call here to allow"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_d848dbb5","line":70,"updated":"2018-07-23 15:57:28.000000000","message":"This is OK.  Used to check for a dictionary, which this does not do.  Should fail unit tests if it is ever not a dictionary.  Worst case this would trigger a 500 error, which is acceptable (its not going to happen)","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    for trust_role in trust.get(\u0027roles\u0027, []):"},{"line_number":70,"context_line":"        trust_role \u003d trust_role[\u0027id\u0027]"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            matching_role \u003d PROVIDERS.role_api.get_role(trust_role)"},{"line_number":73,"context_line":"            # TODO(morgan): Correct the cross-subsystem call here to allow"},{"line_number":74,"context_line":"            # for local handling of the role wrapping"},{"line_number":75,"context_line":"            full_role \u003d assignment.controllers.RoleV3.wrap_member("}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_18fdf33b","line":72,"updated":"2018-07-23 15:57:28.000000000","message":"Confirmed matches.","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    json_home_resource_rel_func \u003d _build_resource_relation"},{"line_number":94,"context_line":"    json_home_parameter_rel_func \u003d _build_parameter_relation"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def _check_unrestricted(self):"},{"line_number":97,"context_line":"        token \u003d self.auth_context[\u0027token\u0027]"},{"line_number":98,"context_line":"        auth_methods \u003d token[\u0027methods\u0027]"},{"line_number":99,"context_line":"        if \u0027application_credential\u0027 in auth_methods:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_b84abf7f","line":96,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  This matches.","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                raise exception.ForbiddenAction(action\u003daction)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def _find_redelegated_trust(self):"},{"line_number":107,"context_line":"        # Check if delegated via trust"},{"line_number":108,"context_line":"        redelegated_trust \u003d None"},{"line_number":109,"context_line":"        if self.oslo_context.is_delegated_auth:"},{"line_number":110,"context_line":"            src_trust_id \u003d self.oslo_context.trust_id"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_b8615f13","line":107,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  This matches","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    @staticmethod"},{"line_number":118,"context_line":"    def _parse_expiration_date(expiration_date):"},{"line_number":119,"context_line":"        if expiration_date is not None:"},{"line_number":120,"context_line":"            return utils.parse_expiration_date(expiration_date)"},{"line_number":121,"context_line":"        return None"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_ec2638ba","line":119,"updated":"2018-07-23 15:57:28.000000000","message":"OK","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            return utils.parse_expiration_date(expiration_date)"},{"line_number":121,"context_line":"        return None"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _require_trustor_has_role_in_project(self, trust):"},{"line_number":124,"context_line":"        trustor_roles \u003d self._get_trustor_roles(trust)"},{"line_number":125,"context_line":"        for trust_role in trust[\u0027roles\u0027]:"},{"line_number":126,"context_line":"            matching_roles \u003d [x for x in trustor_roles"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_2c13d05b","line":123,"updated":"2018-07-23 15:57:28.000000000","message":"OK","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                raise exception.RoleNotFound(role_id\u003dtrust_role[\u0027id\u0027])"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def _get_trustor_roles(self, trust):"},{"line_number":132,"context_line":"        original_trust \u003d trust.copy()"},{"line_number":133,"context_line":"        while original_trust.get(\u0027redelegated_trust_id\u0027):"},{"line_number":134,"context_line":"            original_trust \u003d PROVIDERS.trust_api.get_trust("},{"line_number":135,"context_line":"                original_trust[\u0027redelegated_trust_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_6c09c827","line":132,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  This matches","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            return []"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _normalize_role_list(self, trust_roles):"},{"line_number":150,"context_line":"        roles \u003d []"},{"line_number":151,"context_line":"        for role in trust_roles:"},{"line_number":152,"context_line":"            if role.get(\u0027id\u0027):"},{"line_number":153,"context_line":"                roles.append({\u0027id\u0027: role[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_387f8fbd","line":150,"updated":"2018-07-23 15:57:28.000000000","message":"OK. This matches","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        return roles"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _get_trust(self, trust_id):"},{"line_number":160,"context_line":"        ENFORCER.enforce_call(action\u003d\u0027identity:get_trust\u0027)"},{"line_number":161,"context_line":"        trust \u003d PROVIDERS.trust_api.get_trust(trust_id)"},{"line_number":162,"context_line":"        _trustor_trustee_only(trust)"},{"line_number":163,"context_line":"        _normalize_trust_expires_at(trust)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_4cc5ec3d","line":160,"updated":"2018-07-23 15:57:28.000000000","message":"OK","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        trustor_user_id \u003d flask.request.args.get(\u0027trustor_user_id\u0027)"},{"line_number":171,"context_line":"        trustee_user_id \u003d flask.request.args.get(\u0027trustee_user_id\u0027)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        if not flask.request.args:"},{"line_number":174,"context_line":"            # NOTE(morgan): Admin can list all trusts."},{"line_number":175,"context_line":"            ENFORCER.enforce_call(action\u003d\u0027admin_required\u0027)"},{"line_number":176,"context_line":"            trusts +\u003d PROVIDERS.trust_api.list_trusts()"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_2c2c3092","line":173,"updated":"2018-07-23 15:57:28.000000000","message":"OK","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if trustee_user_id !\u003d self.oslo_context.user_id:"},{"line_number":190,"context_line":"                raise exception.Forbidden(action\u003daction)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        trusts +\u003d PROVIDERS.trust_api.list_trusts_for_trustor(trustor_user_id)"},{"line_number":193,"context_line":"        trusts +\u003d PROVIDERS.trust_api.list_trusts_for_trustee(trustee_user_id)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        for trust in trusts:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_6c60e8d1","line":192,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  Extracted out of if block precondition check","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        return self.wrap_collection(trusts)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def get(self, trust_id\u003dNone):"},{"line_number":209,"context_line":"        \"\"\"Dispatch for GET/HEAD or LIST trusts.\"\"\""},{"line_number":210,"context_line":"        if trust_id is not None:"},{"line_number":211,"context_line":"            return self._get_trust(trust_id\u003dtrust_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_ac260067","line":208,"updated":"2018-07-23 15:57:28.000000000","message":"OK","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        ENFORCER.enforce_call(action\u003d\u0027identity:create_trust\u0027)"},{"line_number":221,"context_line":"        trust \u003d flask.request.json.get(\u0027trust\u0027, {})"},{"line_number":222,"context_line":"        validation.lazy_validate(schema.trust_create, trust)"},{"line_number":223,"context_line":"        self._check_unrestricted()"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if trust.get(\u0027project_id\u0027) and not trust.get(\u0027roles\u0027):"},{"line_number":226,"context_line":"            action \u003d _(\u0027At least one role should be specified\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_ac8280fe","line":223,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  THis moved down to where it is used","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            trust.get(\u0027expires_at\u0027))"},{"line_number":241,"context_line":"        trust \u003d self._assign_unique_id(trust)"},{"line_number":242,"context_line":"        redelegated_trust \u003d self._find_redelegated_trust()"},{"line_number":243,"context_line":"        return_trust \u003d PROVIDERS.trust_api.create_trust("},{"line_number":244,"context_line":"            trust_id\u003dtrust[\u0027id\u0027],"},{"line_number":245,"context_line":"            trust\u003dtrust,"},{"line_number":246,"context_line":"            roles\u003dtrust[\u0027roles\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_ac97e039","line":243,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  A little wonky now, but matches","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"dc3315f97f0f8c64fa4527f9851a9336c45f5a06","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        return self.wrap_member(return_trust), http_client.CREATED"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def delete(self, trust_id):"},{"line_number":254,"context_line":"        ENFORCER.enforce_call(action\u003d\u0027identity:delete_trust\u0027)"},{"line_number":255,"context_line":"        self._check_unrestricted()"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        trust \u003d PROVIDERS.trust_api.get_trust(trust_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_2caf50e1","line":254,"updated":"2018-07-23 15:57:28.000000000","message":"OK.  Matches","commit_id":"450239c9643b688239013a5d940f3c3dec6ee182"}],"keystone/tests/unit/server/test_keystone_flask.py":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"8a43fcfe56e1ff51d8a8eda7625825f0d5dcdf36","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    def _setup_flask_restful_api(self, **options):"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        self.restful_api_opts \u003d options.copy()"},{"line_number":181,"context_line":"        orig_value \u003d _TestResourceWithCollectionInfo.api_prefix"},{"line_number":182,"context_line":"        setattr(_TestResourceWithCollectionInfo,"},{"line_number":183,"context_line":"                \u0027api_prefix\u0027, options.get(\u0027api_url_prefix\u0027, \u0027\u0027))"},{"line_number":184,"context_line":"        self.addCleanup(setattr, _TestResourceWithCollectionInfo, \u0027api_prefix\u0027,"},{"line_number":185,"context_line":"                        orig_value)"},{"line_number":186,"context_line":"        self.restful_api \u003d _TestRestfulAPI(**options)"},{"line_number":187,"context_line":"        self.public_app.app.register_blueprint(self.restful_api.blueprint)"},{"line_number":188,"context_line":"        self.cleanup_instance(\u0027restful_api\u0027)"},{"line_number":189,"context_line":"        self.cleanup_instance(\u0027restful_api_opts\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_773a2c97","line":186,"range":{"start_line":181,"start_character":0,"end_line":186,"end_character":37},"updated":"2018-07-20 03:43:14.000000000","message":"this can be split into another test if needed.","commit_id":"e8c5c562169cd5512ddc78d1135268c668e61792"}],"keystone/trust/controllers.py":[{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"42256816d4503219ee04a0cba6ca03aba69b2819","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"5f7c97a3_b49202fb","updated":"2018-07-20 03:19:57.000000000","message":"Would it be possible to leave this file in place so we can see a side by side diff?  It contains much of the logic for trusts, and that was hard to get right.  I\u0027d be OK moving it in a separate review.  That review can even be first (move all logic from trust/controllers.py to api/controllers pre-flask.","commit_id":"e8c5c562169cd5512ddc78d1135268c668e61792"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"7bf99f76cc6c543e9e2a861f4cc52a43aaf4066b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"5f7c97a3_17865860","in_reply_to":"5f7c97a3_b49202fb","updated":"2018-07-20 03:39:09.000000000","message":"I am unsure what leaving this file provides. The side-by-side comparison can be done in gerrit and/or with external tools. If the file was sufficiently comparable you\u0027d see it as a moved file in git. Sadly, the flask implementation is different enough that just \"not deleting the file\" doesn\u0027t provide a lot more than what is here.\n\nThis is part of why no tests are changed in any flask conversion (as per design). Any/all tests that require changes will be done outside of the flask conversion patch (where possible) to ensure we maintain at least the same level of assurance of compatibility of behavior.","commit_id":"e8c5c562169cd5512ddc78d1135268c668e61792"}]}
