Backwards compat: Put the confidential-identities module back in the node classpath by default. Separating it out into a standalone "app" needs more thought and design work, if we do it at all.

This commit is contained in:
Mike Hearn 2019-02-17 12:47:38 +01:00
parent 69ba95a961
commit 1ed5fce6a6
11 changed files with 31 additions and 47 deletions

View File

@ -1,7 +1,5 @@
// Experimental Confidential Identities support for 1.0
// This contains the prototype SwapIdentitiesFlow and SwapIdentitiesHandler, which can be used
// for exchanging confidential identities as part of a flow, until a permanent solution is prepared.
// Expect this module to be removed and merged into core in a later release.
// This contains the SwapIdentitiesFlow which can be used for exchanging confidential identities as part of a flow.
// TODO: Merge this into core: the original plan was to develop it independently but in practice it's too widely used to break compatibility now, as finance uses it.
apply plugin: 'kotlin'
apply plugin: CanonicalizerPlugin
apply plugin: 'net.corda.plugins.publish-utils'
@ -27,17 +25,6 @@ dependencies {
testCompile "org.assertj:assertj-core:$assertj_version"
}
cordapp {
targetPlatformVersion corda_platform_version.toInteger()
minimumPlatformVersion 1
workflow {
name "Corda Experimental Confidential Identities"
versionId 1
vendor "R3"
licence "Open Source (Apache 2)"
}
}
jar {
baseName 'corda-confidential-identities'
}

View File

@ -124,14 +124,4 @@ private constructor(private val otherSideSession: FlowSession?,
@CordaSerializable
data class CertificateOwnershipAssertion(val x500Name: CordaX500Name, val publicKey: PublicKey)
open class SwapIdentitiesException @JvmOverloads constructor(message: String, cause: Throwable? = null) : FlowException(message, cause)
// This only exists for backwards compatibility
@InitiatedBy(SwapIdentitiesFlow::class)
private class SwapIdentitiesHandler(private val otherSide: FlowSession) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
subFlow(SwapIdentitiesFlow(otherSide))
logger.warnOnce("Insecure API to swap anonymous identities was used by ${otherSide.counterparty} (${otherSide.getCounterpartyFlowInfo()})")
}
}
open class SwapIdentitiesException @JvmOverloads constructor(message: String, cause: Throwable? = null) : FlowException(message, cause)

View File

@ -74,9 +74,6 @@ Version 4.0
* Fixed a problem that was preventing `Cash.generateSpend` to be used more than once per transaction (https://github.com/corda/corda/issues/4110).
* The experimental confidential-identities is now a separate CorDapp and must now be loaded onto the node alongside any CorDapp that needs it.
This also means your gradle dependency for it should be ``cordapp`` and not ``cordaCompile``.
* Fixed a bug resulting in poor vault query performance and incorrect results when sorting.
* Improved exception thrown by `AttachmentsClassLoader` when an attachment cannot be used because its uploader is not trusted.

View File

@ -292,12 +292,6 @@ The TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 family of ciphers is retired from the li
as it is a legacy cipher family not supported by all native SSL/TLS implementations. We anticipate that this
will have no impact on any deployed configurations.
Confidential identities
+++++++++++++++++++++++
If any of your CorDapps use the experimental confidential-identities module then it also needs to be loaded as a separate CorDapp jar. This
includes the demo finance CorDapp.
Miscellaneous changes
~~~~~~~~~~~~~~~~~~~~~

View File

@ -28,8 +28,8 @@ dependencies {
// cordapp project(':finance:workflows')
// cordapp project(':finance:contracts')
cordaCompile project(':core')
cordaCompile project(':confidential-identities')
cordapp project(':confidential-identities')
cordapp project(':finance:contracts')
// For JSON

View File

@ -73,6 +73,10 @@ dependencies {
compile project(':tools:cliutils')
compile project(':common-validation')
compile project(':common-configuration-parsing')
// Backwards compatibility goo: Apps expect confidential-identities to be loaded by default.
// We could eventually gate this on a target-version check.
compile project(':confidential-identities')
// Log4J: logging framework (with SLF4J bindings)
compile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"

View File

@ -0,0 +1,22 @@
package net.corda.node.internal
import co.paralleluniverse.fibers.Suspendable
import net.corda.confidential.SwapIdentitiesFlow
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowSession
import net.corda.core.flows.InitiatedBy
import net.corda.core.internal.warnOnce
/**
* Exists for backwards compatibility - the old confidential-identities API didn't use inlined flows. One day we'll need to disable this,
* but it is a complex versioning problem because we don't know which peers we might interact with. Disabling it will probably have to be
* gated on a minPlatformVersion bump.
*/
@InitiatedBy(SwapIdentitiesFlow::class)
class SwapIdentitiesHandler(private val otherSide: FlowSession) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
subFlow(SwapIdentitiesFlow(otherSide))
logger.warnOnce("Insecure API to swap anonymous identities was used by ${otherSide.counterparty} (${otherSide.getCounterpartyFlowInfo()})")
}
}

View File

@ -11,7 +11,6 @@ dependencies {
// The bank of corda CorDapp depends upon Cash CorDapp features
cordapp project(':finance:contracts')
cordapp project(':finance:workflows')
cordapp project(':confidential-identities')
// Corda integration dependencies
cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
@ -35,7 +34,6 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask,
nodeDefaults {
cordapp project(':finance:workflows')
cordapp project(':finance:contracts')
cordapp project(':confidential-identities')
}
node {
name "O=Notary Service,L=Zurich,C=CH"

View File

@ -9,7 +9,6 @@ dependencies {
// The trader demo CorDapp depends upon Cash CorDapp features
cordapp project(':finance:contracts')
cordapp project(':finance:workflows')
cordapp project(':confidential-identities')
cordapp project(':samples:bank-of-corda-demo')
cordapp project(':samples:trader-demo:workflows-trader')
@ -32,7 +31,6 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask,
}
cordapp project(':finance:workflows')
cordapp project(':finance:contracts')
cordapp project(':confidential-identities')
cordapp project(':samples:trader-demo:workflows-trader')
}
directory "./build/nodes"

View File

@ -138,11 +138,6 @@ distributions {
into 'cordapps'
fileMode = 0444
}
from(project(':confidential-identities').tasks.jar) {
rename 'corda-confidential-identities(.*)', 'corda-confidential-identities.jar'
into 'cordapps'
fileMode = 0444
}
}
}
}

View File

@ -22,8 +22,7 @@ class CordappController : Controller() {
private val cordappDir: Path = jvm.applicationDir / NodeConfig.CORDAPP_DIR_NAME
private val cordappJars = setOf(
cordappDir / "$FINANCE_CONTRACTS_CORDAPP_FILENAME.jar",
cordappDir / "$FINANCE_WORKFLOWS_CORDAPP_FILENAME.jar",
cordappDir / "corda-confidential-identities.jar"
cordappDir / "$FINANCE_WORKFLOWS_CORDAPP_FILENAME.jar"
)
/**