-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORE-20522: Merging forward updates from release/os/5.2 to release/os/5.3 - 2024-06-27 #1665
Merged
YashNabar
merged 6 commits into
release/os/5.3
from
merge-release/os/5.2-release/os/5.3-2024-06-27-152
Jul 2, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
86059cb
CORE-6717 Add schemas for hosted identity reconciliation (#1620)
YashNabar 3a85fcb
ES-2351: Generate new API yaml for 5.2.1 to satisfy the api scanner p…
ronanbrowne 7d61b1e
ES-2340/Add static code analysis pipeline with Snyk integration (#1652)
seanbrereton 84a8245
Merge branch 'release/os/5.3' into merge-release/os/5.2-release/os/5.…
YashNabar 8a5b754
ES-2351: Merging forward updates from 5.2 to 5.3
YashNabar 497c7a6
Merge branch 'release/os/5.3' into merge-release/os/5.2-release/os/5.…
YashNabar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@Library('[email protected]') _ | ||
|
||
staticCodeAnalysisPipeline( | ||
snykCodeEnabled : true | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...in/resources/avro/net/corda/data/membership/db/request/command/PersistHostedIdentity.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"type": "record", | ||
"name": "PersistHostedIdentity", | ||
"namespace": "net.corda.data.membership.db.request.command", | ||
"doc": "Persist a locally-hosted identity.", | ||
"fields": [ | ||
{ | ||
"name": "tlsCertificateAlias", | ||
"doc": "Alias of the TLS certificate chain.", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "useClusterLevelTls", | ||
"doc": "Specifies whether the cluster-level P2P TLS certificate type and key should be used, or the virtual node certificate and key.", | ||
"type": "boolean" | ||
}, | ||
{ | ||
"name": "sessionKeysAndCertificates", | ||
"doc": "List of session keys and certificates.", | ||
"type": { | ||
"type": "array", | ||
"items": "net.corda.data.membership.db.request.command.SessionKeyAndCertificate" | ||
} | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
...resources/avro/net/corda/data/membership/db/request/command/SessionKeyAndCertificate.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "record", | ||
"name": "SessionKeyAndCertificate", | ||
"namespace": "net.corda.data.membership.db.request.command", | ||
"doc": "Session key and certificate for a locally-hosted identity.", | ||
"fields": [ | ||
{ | ||
"name": "sessionKeyId", | ||
"doc": "Session key identifier.", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "certificateAlias", | ||
"doc": "The certificate chain alias of the session key. Null if no PKI is used for sessions.", | ||
"type": ["null", "string"] | ||
}, | ||
{ | ||
"name": "isPreferred", | ||
"doc": "True if this key is the preferred key.", | ||
"type": "boolean" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ces/avro/net/corda/data/membership/db/response/command/PersistHostedIdentityResponse.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "record", | ||
"name": "PersistHostedIdentityResponse", | ||
"namespace": "net.corda.data.membership.db.response.command", | ||
"doc": "Response to a persist hosted identity request.", | ||
"fields": [ | ||
{ | ||
"name": "version", | ||
"doc": "Version of the newly persisted hosted identity.", | ||
"type": "int" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
data/avro-schema/src/test/kotlin/net/corda/data/p2p/HostedIdentityEntryCompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package net.corda.data.p2p | ||
|
||
import net.corda.data.identity.HoldingIdentity | ||
import org.apache.avro.Schema | ||
import org.apache.avro.SchemaCompatibility | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
|
||
class HostedIdentityEntryCompatibilityTest { | ||
@Test | ||
fun `check HostedIdentityEntry schema changes between Corda 5_2 and 5_2_1 are compatible`() { | ||
val schemaV52Json = """ | ||
{ | ||
"type": "record", | ||
"name": "HostedIdentityEntry", | ||
"namespace": "net.corda.data.p2p", | ||
"fields": [ | ||
{ | ||
"doc": "The Holding identity hosted in this node", | ||
"name": "holdingIdentity", | ||
"type": "net.corda.data.identity.HoldingIdentity" | ||
}, | ||
{ | ||
"doc": "The tenant ID under which the TLS key is stored", | ||
"name": "tlsTenantId", | ||
"type": "string" | ||
}, | ||
{ | ||
"doc": "The TLS certificates (in PEM format)", | ||
"name": "tlsCertificates", | ||
"type": { | ||
"type": "array", | ||
"items": "string" | ||
} | ||
}, | ||
{ | ||
"doc": "The preferred session initiation key and certificate", | ||
"name": "preferredSessionKeyAndCert", | ||
"type": "HostedIdentitySessionKeyAndCert" | ||
}, | ||
{ | ||
"doc": "Alternative session initiation keys and certificates", | ||
"name": "alternativeSessionKeysAndCerts", | ||
"type": { | ||
"type": "array", | ||
"items": "HostedIdentitySessionKeyAndCert" | ||
} | ||
} | ||
] | ||
} | ||
""".trimIndent() | ||
|
||
val schemaV52 = Schema.Parser().addTypes( | ||
mapOf( | ||
HoldingIdentity::class.java.name to HoldingIdentity.`SCHEMA$`, | ||
HostedIdentitySessionKeyAndCert::class.java.name to HostedIdentitySessionKeyAndCert.`SCHEMA$` | ||
) | ||
).parse(schemaV52Json) | ||
val schemaV521 = HostedIdentityEntry.`SCHEMA$` | ||
|
||
val compatibility = SchemaCompatibility.checkReaderWriterCompatibility(schemaV521, schemaV52) | ||
assertEquals(compatibility.type, SchemaCompatibility.SchemaCompatibilityType.COMPATIBLE) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...c/main/resources/net/corda/db/schema/config/migration/hosted-identity-creation-v5.2.1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.1" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"> | ||
|
||
<changeSet author="R3.Corda" id="hosted-identity-creation-v5.2.1"> | ||
<createTable tableName="hosted_identity_session_key_info"> | ||
<column name="holding_identity_id" type="VARCHAR(12)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<!-- short hash (first 12 hex chars of SHA256) of the public key --> | ||
<column name="session_key_id" type="CHAR(12)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="session_certificate_alias" type="VARCHAR(255)"> | ||
<constraints nullable="true"/> | ||
</column> | ||
</createTable> | ||
<addPrimaryKey tableName="hosted_identity_session_key_info" columnNames="holding_identity_id,session_key_id" | ||
constraintName="hosted_identity_session_key_info_pk"/> | ||
|
||
<createTable tableName="hosted_identity"> | ||
<column name="holding_identity_id" type="VARCHAR(12)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="preferred_session_key_id" type="CHAR(12)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="tls_certificate_alias" type="VARCHAR(64)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="use_cluster_level_tls" type="BOOLEAN"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="version" type="INT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
<addPrimaryKey tableName="hosted_identity" columnNames="holding_identity_id" | ||
constraintName="hosted_identity_pk"/> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to modify this test to check 5.3 instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like it based on similar tests, for example - flow status, decline registration.