Skip to content

Commit

Permalink
CORE-2436 Extend manifest scanning to capture custom crypto classes. (#…
Browse files Browse the repository at this point in the history
…119)

* CORE-2436  Extend manifest scanning to capture custom crypto classes.

Scan for cpks DigestAlgorithmFactory

Scan classes implementing net.corda.v5.cipher.suite.DigestAlgorithmFactory in a cpk
and add them to the cpk's manifest.

Part of POC (see Jira) to demonstrate we can define and instantiate custom crypto.

* CORE-2436  Bump API version as scanning for custom crypto classes is a breaking API change.

* CORE-2436  Rename crypto classes manifest entry

Address PR comment and rename custom crypto to digest-algorithm-factory
where appropriate.
  • Loading branch information
barrylapthorn authored Nov 2, 2021
1 parent a970ab9 commit fdaf379
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ crashlytics-build.properties
*.swo

# Files you may find useful to have in your working directory.
PLAN
NOTES
TODO
PLAN*
NOTES*
TODO*

# gradle-dependx plugin
.dependx/

# Directory generated during Resolve and TestOSGi gradle tasks
bnd/

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Corda-CheckpointCustomSerializer-Classes=IMPLEMENTS;net.corda.v5.serialization.C
Corda-NotaryService-Classes=EXTENDS;net.corda.v5.ledger.notary.NotaryService
Corda-StateAndRefPostProcessor-Classes=IMPLEMENTS;net.corda.v5.ledger.services.vault.StateAndRefPostProcessor
Corda-CustomQueryPostProcessor-Classes=IMPLEMENTS;net.corda.v5.application.services.persistence.CustomQueryPostProcessor
Corda-DigestAlgorithmFactory-Classes=IMPLEMENTS;net.corda.v5.cipher.suite.DigestAlgorithmFactory

# Corda should adjust this version over time, as required.
Minimum-Corda-Plugins-Version=6.0.0
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cordaProductVersion = 5.0.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 19
cordaApiRevision = 20

# Main
kotlinVersion = 1.4.32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data class CordappManifest(
const val CORDAPP_STATE_AND_REF_PROCESSORS = "Corda-StateAndRefPostProcessor-Classes"
const val CORDAPP_CUSTOM_QUERY_PROCESSORS = "Corda-CustomQueryPostProcessor-Classes"
const val CORDAPP_NOTARIES = "Corda-NotaryService-Classes"
const val CORDAPP_DIGEST_ALGORITHM_FACTORIES = "Corda-DigestAlgorithmFactory-Classes"

private operator fun Manifest.get(key: String): String? = mainAttributes.getValue(key)

Expand Down Expand Up @@ -132,11 +133,12 @@ data class CordappManifest(
val queryPostProcessors: Set<String>
get() = parseSet(CORDAPP_STATE_AND_REF_PROCESSORS) + parseSet(CORDAPP_CUSTOM_QUERY_PROCESSORS)
val notaryProtocols: Set<String> get() = parseSet(CORDAPP_NOTARIES)
val digestAlgorithmFactories: Set<String> get() = parseSet(CORDAPP_DIGEST_ALGORITHM_FACTORIES)
}

/** Information on a contract or workflow CorDapp in a [CordappManifest]. */
data class ManifestCordappInfo(
val shortName: String?,
val vendor: String?,
val versionId: Int?,
val licence: String?)
val licence: String?)

0 comments on commit fdaf379

Please sign in to comment.