diff --git a/doorman/src/main/kotlin/com/r3/corda/doorman/Main.kt b/doorman/src/main/kotlin/com/r3/corda/doorman/Main.kt index 5b5a837490..a33f924131 100644 --- a/doorman/src/main/kotlin/com/r3/corda/doorman/Main.kt +++ b/doorman/src/main/kotlin/com/r3/corda/doorman/Main.kt @@ -168,6 +168,7 @@ private fun DoormanParameters.startDoorman() { logger.warn("Doorman server is in 'Approve All' mode, this will approve all incoming certificate signing request.") // Approve all pending request. object : CertificationRequestStorage by DBCertificateRequestStorage(database) { + // The doorman is in approve all mode, returns all pending request id as approved request id. override fun getApprovedRequestIds() = getPendingRequestIds() } } else { diff --git a/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt b/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt index d79c7c7f92..4d3ee9c511 100644 --- a/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt +++ b/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt @@ -22,7 +22,9 @@ class JiraCertificateRequestStorage(val delegate: CertificationRequestStorage, Approved, Rejected } - private val logger = loggerFor() + companion object{ + private val logger = loggerFor() + } // The JIRA project must have a Request ID field and the Task issue type. private val requestIdField: Field = jiraClient.metadataClient.fields.claim().find { it.name == "Request ID" }!! @@ -34,9 +36,7 @@ class JiraCertificateRequestStorage(val delegate: CertificationRequestStorage, val response = getResponse(requestId) if (response !is CertificateResponse.Unauthorised) { val request = StringWriter() - JcaPEMWriter(request).use { - it.writeObject(PemObject("CERTIFICATE REQUEST", certificationData.request.encoded)) - } + JcaPEMWriter(request).writeObject(PemObject("CERTIFICATE REQUEST", certificationData.request.encoded)) val commonName = certificationData.request.subject.commonName val email = certificationData.request.subject.getRDNs(BCStyle.EmailAddress).firstOrNull()?.first?.value val nearestCity = certificationData.request.subject.getRDNs(BCStyle.L).firstOrNull()?.first?.value @@ -46,7 +46,7 @@ class JiraCertificateRequestStorage(val delegate: CertificationRequestStorage, .setDescription("Legal Name: $commonName\nNearest City: $nearestCity\nEmail: $email\n\n{code}$request{code}") .setSummary(commonName) .setFieldValue(requestIdField.id, requestId) - // This will block until the jira is created. + // This will block until the issue is created. jiraClient.issueClient.createIssue(issue.build()).fail { logger.error("Exception when creating JIRA issue.", it) }.claim() } return requestId