mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
Addressed PR issues
This commit is contained in:
parent
d76db6d047
commit
e2f93f64a9
@ -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 {
|
||||
|
@ -22,7 +22,9 @@ class JiraCertificateRequestStorage(val delegate: CertificationRequestStorage,
|
||||
Approved, Rejected
|
||||
}
|
||||
|
||||
private val logger = loggerFor<JiraCertificateRequestStorage>()
|
||||
companion object{
|
||||
private val logger = loggerFor<JiraCertificateRequestStorage>()
|
||||
}
|
||||
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user