)]}'
{"openstack_auth/policy.py":[{"author":{"_account_id":11798,"name":"Michael Hagedorn","email":"mike.hagedorn@hpe.com","username":"mwhagedorn"},"change_message_id":"e851f3b12972337f3e37255069ed72e0f5d5394c","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def _domain_to_credentials(request):"},{"line_number":184,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    try:"},{"line_number":187,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_d95e1045","line":184,"updated":"2015-06-29 20:38:14.000000000","message":"why use the public interface only?  what if the user is an admin? is the \u0027admin\"endpoint type relevant here?","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":11798,"name":"Michael Hagedorn","email":"mike.hagedorn@hpe.com","username":"mwhagedorn"},"change_message_id":"8a96a2c666db9fcbbc457ab0e193f016a5dd0d05","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def _domain_to_credentials(request):"},{"line_number":184,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    try:"},{"line_number":187,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_2de7b6e5","line":184,"in_reply_to":"ba3cc151_0d7af224","updated":"2015-06-29 22:10:17.000000000","message":"Yeah.   Guang mentioned to me that in V3, public versus admin isnt meaningful anymore","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"6f6ceab8addbf7f588bd878f6c4347102d654e7c","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def _domain_to_credentials(request):"},{"line_number":184,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    try:"},{"line_number":187,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_98b9cdce","line":184,"in_reply_to":"ba3cc151_0d7af224","updated":"2015-07-22 23:35:54.000000000","message":"yep, I tried to just stay consistent with backend.py","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":11098,"name":"Brian Tully","email":"brian.tully@hpe.com","username":"btully"},"change_message_id":"60bfe903630e033ff5393ff0092eede31aec42c8","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def _domain_to_credentials(request):"},{"line_number":184,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    try:"},{"line_number":187,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_0d7af224","line":184,"in_reply_to":"ba3cc151_d95e1045","updated":"2015-06-29 22:08:01.000000000","message":"i believe this is only defaulting to public if the endpoint type isn\u0027t specified in settings. This is currently how it is done in backend.py","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"784faa76f777c35b33e34766952a04b4a9ed9085","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        LOG.error(\"Failed to create user from domain scoped token.\")"},{"line_number":197,"context_line":"        return None"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    return _user_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_3361e505","line":199,"updated":"2015-07-01 20:05:26.000000000","message":"passing this _user_to_credentials() will not pass the domain information back,  because the project scoped token is already cached request.user._credentials when line 30 is invoked. \n\nThis function will always return the project roles.","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"4a42706d0da4f5e6166b3262d834fd5e17b1843a","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        LOG.error(\"Failed to create user from domain scoped token.\")"},{"line_number":197,"context_line":"        return None"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    return _user_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_72976448","line":199,"in_reply_to":"ba3cc151_3361e505","updated":"2015-07-01 21:28:08.000000000","message":"Hey Lin, thx for reviewing.  I think the request param is never used in line 169 which is confusing.  We are pulling off the roles associated with the domain scoped token from line 191 an using the domain_creds to check with.\n\nI\u0027ll remove the request param in the method signature.  I can also just return a dictionary of credentials but the only tricky bit is that token: user.token has some extra logic I\u0027ll need.","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"6f6ceab8addbf7f588bd878f6c4347102d654e7c","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        LOG.error(\"Failed to create user from domain scoped token.\")"},{"line_number":197,"context_line":"        return None"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    return _user_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_5898256a","line":199,"in_reply_to":"ba3cc151_469dc264","updated":"2015-07-22 23:35:54.000000000","message":"I\u0027ve removed the request in later patchsets, we probably don\u0027t need it.","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"70b534cc7fe8f0a69a5fcdd45b661d1a0ce0fac1","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        LOG.error(\"Failed to create user from domain scoped token.\")"},{"line_number":197,"context_line":"        return None"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    return _user_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_469dc264","line":199,"in_reply_to":"ba3cc151_72976448","updated":"2015-07-01 23:12:41.000000000","message":"looking back, we never used request in this method. original author overreach.","commit_id":"7cf4e37830459a6a572efd21999432edae1b456c"},{"author":{"_account_id":11798,"name":"Michael Hagedorn","email":"mike.hagedorn@hpe.com","username":"mwhagedorn"},"change_message_id":"73a7402a3b18305c0a34413ecd3e637d44a96353","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    ]"},{"line_number":137,"context_line":"    for key in domain_id_keys:"},{"line_number":138,"context_line":"        if target.get(key) is None:"},{"line_number":139,"context_line":"            target[key] \u003d user.user_domain_id"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    credentials \u003d _user_to_credentials(request, user)"},{"line_number":142,"context_line":"    domain_creds \u003d _domain_to_credentials(request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a41bdd9_590dd535","line":139,"updated":"2015-07-14 09:49:51.000000000","message":"it would be easier to understand if you extracted lines 128-139 into something like get_domain_id_for_target(target) method","commit_id":"6a5ae5873732df863ae85f5691a368884dc3f76b"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"49ee10bc8c18199c45e9a62552f32898286e06dc","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    ]"},{"line_number":137,"context_line":"    for key in domain_id_keys:"},{"line_number":138,"context_line":"        if target.get(key) is None:"},{"line_number":139,"context_line":"            target[key] \u003d user.user_domain_id"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    credentials \u003d _user_to_credentials(request, user)"},{"line_number":142,"context_line":"    domain_creds \u003d _domain_to_credentials(request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_f81491e9","line":139,"in_reply_to":"9a41bdd9_590dd535","updated":"2015-07-22 23:33:41.000000000","message":"I think for now I\u0027ll add a comment.  I\u0027m still trying to figure out if we really want all these here.  I suspect we do because of the way the v3 file is written.","commit_id":"6a5ae5873732df863ae85f5691a368884dc3f76b"},{"author":{"_account_id":11778,"name":"Diana Whitten","email":"hurgleburgler@gmail.com","username":"hurgleburgler"},"change_message_id":"02ddf8f33de5c577678e0ee4858e2071d2f63854","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # use the default rule for that service policy"},{"line_number":168,"context_line":"        #"},{"line_number":169,"context_line":"        # waiting to make the check because the first call to"},{"line_number":170,"context_line":"        # enforce loads the rules"},{"line_number":171,"context_line":"        if action not in enforcer_scope.rules:"},{"line_number":172,"context_line":"            if not enforcer_scope.enforce(\u0027default\u0027, target, credentials):"},{"line_number":173,"context_line":"                is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_dddccc76","line":170,"updated":"2015-07-16 23:11:46.000000000","message":"it might be easier to read if we just did:\n\n  if action in enforcer_scope.rules or not enforcer_scope.enforce(\u0027default\u0027, target, credentials):\n    is_valid \u003d False","commit_id":"9f2dfb55cc317208901b7da6862fab5f01f43042"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"0e2c984787d276d6eb85cddd66947e87b034d8d3","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # use the default rule for that service policy"},{"line_number":168,"context_line":"        #"},{"line_number":169,"context_line":"        # waiting to make the check because the first call to"},{"line_number":170,"context_line":"        # enforce loads the rules"},{"line_number":171,"context_line":"        if action not in enforcer_scope.rules:"},{"line_number":172,"context_line":"            if not enforcer_scope.enforce(\u0027default\u0027, target, credentials):"},{"line_number":173,"context_line":"                is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_bd9b0872","line":170,"in_reply_to":"9a41bdd9_dddccc76","updated":"2015-07-16 23:13:51.000000000","message":"makes sense, will give it a go. thx!","commit_id":"9f2dfb55cc317208901b7da6862fab5f01f43042"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"360d4b8fa2e5939caccc11f8dd75a37fc5081e48","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                             \u0027username\u0027: user.username,"},{"line_number":185,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":186,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":187,"context_line":"                             \u0027domain_id\u0027: user.user_domain_id,"},{"line_number":188,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":189,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":190,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_6ef27bd4","line":187,"updated":"2015-07-21 01:08:01.000000000","message":"the policy engine expects this to be the domain scoped and not the user domain.","commit_id":"9f2dfb55cc317208901b7da6862fab5f01f43042"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"9aac9e69c7944af78f482d450c9a9763c7c93331","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                             \u0027username\u0027: user.username,"},{"line_number":185,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":186,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":187,"context_line":"                             \u0027domain_id\u0027: user.user_domain_id,"},{"line_number":188,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":189,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":190,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_95e55639","line":187,"in_reply_to":"3a50d1a3_6ef27bd4","updated":"2015-07-21 22:53:21.000000000","message":"Hey Lin, gave this a shot in a previous patchset but it broke the ability to \u0027set context\u0027 for Cloud Admin.\n\nI wonder if I had another bug in there maybe?  I\u0027ll dig a little deeper but I\u0027ll leave this for now so it doesn\u0027t break Cloud Admin.","commit_id":"9f2dfb55cc317208901b7da6862fab5f01f43042"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"bf55dbf95c44b7defd5e4bf4e200ebec47859eff","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":200,"context_line":"    try:"},{"line_number":201,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":202,"context_line":"        # no domain token (aka member)"},{"line_number":203,"context_line":"        if not domain_auth_ref:"},{"line_number":204,"context_line":"            return None"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_60a79b0b","line":202,"updated":"2015-08-25 17:13:25.000000000","message":"the none here, means no check","commit_id":"92534dd715b36aecdf29aaebb33ea4804dbabf2d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"d50bc59bbf519cf6207624e79d7748f8ab65b1a5","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":200,"context_line":"    try:"},{"line_number":201,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":202,"context_line":"        # no domain token (aka member)"},{"line_number":203,"context_line":"        if not domain_auth_ref:"},{"line_number":204,"context_line":"            return None"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_5b284c33","line":202,"in_reply_to":"fa1b9901_60a79b0b","updated":"2015-08-25 17:42:20.000000000","message":"Good catch.  I\u0027ll use that to above.","commit_id":"92534dd715b36aecdf29aaebb33ea4804dbabf2d"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"33c3eb8a7f36b8953f6b9b6d1d7d520d25aaeb41","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"def _domain_to_credentials(request):"},{"line_number":195,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":196,"context_line":"    try:"},{"line_number":197,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":198,"context_line":"        # no domain token (aka member)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa1b9901_a66a9ab3","line":195,"updated":"2015-08-26 01:57:39.000000000","message":"this will cause a performance problem, it will get invoked for every policy check.  Need to add some caching here.\n\n_user_to_credentials() implemented some sort of caching to avoid creating the credential object for each policy check","commit_id":"086222a0d49bc6f37bf9780478ecee61a342671d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"26cd40b33682654368dac1fc254b58989606f9cc","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"def _domain_to_credentials(request):"},{"line_number":195,"context_line":"    interface \u003d getattr(settings, \u0027OPENSTACK_ENDPOINT_TYPE\u0027, \u0027public\u0027)"},{"line_number":196,"context_line":"    try:"},{"line_number":197,"context_line":"        domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":198,"context_line":"        # no domain token (aka member)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da20952f_bfb8ffe6","line":195,"in_reply_to":"fa1b9901_a66a9ab3","updated":"2015-08-26 16:20:12.000000000","message":"Thanks Lin!  I\u0027ll check it out today.","commit_id":"086222a0d49bc6f37bf9780478ecee61a342671d"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"3af849a7ee2c9394dd972ed4eecf26af13a53852","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        \u0027group.domain_id\u0027,"},{"line_number":134,"context_line":"        \u0027target.group.domain_id\u0027,"},{"line_number":135,"context_line":"        \u0027target.project.domain_id\u0027,"},{"line_number":136,"context_line":"        \u0027target.user.domain_id\u0027,"},{"line_number":137,"context_line":"    ]"},{"line_number":138,"context_line":"    for key in domain_id_keys:"},{"line_number":139,"context_line":"        if target.get(key) is None:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_bb09e133","line":136,"updated":"2015-08-26 23:36:18.000000000","message":"target.XXX should be really set by the code making a call on the policy check.","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"53362bd0022197db5cd1a181ac0b0e4f555302e6","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        \u0027group.domain_id\u0027,"},{"line_number":134,"context_line":"        \u0027target.group.domain_id\u0027,"},{"line_number":135,"context_line":"        \u0027target.project.domain_id\u0027,"},{"line_number":136,"context_line":"        \u0027target.user.domain_id\u0027,"},{"line_number":137,"context_line":"    ]"},{"line_number":138,"context_line":"    for key in domain_id_keys:"},{"line_number":139,"context_line":"        if target.get(key) is None:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_a1af70e2","line":136,"in_reply_to":"da20952f_bb09e133","updated":"2015-08-27 00:07:39.000000000","message":"k, looking into this.","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"3af849a7ee2c9394dd972ed4eecf26af13a53852","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    ]"},{"line_number":138,"context_line":"    for key in domain_id_keys:"},{"line_number":139,"context_line":"        if target.get(key) is None:"},{"line_number":140,"context_line":"            target[key] \u003d user.user_domain_id"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    credentials \u003d _user_to_credentials(user)"},{"line_number":143,"context_line":"    domain_credentials \u003d _domain_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_5b068521","line":140,"updated":"2015-08-26 23:36:18.000000000","message":"this is not accurate, since user_domain_id !\u003d domain scope","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"53362bd0022197db5cd1a181ac0b0e4f555302e6","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    ]"},{"line_number":138,"context_line":"    for key in domain_id_keys:"},{"line_number":139,"context_line":"        if target.get(key) is None:"},{"line_number":140,"context_line":"            target[key] \u003d user.user_domain_id"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    credentials \u003d _user_to_credentials(user)"},{"line_number":143,"context_line":"    domain_credentials \u003d _domain_to_credentials(request, user)"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_61b9582e","line":140,"in_reply_to":"da20952f_5b068521","updated":"2015-08-27 00:07:39.000000000","message":"makes sense.","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"3af849a7ee2c9394dd972ed4eecf26af13a53852","unresolved":false,"context_lines":[{"line_number":186,"context_line":"                             \u0027username\u0027: user.username,"},{"line_number":187,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":188,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":189,"context_line":"                             \u0027domain_id\u0027: user.user_domain_id,"},{"line_number":190,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":191,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":192,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_904b9cb0","line":189,"updated":"2015-08-26 23:36:18.000000000","message":"for the case of domain scoped token and v3 policy \n\ndomain_id should be mapped to the domain scoped token [1], not the domain of the user.  Because a user can scoped to any scope to any domain as long as the user has domain roles on it.\n\n[1] https://github.com/openstack/keystone/blob/master/etc/policy.v3cloudsample.json#L3","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"a7ebd5ede7291133af7dfb00d1f761ede6b7e334","unresolved":false,"context_lines":[{"line_number":186,"context_line":"                             \u0027username\u0027: user.username,"},{"line_number":187,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":188,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":189,"context_line":"                             \u0027domain_id\u0027: user.user_domain_id,"},{"line_number":190,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":191,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":192,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_d60eece4","line":189,"in_reply_to":"da20952f_904b9cb0","updated":"2015-08-26 23:42:41.000000000","message":"k, let me look through this one and see if I can get it right this time","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"3af849a7ee2c9394dd972ed4eecf26af13a53852","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    if not hasattr(user, \"_domain_credentials\"):"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":199,"context_line":"            # no domain token (i.e. Member)"},{"line_number":200,"context_line":"            if not domain_auth_ref:"},{"line_number":201,"context_line":"                return None"},{"line_number":202,"context_line":"            domain_user \u003d auth_user.create_user_from_token("}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_f60d3038","line":199,"updated":"2015-08-26 23:36:18.000000000","message":"to be more accurate: no domain role or not running on V3","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"a7ebd5ede7291133af7dfb00d1f761ede6b7e334","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    if not hasattr(user, \"_domain_credentials\"):"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            domain_auth_ref \u003d request.session.get(\u0027domain_token\u0027)"},{"line_number":199,"context_line":"            # no domain token (i.e. Member)"},{"line_number":200,"context_line":"            if not domain_auth_ref:"},{"line_number":201,"context_line":"                return None"},{"line_number":202,"context_line":"            domain_user \u003d auth_user.create_user_from_token("}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_b6f6d8d5","line":199,"in_reply_to":"da20952f_f60d3038","updated":"2015-08-26 23:42:41.000000000","message":"np :)","commit_id":"a529c147f09336eedd491b84c44ea4b3e3985868"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"7a99f7b4353df00f469c8cceabf0f4d951a3ace6","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        \u0027group.domain_id\u0027,"},{"line_number":144,"context_line":"        \u0027target.group.domain_id\u0027,"},{"line_number":145,"context_line":"        \u0027target.project.domain_id\u0027,"},{"line_number":146,"context_line":"        \u0027target.user.domain_id\u0027,"},{"line_number":147,"context_line":"    ]"},{"line_number":148,"context_line":"    # populates domain id keys with user\u0027s current domain id"},{"line_number":149,"context_line":"    for key in domain_id_keys:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da20952f_79647a48","line":146,"updated":"2015-08-27 20:24:00.000000000","message":"Hey Lin,\n\nI took a stab and passing in the target dictionary on policy.check calls in horizon.  I was only able to get it to work partially but it got too messy as we are making this check everywhere.\n\nPerhaps I can revisit it in the horizon patch?","commit_id":"acda6eee5a3599a25754ae5e95fa9513aa6c446d"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"77e2c2e6f141d592cb68721885dbbd2ab43978d3","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        domain \u003d domain_auth_ref.get(\u0027domain\u0027)"},{"line_number":119,"context_line":"        current_domain_id \u003d domain.get(\u0027id\u0027)"},{"line_number":120,"context_line":"    except Exception:"},{"line_number":121,"context_line":"        LOG.warn(\"Failed to retrieve domain scoped token.\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    # Several service policy engines default to a project id check for"},{"line_number":124,"context_line":"    # ownership. Since the user is already scoped to a project, if a"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_df1cb815","line":121,"updated":"2015-09-02 00:03:53.000000000","message":"this should not be a warning, as a user with no domain scoped will happen most of the time. This will just flood the log file","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"b4aadfe0fb6dd0601af87ceda1c30f0621bf3c58","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        domain \u003d domain_auth_ref.get(\u0027domain\u0027)"},{"line_number":119,"context_line":"        current_domain_id \u003d domain.get(\u0027id\u0027)"},{"line_number":120,"context_line":"    except Exception:"},{"line_number":121,"context_line":"        LOG.warn(\"Failed to retrieve domain scoped token.\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    # Several service policy engines default to a project id check for"},{"line_number":124,"context_line":"    # ownership. Since the user is already scoped to a project, if a"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_63e049cd","line":121,"in_reply_to":"da20952f_df1cb815","updated":"2015-09-02 19:07:45.000000000","message":"good point debug at most","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        domain \u003d domain_auth_ref.get(\u0027domain\u0027)"},{"line_number":119,"context_line":"        current_domain_id \u003d domain.get(\u0027id\u0027)"},{"line_number":120,"context_line":"    except Exception:"},{"line_number":121,"context_line":"        LOG.warn(\"Failed to retrieve domain scoped token.\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    # Several service policy engines default to a project id check for"},{"line_number":124,"context_line":"    # ownership. Since the user is already scoped to a project, if a"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_76e7ae40","line":121,"in_reply_to":"da20952f_df1cb815","updated":"2015-09-02 17:27:04.000000000","message":"k, if I\u0027ll see about removing this part.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"77e2c2e6f141d592cb68721885dbbd2ab43978d3","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        \u0027group.domain_id\u0027,"},{"line_number":146,"context_line":"        \u0027target.group.domain_id\u0027,"},{"line_number":147,"context_line":"        \u0027target.project.domain_id\u0027,"},{"line_number":148,"context_line":"        \u0027target.user.domain_id\u0027,"},{"line_number":149,"context_line":"    ]"},{"line_number":150,"context_line":"    # populates domain id keys with user\u0027s current domain id"},{"line_number":151,"context_line":"    for key in domain_id_keys:"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_3fb934ed","line":148,"updated":"2015-09-02 00:03:53.000000000","message":"target.XXX should be set by the calling method that want to perform the policy check.\n\nWe don\u0027t need to set default values here.\n\nwe don\u0027t need line 140-153, all this should be set by credentials or the calling method.\n\nfor example: project.domain_id is used when the domain admin is trying to create a new project, it checks the domain_id matches the domain scope.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        \u0027group.domain_id\u0027,"},{"line_number":146,"context_line":"        \u0027target.group.domain_id\u0027,"},{"line_number":147,"context_line":"        \u0027target.project.domain_id\u0027,"},{"line_number":148,"context_line":"        \u0027target.user.domain_id\u0027,"},{"line_number":149,"context_line":"    ]"},{"line_number":150,"context_line":"    # populates domain id keys with user\u0027s current domain id"},{"line_number":151,"context_line":"    for key in domain_id_keys:"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_f6409e09","line":148,"in_reply_to":"da20952f_3fb934ed","updated":"2015-09-02 17:27:04.000000000","message":"I\u0027ll take another look at the calls from horizon.  I can pass in target dictionary but I think there was some other logic in there I must have missed.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"4c7260bc298323a9fc55cad6bed1f3d54314d3f9","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    for action in actions:"},{"line_number":162,"context_line":"        scope, action \u003d action[0], action[1]"},{"line_number":163,"context_line":"        if scope in enforcer:"},{"line_number":164,"context_line":"            if scope \u003d\u003d \u0027identity\u0027 and domain_credentials:"},{"line_number":165,"context_line":"                # use domain credentials"},{"line_number":166,"context_line":"                return _check_credentials("},{"line_number":167,"context_line":"                    enforcer[scope], action, target, domain_credentials)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_3a1142b0","line":164,"updated":"2015-09-02 00:12:03.000000000","message":"I think this is compatible with the existing v2 policy file by luck only.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    for action in actions:"},{"line_number":162,"context_line":"        scope, action \u003d action[0], action[1]"},{"line_number":163,"context_line":"        if scope in enforcer:"},{"line_number":164,"context_line":"            if scope \u003d\u003d \u0027identity\u0027 and domain_credentials:"},{"line_number":165,"context_line":"                # use domain credentials"},{"line_number":166,"context_line":"                return _check_credentials("},{"line_number":167,"context_line":"                    enforcer[scope], action, target, domain_credentials)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_f60e5ee4","line":164,"in_reply_to":"da20952f_3a1142b0","updated":"2015-09-02 17:27:04.000000000","message":"we could check for v3 explicitly to help avoid v2 incompatibility issues.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"4ece23f1b198c62481687f63bef0646c6981e905","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    for action in actions:"},{"line_number":162,"context_line":"        scope, action \u003d action[0], action[1]"},{"line_number":163,"context_line":"        if scope in enforcer:"},{"line_number":164,"context_line":"            if scope \u003d\u003d \u0027identity\u0027 and domain_credentials:"},{"line_number":165,"context_line":"                # use domain credentials"},{"line_number":166,"context_line":"                return _check_credentials("},{"line_number":167,"context_line":"                    enforcer[scope], action, target, domain_credentials)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_f9685823","line":164,"in_reply_to":"da20952f_a3ed01b9","updated":"2015-09-03 18:11:02.000000000","message":"k, maybe just a comment here then.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"6b92d30ae86233da322d5a46a87c2a03dd5202c9","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    for action in actions:"},{"line_number":162,"context_line":"        scope, action \u003d action[0], action[1]"},{"line_number":163,"context_line":"        if scope in enforcer:"},{"line_number":164,"context_line":"            if scope \u003d\u003d \u0027identity\u0027 and domain_credentials:"},{"line_number":165,"context_line":"                # use domain credentials"},{"line_number":166,"context_line":"                return _check_credentials("},{"line_number":167,"context_line":"                    enforcer[scope], action, target, domain_credentials)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_a3ed01b9","line":164,"in_reply_to":"da20952f_f60e5ee4","updated":"2015-09-02 19:09:08.000000000","message":"problem is we have no idea what\u0027s actually in the policy file.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":16482,"name":"Shaun Smekel","email":"shaun.smekel@theorem.net.au","username":"smekel"},"change_message_id":"10f5a8233ad1e8dd62b2cb4c162b25824c6eb5de","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        # use the default rule for that service policy"},{"line_number":184,"context_line":"        #"},{"line_number":185,"context_line":"        # waiting to make the check because the first call to"},{"line_number":186,"context_line":"        # enforce loads the rules"},{"line_number":187,"context_line":"        if (action not in enforcer_scope.rules or"},{"line_number":188,"context_line":"                not enforcer_scope.enforce(\u0027default\u0027, target, credentials)):"},{"line_number":189,"context_line":"            is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_772f153f","line":186,"updated":"2015-08-31 22:23:06.000000000","message":"The if/else statements end up at the same result. Is this intended for logging/debug in the enforcer_scope.enforce method?","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        # use the default rule for that service policy"},{"line_number":184,"context_line":"        #"},{"line_number":185,"context_line":"        # waiting to make the check because the first call to"},{"line_number":186,"context_line":"        # enforce loads the rules"},{"line_number":187,"context_line":"        if (action not in enforcer_scope.rules or"},{"line_number":188,"context_line":"                not enforcer_scope.enforce(\u0027default\u0027, target, credentials)):"},{"line_number":189,"context_line":"            is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_562f0a3e","line":186,"in_reply_to":"da20952f_772f153f","updated":"2015-09-02 17:27:04.000000000","message":"k, will take another look to see what the original logic was doing.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"77e2c2e6f141d592cb68721885dbbd2ab43978d3","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # waiting to make the check because the first call to"},{"line_number":186,"context_line":"        # enforce loads the rules"},{"line_number":187,"context_line":"        if (action not in enforcer_scope.rules or"},{"line_number":188,"context_line":"                not enforcer_scope.enforce(\u0027default\u0027, target, credentials)):"},{"line_number":189,"context_line":"            is_valid \u003d False"},{"line_number":190,"context_line":"        else:"},{"line_number":191,"context_line":"            is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_dfc0387f","line":188,"updated":"2015-09-02 00:03:53.000000000","message":"the logic here missed a case when the user has privilege to the default. rule\n\nconsider the use case when:\n1. the policy rule is not defined\n2. but the user has privilege to the default rule\n\nThis should return True.\n\nBut with this condition, it only checks #1 and returns False right away.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # waiting to make the check because the first call to"},{"line_number":186,"context_line":"        # enforce loads the rules"},{"line_number":187,"context_line":"        if (action not in enforcer_scope.rules or"},{"line_number":188,"context_line":"                not enforcer_scope.enforce(\u0027default\u0027, target, credentials)):"},{"line_number":189,"context_line":"            is_valid \u003d False"},{"line_number":190,"context_line":"        else:"},{"line_number":191,"context_line":"            is_valid \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_b620e64a","line":188,"in_reply_to":"da20952f_dfc0387f","updated":"2015-09-02 17:27:04.000000000","message":"thanks for catching this.  I\u0027ll clean this up in the next patchset.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"77e2c2e6f141d592cb68721885dbbd2ab43978d3","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":202,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":203,"context_line":"                             \u0027domain_id\u0027: (current_domain_id or"},{"line_number":204,"context_line":"                                           user.user_domain_id),"},{"line_number":205,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":206,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":207,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_3ab942ed","line":204,"updated":"2015-09-02 00:03:53.000000000","message":"this could just be user.domain_id\n\ndomain scoped info is already made available in the user object by DOA:\n\nhttps://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/user.py#L109-L110\n\nhttps://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/user.py#L109-L110","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"77e2c2e6f141d592cb68721885dbbd2ab43978d3","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":202,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":203,"context_line":"                             \u0027domain_id\u0027: (current_domain_id or"},{"line_number":204,"context_line":"                                           user.user_domain_id),"},{"line_number":205,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":206,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":207,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_fa566acd","line":204,"updated":"2015-09-02 00:03:53.000000000","message":"this should be just user.domain_id\n\nthere is no need to figure it out yourself, DOA already set this:\n\nhttps://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/user.py#L109-L110\n\nhttps://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/user.py#L205","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":202,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":203,"context_line":"                             \u0027domain_id\u0027: (current_domain_id or"},{"line_number":204,"context_line":"                                           user.user_domain_id),"},{"line_number":205,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":206,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":207,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_56d62a28","line":204,"in_reply_to":"da20952f_3ab942ed","updated":"2015-09-02 17:27:04.000000000","message":"k, that would simplify things a lot.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":202,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":203,"context_line":"                             \u0027domain_id\u0027: (current_domain_id or"},{"line_number":204,"context_line":"                                           user.user_domain_id),"},{"line_number":205,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":206,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":207,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_f6b3be08","line":204,"in_reply_to":"da20952f_fa566acd","updated":"2015-09-02 17:27:04.000000000","message":"will use user.domain_id and test again :)","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"4c7260bc298323a9fc55cad6bed1f3d54314d3f9","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            return None"},{"line_number":215,"context_line":"        domain_user \u003d auth_user.create_user_from_token("},{"line_number":216,"context_line":"            request, auth_user.Token(domain_auth_ref),"},{"line_number":217,"context_line":"            domain_auth_ref.service_catalog.url_for("},{"line_number":218,"context_line":"                endpoint_type\u003d_INTERFACE))"},{"line_number":219,"context_line":"        user._domain_credentials \u003d _user_to_credentials(domain_user,"},{"line_number":220,"context_line":"                                                        current_domain_id)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_5abaf6c1","line":217,"updated":"2015-09-02 00:12:03.000000000","message":"I think this can be simplified by passing in None for the endpoint. The endpoint won\u0027t be used until 1 of 2 properties are accessed.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"c91c17c0765c80de24e252847fa74b9cc38e9249","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            return None"},{"line_number":215,"context_line":"        domain_user \u003d auth_user.create_user_from_token("},{"line_number":216,"context_line":"            request, auth_user.Token(domain_auth_ref),"},{"line_number":217,"context_line":"            domain_auth_ref.service_catalog.url_for("},{"line_number":218,"context_line":"                endpoint_type\u003d_INTERFACE))"},{"line_number":219,"context_line":"        user._domain_credentials \u003d _user_to_credentials(domain_user,"},{"line_number":220,"context_line":"                                                        current_domain_id)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_d6c9da7a","line":217,"in_reply_to":"da20952f_5abaf6c1","updated":"2015-09-02 17:27:04.000000000","message":"sounds good, I\u0027ll remove the constant above too.","commit_id":"f668a358ecce4cb11822a38a0f87840dba5424d7"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"f8a3034de517fc2c6d4eca818a6f4d3156ae64a3","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                             \u0027username\u0027: user.username,"},{"line_number":189,"context_line":"                             \u0027project_id\u0027: user.project_id,"},{"line_number":190,"context_line":"                             \u0027project_name\u0027: user.project_name,"},{"line_number":191,"context_line":"                             \u0027domain_id\u0027: user.user_domain_id,"},{"line_number":192,"context_line":"                             \u0027is_admin\u0027: user.is_superuser,"},{"line_number":193,"context_line":"                             \u0027roles\u0027: roles}"},{"line_number":194,"context_line":"    return user._credentials"}],"source_content_type":"text/x-python","patch_set":21,"id":"da20952f_467f1317","line":191,"updated":"2015-09-03 23:41:49.000000000","message":"If the user is created from project token, user.domain_id will always be None.\n\nI tried to address this on lines 211 and 143.\n\nLet me know that\u0027s what you have in mind. The case where this problem might come up doesn\u0027t happen in horizon today but could in the future so we could just put a comment here to address it later.","commit_id":"6b29c03c3a02ee1154ca856c6ba111f8d6be4f19"}],"openstack_auth/tests/conf/policy.v3cloudsample.json":[{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"413128e6ce3171547700044578fe1bfcac6142ec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"admin_required\": \"role:admin\","},{"line_number":3,"context_line":"    \"cloud_admin\": \"rule:admin_required and domain_id:default\","},{"line_number":4,"context_line":"    \"service_role\": \"role:service\","},{"line_number":5,"context_line":"    \"service_or_admin\": \"rule:admin_required or rule:service_role\","},{"line_number":6,"context_line":"    \"owner\" : \"user_id:%(user_id)s or user_id:%(target.token.user_id)s\","}],"source_content_type":"application/json","patch_set":24,"id":"ba8a016a_64f3760b","line":3,"updated":"2015-11-23 16:30:11.000000000","message":"This is _almost_ the same file as found in keystone/etc ... except for this one line. What do you think about changing the test so an exact duplicate of keystone\u0027s sample file can be used?","commit_id":"934b6aebc5bc473b4182435b8766c0fe600e8f99"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"627ee3cd27a01435538e90eebd42c96699a0cf88","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"admin_required\": \"role:admin\","},{"line_number":3,"context_line":"    \"cloud_admin\": \"rule:admin_required and domain_id:default\","},{"line_number":4,"context_line":"    \"service_role\": \"role:service\","},{"line_number":5,"context_line":"    \"service_or_admin\": \"rule:admin_required or rule:service_role\","},{"line_number":6,"context_line":"    \"owner\" : \"user_id:%(user_id)s or user_id:%(target.token.user_id)s\","}],"source_content_type":"application/json","patch_set":24,"id":"ba8a016a_f0539137","line":3,"in_reply_to":"ba8a016a_64f3760b","updated":"2015-11-23 21:48:22.000000000","message":"Good catch.  Will update it in a moment.","commit_id":"934b6aebc5bc473b4182435b8766c0fe600e8f99"}],"openstack_auth/tests/tests.py":[{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"413128e6ce3171547700044578fe1bfcac6142ec","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"        self.addCleanup(override.disable)"},{"line_number":1110,"context_line":""},{"line_number":1111,"context_line":"        mock_user \u003d user.User(id\u003d1, roles\u003dself._roles,"},{"line_number":1112,"context_line":"                              user_domain_id\u003d\u0027default\u0027)"},{"line_number":1113,"context_line":"        patcher \u003d mock.patch(\u0027openstack_auth.utils.get_user\u0027,"},{"line_number":1114,"context_line":"                             return_value\u003dmock_user)"},{"line_number":1115,"context_line":"        self.MockClass \u003d patcher.start()"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_04514ad8","line":1112,"updated":"2015-11-23 16:30:11.000000000","message":"I think changing this to \"admin_domain_id\" would allow keystone\u0027s sample file to be used without modification, right?","commit_id":"934b6aebc5bc473b4182435b8766c0fe600e8f99"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"627ee3cd27a01435538e90eebd42c96699a0cf88","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"        self.addCleanup(override.disable)"},{"line_number":1110,"context_line":""},{"line_number":1111,"context_line":"        mock_user \u003d user.User(id\u003d1, roles\u003dself._roles,"},{"line_number":1112,"context_line":"                              user_domain_id\u003d\u0027default\u0027)"},{"line_number":1113,"context_line":"        patcher \u003d mock.patch(\u0027openstack_auth.utils.get_user\u0027,"},{"line_number":1114,"context_line":"                             return_value\u003dmock_user)"},{"line_number":1115,"context_line":"        self.MockClass \u003d patcher.start()"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_b03429fb","line":1112,"in_reply_to":"ba8a016a_04514ad8","updated":"2015-11-23 21:48:22.000000000","message":"Will give it a go. thx!","commit_id":"934b6aebc5bc473b4182435b8766c0fe600e8f99"}]}
