)]}'
{".idea/vcs.xml":[{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"ff124ba5ce624438a6db8bd056987f0925f880be","unresolved":false,"context_lines":[{"line_number":1,"context_line":"\u003c?xml version\u003d\"1.0\" encoding\u003d\"UTF-8\"?\u003e"},{"line_number":2,"context_line":"\u003cproject version\u003d\"4\"\u003e"},{"line_number":3,"context_line":"  \u003ccomponent name\u003d\"VcsDirectoryMappings\"\u003e"},{"line_number":4,"context_line":"    \u003cmapping directory\u003d\"$PROJECT_DIR$\" vcs\u003d\"Git\" /\u003e"},{"line_number":5,"context_line":"  \u003c/component\u003e"},{"line_number":6,"context_line":"\u003c/project\u003e"}],"source_content_type":"application/xml","patch_set":9,"id":"5f2577a7_04cf6c56","line":6,"range":{"start_line":1,"start_character":0,"end_line":6,"end_character":10},"updated":"2017-09-25 14:41:52.000000000","message":"what\u0027s this ?","commit_id":"b9e67e5849e585db46ebcb56cb82376f0f84bfb7"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"5570f4570e760db2f1f17054afbf036cbf55f2b9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"7f515b1d_7f1168ac","updated":"2017-09-25 19:07:03.000000000","message":"Is this an IDE configuration file?","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"}],"oslo_policy/_checks.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ce1134738a459de5545d128d8b32fba68ba4865f","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_3c2cf400","line":264,"updated":"2017-09-13 19:45:39.000000000","message":"What is the motivation for using a separate class here, instead of looking at the URL in the HttpCheck class and deciding if the extra cert work needs to be done? Doesn\u0027t that put the burden on the deployer to choose the proper check type?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"2e63ddb12a023038ea615ccabc0611888fb32a00","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_dab84f77","line":264,"in_reply_to":"5f2577a7_3c2cf400","updated":"2017-09-13 21:51:31.000000000","message":"in the syntax you can use currently \"role:\" or \"rule:\" or \"http:\" and i was adding a \"https:\" following the same pattern\n\nhttp://codesearch.openstack.org/?q\u003d%40register\u0026i\u003dnope\u0026files\u003d\u0026repos\u003doslo.policy","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"c9bbbffd8918bb21a5551c1fbd121095b5bc9293","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_80513665","line":264,"in_reply_to":"5f2577a7_60e76a42","updated":"2017-09-13 22:44:21.000000000","message":"Hi Doug, Sorry i should have used an example, \n\nLet\u0027s take a policy.json snippet, for example\n\n\"identity:create_user\" : \"role:admin\"\n\nWhen we use the HttpCheck we would have to specify\n\n\"identity:create_user\" : \"http://xyz/policy_check\"\n\nWhen we use HttpsCheck we would have to specify\n\n\"identity:create_user\" : \"https://xyz/policy_check\"\n\nNote that the \"http:\" and \"https:\" are doing double duty, they are prefix(es) that the policy engine knows about as well as the url itself. \n\nThanks,\nDims","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"71d7cfcf6f1c996d5bfcfdc2f4e630a07435e544","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_eb021b09","line":264,"in_reply_to":"5f2577a7_80513665","updated":"2017-09-13 22:53:41.000000000","message":"Sure. But both of those prefixes can be associated with the same class, right?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6096a7921272574cf869f98f142d064363da8ee9","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_60e76a42","line":264,"in_reply_to":"5f2577a7_dab84f77","updated":"2017-09-13 22:24:21.000000000","message":"Right, why not just make the http: rule support https URLs? Even if we have to register the class twice as http and https, why duplicate the implementation?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"07c00bf815e39fc74c8e3f350a4c6505bfb2e868","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@register(\u0027https\u0027)"},{"line_number":264,"context_line":"class HttpsCheck(Check):"},{"line_number":265,"context_line":"    \"\"\"Check ``https:`` rules by calling to a remote server."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    This example implementation simply verifies that the response"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_6baaabd2","line":264,"in_reply_to":"5f2577a7_eb021b09","updated":"2017-09-14 05:08:11.000000000","message":"Yea, funny thing is that we don\u0027t have that information in the __call__ method (prefix is stripped out i think)\n\nSo we do the following in HttpCheck\nurl \u003d (\u0027http:\u0027 + self.match) % target\n\nand the following in HttpsCheck\nurl \u003d (\u0027https:\u0027 + self.match) % target","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ce1134738a459de5545d128d8b32fba68ba4865f","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        ca_crt_file \u003d enforcer.conf.oslo_policy.remote_ssl_ca_crt_file"},{"line_number":277,"context_line":"        verify_server \u003d enforcer.conf.oslo_policy.remote_ssl_verify_server_crt"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if cert_file and not os.path.exists(cert_file):"},{"line_number":280,"context_line":"            raise RuntimeError("},{"line_number":281,"context_line":"                _(\"Unable to find ssl cert_file  : %s\") % cert_file)"},{"line_number":282,"context_line":"        if key_file and not os.path.exists(key_file):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_5c4460b7","line":279,"updated":"2017-09-13 19:45:39.000000000","message":"Should this check that the file is readable, too?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"2e63ddb12a023038ea615ccabc0611888fb32a00","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        ca_crt_file \u003d enforcer.conf.oslo_policy.remote_ssl_ca_crt_file"},{"line_number":277,"context_line":"        verify_server \u003d enforcer.conf.oslo_policy.remote_ssl_verify_server_crt"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if cert_file and not os.path.exists(cert_file):"},{"line_number":280,"context_line":"            raise RuntimeError("},{"line_number":281,"context_line":"                _(\"Unable to find ssl cert_file  : %s\") % cert_file)"},{"line_number":282,"context_line":"        if key_file and not os.path.exists(key_file):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_1a4db799","line":279,"in_reply_to":"5f2577a7_5c4460b7","updated":"2017-09-13 21:51:31.000000000","message":"Good point will update","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ce1134738a459de5545d128d8b32fba68ba4865f","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if cert_file and not os.path.exists(cert_file):"},{"line_number":280,"context_line":"            raise RuntimeError("},{"line_number":281,"context_line":"                _(\"Unable to find ssl cert_file  : %s\") % cert_file)"},{"line_number":282,"context_line":"        if key_file and not os.path.exists(key_file):"},{"line_number":283,"context_line":"            raise RuntimeError("},{"line_number":284,"context_line":"                _(\"Unable to find ssl key_file : %s\") % key_file)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_fc0e6c8b","line":281,"updated":"2017-09-13 19:45:39.000000000","message":"Should the error report the rule being evaluated, or will that happen higher up the stack when this exception is processed?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6096a7921272574cf869f98f142d064363da8ee9","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if cert_file and not os.path.exists(cert_file):"},{"line_number":280,"context_line":"            raise RuntimeError("},{"line_number":281,"context_line":"                _(\"Unable to find ssl cert_file  : %s\") % cert_file)"},{"line_number":282,"context_line":"        if key_file and not os.path.exists(key_file):"},{"line_number":283,"context_line":"            raise RuntimeError("},{"line_number":284,"context_line":"                _(\"Unable to find ssl key_file : %s\") % key_file)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_80c13683","line":281,"in_reply_to":"5f2577a7_7a5b9b53","updated":"2017-09-13 22:24:21.000000000","message":"OK.","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"2e63ddb12a023038ea615ccabc0611888fb32a00","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if cert_file and not os.path.exists(cert_file):"},{"line_number":280,"context_line":"            raise RuntimeError("},{"line_number":281,"context_line":"                _(\"Unable to find ssl cert_file  : %s\") % cert_file)"},{"line_number":282,"context_line":"        if key_file and not os.path.exists(key_file):"},{"line_number":283,"context_line":"            raise RuntimeError("},{"line_number":284,"context_line":"                _(\"Unable to find ssl key_file : %s\") % key_file)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_7a5b9b53","line":281,"in_reply_to":"5f2577a7_fc0e6c8b","updated":"2017-09-13 21:51:31.000000000","message":"I believe the rule evaluation fails, i remember there was enough logs to figure out which evaluation failed.","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"ff124ba5ce624438a6db8bd056987f0925f880be","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        elif (enforcer.conf.oslo_policy.remote_content_type \u003d\u003d"},{"line_number":255,"context_line":"                \u0027application/json\u0027):"},{"line_number":256,"context_line":"            json \u003d {\u0027target\u0027: temp_target, \u0027credentials\u0027: creds}"},{"line_number":257,"context_line":"        else:"},{"line_number":258,"context_line":"            raise RuntimeError(_(\"content type %s is not supported\") %"},{"line_number":259,"context_line":"                               enforcer.conf.oslo_policy.remote_content_type)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        with contextlib.closing(requests.post(url, json\u003djson, data\u003ddata)) as r:"},{"line_number":262,"context_line":"            return r.text.lstrip(\u0027\"\u0027).rstrip(\u0027\"\u0027) \u003d\u003d \u0027True\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_c2be4a64","line":259,"range":{"start_line":257,"start_character":0,"end_line":259,"end_character":77},"updated":"2017-09-25 14:41:52.000000000","message":"Use parameter choices and remove this check ?","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"ff124ba5ce624438a6db8bd056987f0925f880be","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        elif (enforcer.conf.oslo_policy.remote_content_type \u003d\u003d"},{"line_number":318,"context_line":"                \u0027application/json\u0027):"},{"line_number":319,"context_line":"            json \u003d {\u0027target\u0027: temp_target, \u0027credentials\u0027: creds}"},{"line_number":320,"context_line":"        else:"},{"line_number":321,"context_line":"            raise RuntimeError(_(\"content type %s is not supported\") %"},{"line_number":322,"context_line":"                               enforcer.conf.oslo_policy.remote_content_type)"},{"line_number":323,"context_line":"        with contextlib.closing("},{"line_number":324,"context_line":"                requests.post(url, json\u003djson,"},{"line_number":325,"context_line":"                              data\u003ddata, cert\u003dcert,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_e2a6e653","line":322,"range":{"start_line":320,"start_character":0,"end_line":322,"end_character":77},"updated":"2017-09-25 14:41:52.000000000","message":"ditto","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"}],"oslo_policy/fixture.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"5570f4570e760db2f1f17054afbf036cbf55f2b9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"               implies that the policy check failed"},{"line_number":53,"context_line":"        :type return_value: boolean"},{"line_number":54,"context_line":"        \"\"\""},{"line_number":55,"context_line":"        super(HttpCheckFixture, self).__init__("},{"line_number":56,"context_line":"            oslo_policy._checks.HttpsCheck,"},{"line_number":57,"context_line":"            \u0027__call__\u0027,"},{"line_number":58,"context_line":"            return_value\u003dreturn_value"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_5f0eac3b","line":55,"updated":"2017-09-25 19:07:03.000000000","message":"See the changes to HttpCheckFixture above. We can\u0027t use Mock like this any more, because the enforcer changes in https://review.openstack.org/#/c/498467 won\u0027t handle mock objects properly and I don\u0027t want to teach production code about Mocks. The code above mocks just the __call__ method instead of the whole class.","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"9b519761f90d3c659385dec743468a90b9a97def","unresolved":false,"context_lines":[{"line_number":52,"context_line":"               implies that the policy check failed"},{"line_number":53,"context_line":"        :type return_value: boolean"},{"line_number":54,"context_line":"        \"\"\""},{"line_number":55,"context_line":"        super(HttpCheckFixture, self).__init__("},{"line_number":56,"context_line":"            oslo_policy._checks.HttpsCheck,"},{"line_number":57,"context_line":"            \u0027__call__\u0027,"},{"line_number":58,"context_line":"            return_value\u003dreturn_value"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_faeb26d9","line":55,"in_reply_to":"7f515b1d_5f0eac3b","updated":"2017-09-25 19:26:07.000000000","message":"Done","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"}],"oslo_policy/opts.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ce1134738a459de5545d128d8b32fba68ba4865f","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    cfg.StrOpt(\u0027remote_content_type\u0027,"},{"line_number":48,"context_line":"               default\u003d\u0027application/x-www-form-urlencoded\u0027,"},{"line_number":49,"context_line":"               help\u003d_(\"Content Type to send and receive data for \""},{"line_number":50,"context_line":"                      \"REST based policy check\")),"},{"line_number":51,"context_line":"    cfg.BoolOpt(\u0027remote_ssl_verify_server_crt\u0027,"},{"line_number":52,"context_line":"                help\u003d_(\"server identity verification for REST based \""},{"line_number":53,"context_line":"                       \"policy check\"),"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_7c771c04","line":50,"updated":"2017-09-13 19:45:39.000000000","message":"This patch seems to be doing 2 things. Is the content type option needed to make the client certificate stuff work?","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"2e63ddb12a023038ea615ccabc0611888fb32a00","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    cfg.StrOpt(\u0027remote_content_type\u0027,"},{"line_number":48,"context_line":"               default\u003d\u0027application/x-www-form-urlencoded\u0027,"},{"line_number":49,"context_line":"               help\u003d_(\"Content Type to send and receive data for \""},{"line_number":50,"context_line":"                      \"REST based policy check\")),"},{"line_number":51,"context_line":"    cfg.BoolOpt(\u0027remote_ssl_verify_server_crt\u0027,"},{"line_number":52,"context_line":"                help\u003d_(\"server identity verification for REST based \""},{"line_number":53,"context_line":"                       \"policy check\"),"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_7ad6fbc5","line":50,"in_reply_to":"5f2577a7_7c771c04","updated":"2017-09-13 21:51:31.000000000","message":"No, technically remote_content_type is not needed for the client certificate to work, but i ended up testing with both ssl and json against a hand written endpoint, so just used the same review for both.\n\nhttps://gist.github.com/dims/fb1cfe6b8fd8e9fed87b6cf35aec189b","commit_id":"1f0ec99b4eb2bd3b1af3ff4d826f14b2ead178d1"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"ff124ba5ce624438a6db8bd056987f0925f880be","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                    deprecated_group\u003d\u0027DEFAULT\u0027),"},{"line_number":47,"context_line":"    cfg.StrOpt(\u0027remote_content_type\u0027,"},{"line_number":48,"context_line":"               default\u003d\u0027application/x-www-form-urlencoded\u0027,"},{"line_number":49,"context_line":"               help\u003d_(\"Content Type to send and receive data for \""},{"line_number":50,"context_line":"                      \"REST based policy check\")),"},{"line_number":51,"context_line":"    cfg.BoolOpt(\u0027remote_ssl_verify_server_crt\u0027,"},{"line_number":52,"context_line":"                help\u003d_(\"server identity verification for REST based \""},{"line_number":53,"context_line":"                       \"policy check\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_825cd27e","line":50,"range":{"start_line":49,"start_character":0,"end_line":50,"end_character":50},"updated":"2017-09-25 14:41:52.000000000","message":"use choices \u003d (\u0027application/x-www-form-urlencoded\u0027, \u0027application/json\u0027) ?","commit_id":"ada4c21623f1a7c85579595af6655624d8d4a36e"}]}
