)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":29100,"name":"Jason Anderson","email":"jasonanderson@uchicago.edu","username":"jasonanderson"},"change_message_id":"23b4faa0a151e06f3fa91054a10f313532109ab5","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"08bb636c_03bd6981","updated":"2022-02-24 16:09:03.000000000","message":"I am pretty sure we\u0027ve had some bugs in this filter, which we have fixed in our fork. Either Mark or I needs to ensure the latest version of this is reflected in this patchset.","commit_id":"921ccad2c7dedb6539276fbecc91b465e3392357"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"47d55ecf0aab92962c5a5c87538b97e69cedabd2","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"2db1ae16_53f488ee","in_reply_to":"08bb636c_03bd6981","updated":"2022-08-02 08:25:56.000000000","message":"Hi! Any progress with this? 😊","commit_id":"921ccad2c7dedb6539276fbecc91b465e3392357"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"628a3f4e3afd494920e940d547a27ab2f0c465ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"20a19d6e_a2fdb459","in_reply_to":"2db1ae16_53f488ee","updated":"2022-08-26 15:37:52.000000000","message":"Reviewed and updated.","commit_id":"921ccad2c7dedb6539276fbecc91b465e3392357"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"88202945_36ff9d3a","updated":"2022-08-31 10:28:07.000000000","message":"-1 from me. I hoped it would wait till Thursday before merging but Pierre was too fast. 😄","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"3382d0e01df76e842ed4f8050e1cd49cdff3f51c","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"8ff09399_098e4e46","updated":"2022-08-31 10:29:37.000000000","message":"Also, forgot to mention, this lacks testing, even basic unit tests. 😞","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"}],"blazar/enforcement/filters/external_service_filter.py":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"59b83730204162c28f4245f46d9e28b281869b7f","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        if self.external_service_token:"},{"line_number":73,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d (self.external_service_token)"},{"line_number":74,"context_line":"        else:"},{"line_number":75,"context_line":"            auth_url \u003d \"%s://%s:%s/%s\" % (self.conf.os_auth_protocol,"},{"line_number":76,"context_line":"                                          base.get_os_auth_host(self.conf),"},{"line_number":77,"context_line":"                                          self.conf.os_auth_port,"},{"line_number":78,"context_line":"                                          self.conf.os_auth_prefix)"},{"line_number":79,"context_line":"            client \u003d BlazarKeystoneClient("},{"line_number":80,"context_line":"                password\u003dself.conf.os_admin_password,"},{"line_number":81,"context_line":"                auth_url\u003dauth_url,"},{"line_number":82,"context_line":"                ctx\u003dcontext.admin())"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d client.auth_token"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        return headers"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"673f859c_3aea5384","line":84,"range":{"start_line":75,"start_character":0,"end_line":84,"end_character":55},"updated":"2021-03-19 21:48:07.000000000","message":"This doesn\u0027t work at the moment: it depends on change https://review.opendev.org/c/openstack/blazar/+/731586","commit_id":"be62fd4a22636117d4149b85e7604cfdb2fff538"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d272f7eea3e85377d3fe6b1c2dbf4d1b1b35aa33","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if self.external_service_token:"},{"line_number":73,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d (self.external_service_token)"},{"line_number":74,"context_line":"        else:"},{"line_number":75,"context_line":"            auth_url \u003d \"%s://%s:%s/%s\" % (self.conf.os_auth_protocol,"},{"line_number":76,"context_line":"                                          base.get_os_auth_host(self.conf),"},{"line_number":77,"context_line":"                                          self.conf.os_auth_port,"},{"line_number":78,"context_line":"                                          self.conf.os_auth_prefix)"},{"line_number":79,"context_line":"            client \u003d BlazarKeystoneClient("},{"line_number":80,"context_line":"                password\u003dself.conf.os_admin_password,"},{"line_number":81,"context_line":"                auth_url\u003dauth_url,"},{"line_number":82,"context_line":"                ctx\u003dcontext.admin())"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d client.auth_token"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        return headers"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"4aa58e33_d53568c9","line":84,"range":{"start_line":75,"start_character":0,"end_line":84,"end_character":55},"in_reply_to":"673f859c_3aea5384","updated":"2022-08-26 14:57:54.000000000","message":"This change was merged.","commit_id":"be62fd4a22636117d4149b85e7604cfdb2fff538"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"8e9134f2dfe077a7eab9bb5bc5d819017c610772","unresolved":true,"context_lines":[{"line_number":53,"context_line":"        cfg.StrOpt("},{"line_number":54,"context_line":"            \u0027external_service_endpoint\u0027,"},{"line_number":55,"context_line":"            default\u003dNone,"},{"line_number":56,"context_line":"            help\u003d\u0027The url of the external service API. A value of -1 will \u0027"},{"line_number":57,"context_line":"                 \u0027disabled the service.\u0027),"},{"line_number":58,"context_line":"        cfg.StrOpt("},{"line_number":59,"context_line":"            \u0027external_service_check_create\u0027,"},{"line_number":60,"context_line":"            default\u003dNone,"}],"source_content_type":"text/x-python","patch_set":5,"id":"6a6216a2_4db0ebde","line":57,"range":{"start_line":56,"start_character":55,"end_line":57,"end_character":39},"updated":"2022-08-26 14:59:01.000000000","message":"This isn\u0027t true in the code. And a value of -1 is odd for a string argument. But anyway, why would you want to use this? The operator can disable the filter.","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"628a3f4e3afd494920e940d547a27ab2f0c465ed","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        cfg.StrOpt("},{"line_number":54,"context_line":"            \u0027external_service_endpoint\u0027,"},{"line_number":55,"context_line":"            default\u003dNone,"},{"line_number":56,"context_line":"            help\u003d\u0027The url of the external service API. A value of -1 will \u0027"},{"line_number":57,"context_line":"                 \u0027disabled the service.\u0027),"},{"line_number":58,"context_line":"        cfg.StrOpt("},{"line_number":59,"context_line":"            \u0027external_service_check_create\u0027,"},{"line_number":60,"context_line":"            default\u003dNone,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9c515611_6ac77c56","line":57,"range":{"start_line":56,"start_character":55,"end_line":57,"end_character":39},"in_reply_to":"6a6216a2_4db0ebde","updated":"2022-08-26 15:37:52.000000000","message":"Done","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"6f53c662963343255da282cdd3cfb39639beebbb","unresolved":true,"context_lines":[{"line_number":70,"context_line":"        cfg.StrOpt("},{"line_number":71,"context_line":"            \u0027external_service_token\u0027,"},{"line_number":72,"context_line":"            default\u003d\"\","},{"line_number":73,"context_line":"            help\u003d\u0027Authentication token for token based authentication.\u0027)"},{"line_number":74,"context_line":"    ]"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def __init__(self, conf\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"4f9a77f9_6abd4c85","line":73,"range":{"start_line":73,"start_character":18,"end_line":73,"end_character":69},"updated":"2022-08-26 15:34:31.000000000","message":"A bit redundant 😊","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"628a3f4e3afd494920e940d547a27ab2f0c465ed","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        cfg.StrOpt("},{"line_number":71,"context_line":"            \u0027external_service_token\u0027,"},{"line_number":72,"context_line":"            default\u003d\"\","},{"line_number":73,"context_line":"            help\u003d\u0027Authentication token for token based authentication.\u0027)"},{"line_number":74,"context_line":"    ]"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def __init__(self, conf\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fda2187f_ee43ce42","line":73,"range":{"start_line":73,"start_character":18,"end_line":73,"end_character":69},"in_reply_to":"4f9a77f9_6abd4c85","updated":"2022-08-26 15:37:52.000000000","message":"Done","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"6f53c662963343255da282cdd3cfb39639beebbb","unresolved":true,"context_lines":[{"line_number":105,"context_line":"            return True"},{"line_number":106,"context_line":"        elif req.status_code \u003d\u003d 403:"},{"line_number":107,"context_line":"            raise ExternalServiceFilterException("},{"line_number":108,"context_line":"                message\u003dreq.json().get(\u0027message\u0027))"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            raise ExternalServiceUnsupportedHTTPResponse("},{"line_number":111,"context_line":"                status\u003dreq.status_code)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ee267625_d24c189a","line":108,"range":{"start_line":108,"start_character":16,"end_line":108,"end_character":48},"updated":"2022-08-26 15:34:31.000000000","message":"This can easily break if the response is not valid. I will propose a change that logs the issue.","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"628a3f4e3afd494920e940d547a27ab2f0c465ed","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            return True"},{"line_number":106,"context_line":"        elif req.status_code \u003d\u003d 403:"},{"line_number":107,"context_line":"            raise ExternalServiceFilterException("},{"line_number":108,"context_line":"                message\u003dreq.json().get(\u0027message\u0027))"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            raise ExternalServiceUnsupportedHTTPResponse("},{"line_number":111,"context_line":"                status\u003dreq.status_code)"}],"source_content_type":"text/x-python","patch_set":5,"id":"226c9de0_519ab6a8","line":108,"range":{"start_line":108,"start_character":16,"end_line":108,"end_character":48},"in_reply_to":"ee267625_d24c189a","updated":"2022-08-26 15:37:52.000000000","message":"Done","commit_id":"e7d56976ee62d7d8ae56cc76f3faa959b8d208f6"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":45,"context_line":"class ExternalServiceUnsupportedDeniedResponse(exceptions.BlazarException):"},{"line_number":46,"context_line":"    code \u003d 400"},{"line_number":47,"context_line":"    msg_fmt \u003d _(\u0027External service enforcement filter returned a 403 HTTP \u0027"},{"line_number":48,"context_line":"                \u0027response %(response)s without a valid JSON dictionary \u0027"},{"line_number":49,"context_line":"                \u0027containing a \"message\" key.\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"62cea82f_5b8acfb2","line":48,"range":{"start_line":48,"start_character":26,"end_line":48,"end_character":39},"updated":"2022-08-31 10:28:07.000000000","message":"As we have no idea why that is, we should not transport the response to the client as it may have leaked something that should not have been leaked.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":true,"context_lines":[{"line_number":45,"context_line":"class ExternalServiceUnsupportedDeniedResponse(exceptions.BlazarException):"},{"line_number":46,"context_line":"    code \u003d 400"},{"line_number":47,"context_line":"    msg_fmt \u003d _(\u0027External service enforcement filter returned a 403 HTTP \u0027"},{"line_number":48,"context_line":"                \u0027response %(response)s without a valid JSON dictionary \u0027"},{"line_number":49,"context_line":"                \u0027containing a \"message\" key.\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"8459c6ad_848d1b92","line":48,"range":{"start_line":48,"start_character":26,"end_line":48,"end_character":39},"in_reply_to":"62cea82f_5b8acfb2","updated":"2022-09-14 16:55:00.000000000","message":"Actually this was not exposed to end users. See my comment on your patch.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"cf700394f76fc98708091b299191632ffe95dc81","unresolved":false,"context_lines":[{"line_number":45,"context_line":"class ExternalServiceUnsupportedDeniedResponse(exceptions.BlazarException):"},{"line_number":46,"context_line":"    code \u003d 400"},{"line_number":47,"context_line":"    msg_fmt \u003d _(\u0027External service enforcement filter returned a 403 HTTP \u0027"},{"line_number":48,"context_line":"                \u0027response %(response)s without a valid JSON dictionary \u0027"},{"line_number":49,"context_line":"                \u0027containing a \"message\" key.\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1be80a02_b9dbd50b","line":48,"range":{"start_line":48,"start_character":26,"end_line":48,"end_character":39},"in_reply_to":"8459c6ad_848d1b92","updated":"2022-09-15 09:39:31.000000000","message":"True that. In fact, nothing was.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":62,"context_line":"            default\u003dNone,"},{"line_number":63,"context_line":"            help\u003d\u0027The URL of the external service API.\u0027),"},{"line_number":64,"context_line":"        cfg.StrOpt("},{"line_number":65,"context_line":"            \u0027external_service_check_create\u0027,"},{"line_number":66,"context_line":"            default\u003dNone,"},{"line_number":67,"context_line":"            help\u003d\u0027Overwrite check-create endpoint with absolute URL.\u0027),"},{"line_number":68,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"37f2dd79_e6a023c8","line":65,"range":{"start_line":65,"start_character":13,"end_line":65,"end_character":42},"updated":"2022-08-31 10:28:07.000000000","message":"I miss _endpoint in these names","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            default\u003dNone,"},{"line_number":63,"context_line":"            help\u003d\u0027The URL of the external service API.\u0027),"},{"line_number":64,"context_line":"        cfg.StrOpt("},{"line_number":65,"context_line":"            \u0027external_service_check_create\u0027,"},{"line_number":66,"context_line":"            default\u003dNone,"},{"line_number":67,"context_line":"            help\u003d\u0027Overwrite check-create endpoint with absolute URL.\u0027),"},{"line_number":68,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"2705042d_000a13a6","line":65,"range":{"start_line":65,"start_character":13,"end_line":65,"end_character":42},"in_reply_to":"37f2dd79_e6a023c8","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":66,"context_line":"            default\u003dNone,"},{"line_number":67,"context_line":"            help\u003d\u0027Overwrite check-create endpoint with absolute URL.\u0027),"},{"line_number":68,"context_line":"        cfg.StrOpt("},{"line_number":69,"context_line":"            \u0027external_service_check_update\u0027,"},{"line_number":70,"context_line":"            default\u003dNone,"},{"line_number":71,"context_line":"            help\u003d\u0027Overwrite check-update endpoint with absolute URL.\u0027),"},{"line_number":72,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"db645aad_5ba81714","line":69,"range":{"start_line":69,"start_character":13,"end_line":69,"end_character":42},"updated":"2022-08-31 10:28:07.000000000","message":"ditto","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            default\u003dNone,"},{"line_number":67,"context_line":"            help\u003d\u0027Overwrite check-create endpoint with absolute URL.\u0027),"},{"line_number":68,"context_line":"        cfg.StrOpt("},{"line_number":69,"context_line":"            \u0027external_service_check_update\u0027,"},{"line_number":70,"context_line":"            default\u003dNone,"},{"line_number":71,"context_line":"            help\u003d\u0027Overwrite check-update endpoint with absolute URL.\u0027),"},{"line_number":72,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"94a59545_b7f7785c","line":69,"range":{"start_line":69,"start_character":13,"end_line":69,"end_character":42},"in_reply_to":"db645aad_5ba81714","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":70,"context_line":"            default\u003dNone,"},{"line_number":71,"context_line":"            help\u003d\u0027Overwrite check-update endpoint with absolute URL.\u0027),"},{"line_number":72,"context_line":"        cfg.StrOpt("},{"line_number":73,"context_line":"            \u0027external_service_on_end\u0027,"},{"line_number":74,"context_line":"            default\u003dNone,"},{"line_number":75,"context_line":"            help\u003d\u0027Overwrite on-end endpoint with absolute URL.\u0027),"},{"line_number":76,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"402ad72c_14674ee7","line":73,"range":{"start_line":73,"start_character":13,"end_line":73,"end_character":36},"updated":"2022-08-31 10:28:07.000000000","message":"idtto","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            default\u003dNone,"},{"line_number":71,"context_line":"            help\u003d\u0027Overwrite check-update endpoint with absolute URL.\u0027),"},{"line_number":72,"context_line":"        cfg.StrOpt("},{"line_number":73,"context_line":"            \u0027external_service_on_end\u0027,"},{"line_number":74,"context_line":"            default\u003dNone,"},{"line_number":75,"context_line":"            help\u003d\u0027Overwrite on-end endpoint with absolute URL.\u0027),"},{"line_number":76,"context_line":"        cfg.StrOpt("}],"source_content_type":"text/x-python","patch_set":9,"id":"a34a3211_018d227e","line":73,"range":{"start_line":73,"start_character":13,"end_line":73,"end_character":36},"in_reply_to":"402ad72c_14674ee7","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":80,"context_line":"    ]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":83,"context_line":"        super(ExternalServiceFilter, self).__init__(conf\u003dconf)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_headers(self):"},{"line_number":86,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":9,"id":"c728624c_4a529933","line":83,"updated":"2022-08-31 10:28:07.000000000","message":"Could use validation of external_service_endpoint here. If it\u0027s not defined or malformed, the service should bail out early.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    ]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":83,"context_line":"        super(ExternalServiceFilter, self).__init__(conf\u003dconf)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_headers(self):"},{"line_number":86,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":9,"id":"e47c40fa_c4aaabe5","line":83,"in_reply_to":"c728624c_4a529933","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":82,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":83,"context_line":"        super(ExternalServiceFilter, self).__init__(conf\u003dconf)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_headers(self):"},{"line_number":86,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if self.external_service_token:"}],"source_content_type":"text/x-python","patch_set":9,"id":"a9410ee2_d35aa4e3","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":19},"updated":"2022-08-31 10:28:07.000000000","message":"This should be a private method.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":83,"context_line":"        super(ExternalServiceFilter, self).__init__(conf\u003dconf)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_headers(self):"},{"line_number":86,"context_line":"        headers \u003d {\u0027Content-Type\u0027: \u0027application/json\u0027}"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if self.external_service_token:"}],"source_content_type":"text/x-python","patch_set":9,"id":"915e7b40_3e4d5985","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":19},"in_reply_to":"a9410ee2_d35aa4e3","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if self.external_service_token:"},{"line_number":89,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d (self.external_service_token)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            client \u003d BlazarKeystoneClient()"},{"line_number":92,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d client.session.get_token()"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return headers"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5db1c317_c77d4520","line":92,"range":{"start_line":90,"start_character":8,"end_line":92,"end_character":64},"updated":"2022-08-31 10:28:07.000000000","message":"I think this is neither expected nor secure to do. Does not it present the external service with an all-OpenStack-deployment admin token?","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if self.external_service_token:"},{"line_number":89,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d (self.external_service_token)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            client \u003d BlazarKeystoneClient()"},{"line_number":92,"context_line":"            headers[\u0027X-Auth-Token\u0027] \u003d client.session.get_token()"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return headers"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"42ac4ce8_231482f2","line":92,"range":{"start_line":90,"start_character":8,"end_line":92,"end_character":64},"in_reply_to":"5db1c317_c77d4520","updated":"2022-09-14 16:55:00.000000000","message":"I understand your point, thanks.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        return url"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def post(self, url, body):"},{"line_number":107,"context_line":"        body \u003d json.dumps(body, cls\u003dDateTimeEncoder)"},{"line_number":108,"context_line":"        req \u003d requests.post(url, headers\u003dself.get_headers(), data\u003dbody)"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"6a54180c_2fd88f51","line":106,"updated":"2022-08-31 10:28:07.000000000","message":"This should be a private method.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        return url"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def post(self, url, body):"},{"line_number":107,"context_line":"        body \u003d json.dumps(body, cls\u003dDateTimeEncoder)"},{"line_number":108,"context_line":"        req \u003d requests.post(url, headers\u003dself.get_headers(), data\u003dbody)"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"66aca4d2_d7bb1594","line":106,"in_reply_to":"6a54180c_2fd88f51","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":127,"context_line":"            self.post(self.external_service_check_create, body)"},{"line_number":128,"context_line":"            return"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"4fc9b6ce_9137b471","line":130,"range":{"start_line":130,"start_character":8,"end_line":130,"end_character":42},"updated":"2022-08-31 10:28:07.000000000","message":"This should not be conditional, the filter has to be configured properly to make sense enabling it (see also the comment above about validation).","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            self.post(self.external_service_check_create, body)"},{"line_number":128,"context_line":"            return"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"b1054a1e_e87856f4","line":130,"range":{"start_line":130,"start_character":8,"end_line":130,"end_character":42},"in_reply_to":"4fc9b6ce_9137b471","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def check_update(self, context, current_lease_values, new_lease_values):"}],"source_content_type":"text/x-python","patch_set":9,"id":"8699d1b5_2601ed34","line":132,"range":{"start_line":132,"start_character":22,"end_line":132,"end_character":44},"updated":"2022-08-31 10:28:07.000000000","message":"This is done each time with self.post so it should actually live in self.post. Ideally, the init already seeds (while validating) a mapping between actions and the desired URLs and thus we avoid code duplication and other headaches.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def check_update(self, context, current_lease_values, new_lease_values):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fcf4874_bd8ec774","line":132,"range":{"start_line":132,"start_character":22,"end_line":132,"end_character":44},"in_reply_to":"8699d1b5_2601ed34","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def check_update(self, context, current_lease_values, new_lease_values):"},{"line_number":136,"context_line":"        body \u003d dict(context\u003dcontext, current_lease\u003dcurrent_lease_values,"}],"source_content_type":"text/x-python","patch_set":9,"id":"dbdca8fc_12610b3c","line":133,"range":{"start_line":133,"start_character":12,"end_line":133,"end_character":18},"updated":"2022-08-31 10:28:07.000000000","message":"Non-pythonic to return if it returns anyway.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        if self.external_service_endpoint:"},{"line_number":131,"context_line":"            path \u003d \u0027/check-create\u0027"},{"line_number":132,"context_line":"            self.post(self._get_absolute_url(path), body)"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def check_update(self, context, current_lease_values, new_lease_values):"},{"line_number":136,"context_line":"        body \u003d dict(context\u003dcontext, current_lease\u003dcurrent_lease_values,"}],"source_content_type":"text/x-python","patch_set":9,"id":"51f0a0de_d8eec9a4","line":133,"range":{"start_line":133,"start_character":12,"end_line":133,"end_character":18},"in_reply_to":"dbdca8fc_12610b3c","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3a39435a_23cd2db9","line":157,"updated":"2022-08-31 10:28:07.000000000","message":"ditto of check_create comments for the other two","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"88de8c3efdba1d88c01438815c7050893f8221bd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"a7dbd451_af484254","line":157,"in_reply_to":"3a39435a_23cd2db9","updated":"2022-09-14 16:55:00.000000000","message":"Done","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"}],"doc/source/admin/usage-enforcement.rst":[{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":27,"context_line":"``MaxLeaseDurationFilter`` is a good example to follow. Filters are enabled in"},{"line_number":28,"context_line":"``blazar.conf`` under the ``[enforcement]`` group. For example, enabling the"},{"line_number":29,"context_line":"``MaxLeaseDurationFilter`` to limit lease durations to only one day would work"},{"line_number":30,"context_line":"as follows:"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":".. sourcecode:: console"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"d0b510ca_ca7c2c15","line":30,"updated":"2022-08-31 10:28:07.000000000","message":"Could use adding that, while all the enforcement settings share a common group, they have names that start with the name of the filter converted to snake_case.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":55,"context_line":"---------------------"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"This filter delegates the decision for each API to an external HTTP service."},{"line_number":58,"context_line":"The service must use token-based authentication and implement the following"},{"line_number":59,"context_line":"endpoints for POST method:"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"* ``POST /v1/check-create``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"63cc63dc_f9cc9e59","line":58,"range":{"start_line":58,"start_character":21,"end_line":58,"end_character":47},"updated":"2022-08-31 10:28:07.000000000","message":"This is too general, need to say that it specifically sends \u0027X-Auth-Token\u0027.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":63,"context_line":"* ``POST /v1/on-end``"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"The external service should return ``204 No Content`` if the parameters meet"},{"line_number":66,"context_line":"defined criteria and ``403 Forbidden`` if not."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Example format of data the external service will receive in a request body:"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"68cd0069_3d49fa53","line":66,"range":{"start_line":66,"start_character":21,"end_line":66,"end_character":45},"updated":"2022-08-31 10:28:07.000000000","message":"It should say that then some content is actually expected.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":65,"context_line":"The external service should return ``204 No Content`` if the parameters meet"},{"line_number":66,"context_line":"defined criteria and ``403 Forbidden`` if not."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Example format of data the external service will receive in a request body:"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"* Request example:"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"d73be6f1_a5a80369","line":68,"range":{"start_line":68,"start_character":0,"end_line":68,"end_character":14},"updated":"2022-08-31 10:28:07.000000000","message":"Any guarantees on the actual protocol?","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"},{"author":{"_account_id":30491,"name":"Radosław Piliszek","display_name":"Radek","email":"radek@piliszek.it","username":"yoctozepto","status":"self-employed techologist, collaborating mostly with 7bulls.com"},"change_message_id":"6ebfa7eaac4ab1bb5d91b2bb2b953881a71c10b3","unresolved":true,"context_lines":[{"line_number":79,"context_line":"       \"region_name\": \"RegionOne\""},{"line_number":80,"context_line":"     },"},{"line_number":81,"context_line":"     \"current_lease\": {"},{"line_number":82,"context_line":"       \"start_date\": \"2020-05-13 00:00\","},{"line_number":83,"context_line":"       \"end_time\": \"2020-05-14 23:59\","},{"line_number":84,"context_line":"       \"reservations\": ["},{"line_number":85,"context_line":"         {"}],"source_content_type":"text/x-rst","patch_set":9,"id":"d80250b4_45f3264d","line":82,"range":{"start_line":82,"start_character":22,"end_line":82,"end_character":38},"updated":"2022-08-31 10:28:07.000000000","message":"It is weird not to have ISO8601 time in JSON.","commit_id":"22e99c182722244ef886f96caaaffb5204e43473"}]}
