)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11561,"name":"Dave McCowan","email":"dmccowan@cisco.com","username":"dave-mccowan"},"change_message_id":"6d2bdfcc8758016a3803cf596a41749bc1956ff9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-09-28 23:55:19 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add subca functionality to the dogtag plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I1766cb4a2069ea56d386067c9aa2811a50410a9d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_836c2a36","line":8,"updated":"2015-09-29 14:34:32.000000000","message":"Add some more info here, also the tag:\n\nPartially-implements: blueprint add-cas","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-09-28 23:55:19 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add subca functionality to the dogtag plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I1766cb4a2069ea56d386067c9aa2811a50410a9d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_4a192dd6","line":8,"in_reply_to":"9a1a9d01_836c2a36","updated":"2015-09-30 03:15:04.000000000","message":"will do","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"}],"barbican/plugin/dogtag.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":683,"context_line":"                self._expiration \u003d datetime.datetime.strptime("},{"line_number":684,"context_line":"                    expiration_fh.read(),"},{"line_number":685,"context_line":"                    \"%Y-%m-%d %H:%M:%S.%f\""},{"line_number":686,"context_line":"                )"},{"line_number":687,"context_line":"        return self._expiration"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"    @expiration.setter"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_da50d4d6","line":686,"updated":"2015-09-29 07:09:27.000000000","message":"should the case be considered if the users gives a path to a file that doesn\u0027t contain a valid date? Meaning, that this would fail.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":683,"context_line":"                self._expiration \u003d datetime.datetime.strptime("},{"line_number":684,"context_line":"                    expiration_fh.read(),"},{"line_number":685,"context_line":"                    \"%Y-%m-%d %H:%M:%S.%f\""},{"line_number":686,"context_line":"                )"},{"line_number":687,"context_line":"        return self._expiration"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"    @expiration.setter"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4d4ce2c7","line":686,"in_reply_to":"9a1a9d01_da50d4d6","updated":"2015-09-30 03:15:04.000000000","message":"Thats a good point.  To be honest, I\u0027d prefer that the user not provide a path to this file at all, because this is something that should be written by the plugin itself as a working file.\n\nI\u0027m going to make the following change -- The config will define a working directory in which I will specify the host_aid path and expiration_time paths statically.  That way, its less likely that the ueer will fat finger the path.\n\nAnd yeah, I\u0027ll handle the case where an invalid entry is read - and return now()","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                host_aid_fh.write(val)"},{"line_number":707,"context_line":"        self._host_aid \u003d val"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"    def _check_subcas(self, connection):"},{"line_number":710,"context_line":"        \"\"\"Check if subca feature is available"},{"line_number":711,"context_line":""},{"line_number":712,"context_line":"        SubCA creation must be supported in both the Dogtag client as well"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_daec54f5","line":709,"updated":"2015-09-29 07:09:27.000000000","message":"Initially I got a bit confused thinking this function should return any subCAs returned by the server. It would be clearer if you use a more precise name such as is_subcas_feature_enabled, or something of the sort.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                host_aid_fh.write(val)"},{"line_number":707,"context_line":"        self._host_aid \u003d val"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"    def _check_subcas(self, connection):"},{"line_number":710,"context_line":"        \"\"\"Check if subca feature is available"},{"line_number":711,"context_line":""},{"line_number":712,"context_line":"        SubCA creation must be supported in both the Dogtag client as well"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_8d98bac1","line":709,"in_reply_to":"9a1a9d01_daec54f5","updated":"2015-09-30 03:15:04.000000000","message":"ok - will change name","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":726,"context_line":"            except (request_exceptions.HTTPError,"},{"line_number":727,"context_line":"                    pki.ResourceNotFoundException):"},{"line_number":728,"context_line":"                return False"},{"line_number":729,"context_line":"        return False"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"    def _get_request_id(self, order_id, plugin_meta, operation):"},{"line_number":732,"context_line":"        request_id \u003d plugin_meta.get(self.REQUEST_ID, None)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_9af57c58","line":729,"updated":"2015-09-29 07:09:27.000000000","message":"Adding more logging here would be a good idea. If the user has problem this would be really useful to debug the issue.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":726,"context_line":"            except (request_exceptions.HTTPError,"},{"line_number":727,"context_line":"                    pki.ResourceNotFoundException):"},{"line_number":728,"context_line":"                return False"},{"line_number":729,"context_line":"        return False"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"    def _get_request_id(self, order_id, plugin_meta, operation):"},{"line_number":732,"context_line":"        request_id \u003d plugin_meta.get(self.REQUEST_ID, None)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_6d8be668","line":729,"in_reply_to":"9a1a9d01_9af57c58","updated":"2015-09-30 03:15:04.000000000","message":"Good idea.  Will add logging","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":962,"context_line":"        return self._issue_certificate_request("},{"line_number":963,"context_line":"            profile_id, updated_meta, plugin_meta, barbican_meta_dto)"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def _issue_certificate_request(self, profile_id, inputs, plugin_meta,"},{"line_number":966,"context_line":"                                   barbican_meta_dto):"},{"line_number":967,"context_line":"        \"\"\"Actually send the cert request to the Dogtag CA"},{"line_number":968,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_7a14289f","line":965,"updated":"2015-09-29 07:09:27.000000000","message":"Just to make sure. To get here, we already make sure that the plugin_ca_id belongs to the same project the user belongs to, right?","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":962,"context_line":"        return self._issue_certificate_request("},{"line_number":963,"context_line":"            profile_id, updated_meta, plugin_meta, barbican_meta_dto)"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def _issue_certificate_request(self, profile_id, inputs, plugin_meta,"},{"line_number":966,"context_line":"                                   barbican_meta_dto):"},{"line_number":967,"context_line":"        \"\"\"Actually send the cert request to the Dogtag CA"},{"line_number":968,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_addc9e73","line":965,"in_reply_to":"9a1a9d01_7a14289f","updated":"2015-09-30 03:15:04.000000000","message":"Correct - the check for this happens before this is called.  The plugin itself has no knowledge of project_ids or ownership.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":994,"context_line":"                results \u003d self.certclient.submit_enrollment_request(request)"},{"line_number":995,"context_line":"            else:"},{"line_number":996,"context_line":"                results \u003d self.certclient.submit_enrollment_request("},{"line_number":997,"context_line":"                    request, ca_id)"},{"line_number":998,"context_line":"            return self._process_pending_enrollment_results("},{"line_number":999,"context_line":"                results, plugin_meta, barbican_meta_dto)"},{"line_number":1000,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_5a8604dc","line":997,"updated":"2015-09-29 07:09:27.000000000","message":"can\u0027t you pass the ca_id if it\u0027s using the default CA?","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":994,"context_line":"                results \u003d self.certclient.submit_enrollment_request(request)"},{"line_number":995,"context_line":"            else:"},{"line_number":996,"context_line":"                results \u003d self.certclient.submit_enrollment_request("},{"line_number":997,"context_line":"                    request, ca_id)"},{"line_number":998,"context_line":"            return self._process_pending_enrollment_results("},{"line_number":999,"context_line":"                results, plugin_meta, barbican_meta_dto)"},{"line_number":1000,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4def02e9","line":997,"in_reply_to":"9a1a9d01_5a8604dc","updated":"2015-09-30 03:15:04.000000000","message":"Yes, you can.\n\nLets consider the possible cases:\n  a) client passes in no barbican ca_id.  In this case, in \n     line 980 above, ca_id is set to get_default_ca_name()\n     and we end up calling the old non-ca-id specific calls\n     in either line 984 or line 994.\n  b) client passes in barbican ca_id.  This gets translated\n     by barbican-core to \"Dogtag CA\" - which is the same as \n     get_default_ca_name(), and we end up with the same\n     behavior as case (a) above.\n\nThis is true irrespective of whether subcas are enabled or not - and will work out just fine.  The non-ca-id version of the enroll_cert/submit_enrollment_request will direct the request to the host CA - which is exactly where it needs to go.\n\nNote that when subcas are not enabled, it is critical that the non-ca-id version of this calls be invoked.\n\nThe above logic makes sure that happens no matter what.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":"        :return: True/False"},{"line_number":1191,"context_line":"        \"\"\""},{"line_number":1192,"context_line":"        return subcas_available"},{"line_number":1193,"context_line":""},{"line_number":1194,"context_line":"    def create_ca(self, ca_create_dto):"},{"line_number":1195,"context_line":"        \"\"\"Creates a subordinate CA upon request"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_1a02cc3d","line":1192,"updated":"2015-09-29 07:09:27.000000000","message":"wouldn\u0027t it be appropriate to use the _check_subcas function here? (which hopefully will be renamed)","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":"        :return: True/False"},{"line_number":1191,"context_line":"        \"\"\""},{"line_number":1192,"context_line":"        return subcas_available"},{"line_number":1193,"context_line":""},{"line_number":1194,"context_line":"    def create_ca(self, ca_create_dto):"},{"line_number":1195,"context_line":"        \"\"\"Creates a subordinate CA upon request"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_2da88e8c","line":1192,"in_reply_to":"9a1a9d01_1a02cc3d","updated":"2015-09-30 03:15:04.000000000","message":"No, the whole point of storing it in a variable -- which is determined and set on init(), is to not have to make a call back to the server on each request.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            parent_aid\u003dparent_ca_id,"},{"line_number":1216,"context_line":"            description\u003dca_create_dto.name)"},{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"        new_ca_data \u003d self.authority_client.create_ca(ca_data)"},{"line_number":1219,"context_line":""},{"line_number":1220,"context_line":"        cert \u003d self.authority_client.get_cert(new_ca_data.aid, \"PEM\")"},{"line_number":1221,"context_line":"        chain \u003d self.authority_client.get_chain(new_ca_data.aid, \"PEM\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_7abe6866","line":1218,"updated":"2015-09-29 07:09:27.000000000","message":"Is it possible this could fail in dogtag?","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":1215,"context_line":"            parent_aid\u003dparent_ca_id,"},{"line_number":1216,"context_line":"            description\u003dca_create_dto.name)"},{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"        new_ca_data \u003d self.authority_client.create_ca(ca_data)"},{"line_number":1219,"context_line":""},{"line_number":1220,"context_line":"        cert \u003d self.authority_client.get_cert(new_ca_data.aid, \"PEM\")"},{"line_number":1221,"context_line":"        chain \u003d self.authority_client.get_chain(new_ca_data.aid, \"PEM\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4d74e234","line":1218,"in_reply_to":"9a1a9d01_7abe6866","updated":"2015-09-30 03:15:04.000000000","message":"Yes indeed - Good catch.  I need to add a decorator to catch and handle the relevant exceptions, just as is done for other calls.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":11561,"name":"Dave McCowan","email":"dmccowan@cisco.com","username":"dave-mccowan"},"change_message_id":"6d2bdfcc8758016a3803cf596a41749bc1956ff9","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        return {"},{"line_number":1224,"context_line":"            cm.INFO_NAME: new_ca_data.description,"},{"line_number":1225,"context_line":"            cm.INFO_CA_SIGNING_CERT: cert,"},{"line_number":1226,"context_line":"            cm.INFO_EXPIRATION: self.expiration,"},{"line_number":1227,"context_line":"            cm.INFO_INTERMEDIATES: chain,"},{"line_number":1228,"context_line":"            cm.PLUGIN_CA_ID: new_ca_data.aid"},{"line_number":1229,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_a6961c3c","line":1226,"updated":"2015-09-29 14:34:32.000000000","message":"convert with .isoformat() before returning.  barbican wants a string here.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        return {"},{"line_number":1224,"context_line":"            cm.INFO_NAME: new_ca_data.description,"},{"line_number":1225,"context_line":"            cm.INFO_CA_SIGNING_CERT: cert,"},{"line_number":1226,"context_line":"            cm.INFO_EXPIRATION: self.expiration,"},{"line_number":1227,"context_line":"            cm.INFO_INTERMEDIATES: chain,"},{"line_number":1228,"context_line":"            cm.PLUGIN_CA_ID: new_ca_data.aid"},{"line_number":1229,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4dab8275","line":1226,"in_reply_to":"9a1a9d01_a6961c3c","updated":"2015-09-30 03:15:04.000000000","message":"yup - good catch.  I caught the invocation in get_ca_info() but forgot this one.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"1b8e9299b2d3c55ada2ac45b9a06a34c6ef45ca2","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"            return super(DogtagCAPlugin, self).get_ca_info()"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        self.expiration \u003d (datetime.datetime.utcnow() + datetime.timedelta("},{"line_number":1269,"context_line":"            days\u003dint(self._expiration_delta)))"},{"line_number":1270,"context_line":""},{"line_number":1271,"context_line":"        ret \u003d {}"},{"line_number":1272,"context_line":"        cas \u003d self.authority_client.list_cas()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_5a292436","line":1269,"updated":"2015-09-29 07:09:27.000000000","message":"I think it would be better to do the expiration calculation at any time the expiration is obtained. That way we centralize that calculation to a single place.","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"85b0e6c27a93132c2bbea4ea182eb88ada8fbb53","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"            return super(DogtagCAPlugin, self).get_ca_info()"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        self.expiration \u003d (datetime.datetime.utcnow() + datetime.timedelta("},{"line_number":1269,"context_line":"            days\u003dint(self._expiration_delta)))"},{"line_number":1270,"context_line":""},{"line_number":1271,"context_line":"        ret \u003d {}"},{"line_number":1272,"context_line":"        cas \u003d self.authority_client.list_cas()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4df06291","line":1269,"in_reply_to":"9a1a9d01_5a292436","updated":"2015-09-30 03:15:04.000000000","message":"You mean in expiration.setter.  I could put that logic in there, but I think that may be a little confusing - especially as I am setting it differently here than in the init()","commit_id":"9f2ebec0e40bfad21ae1a6691773c34e17f43731"}]}
