-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/os/5.3' into CORE-20756/update-regex
- Loading branch information
Showing
26 changed files
with
308 additions
and
5 deletions.
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
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
15 changes: 15 additions & 0 deletions
15
...ain/resources/avro/net/corda/data/permissions/management/group/AddRoleToGroupRequest.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,15 @@ | ||
{ | ||
"type": "record", | ||
"name": "AddRoleToGroupRequest", | ||
"namespace": "net.corda.data.permissions.management.group", | ||
"fields": [ | ||
{ | ||
"name": "groupId", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "roleId", | ||
"type": "string" | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
...esources/avro/net/corda/data/permissions/management/group/ChangeGroupParentIdRequest.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,15 @@ | ||
{ | ||
"type": "record", | ||
"name": "ChangeGroupParentIdRequest", | ||
"namespace": "net.corda.data.permissions.management.group", | ||
"fields": [ | ||
{ | ||
"name": "groupId", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "newParentGroupId", | ||
"type": [ "null", "string" ] | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
...c/main/resources/avro/net/corda/data/permissions/management/group/CreateGroupRequest.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,15 @@ | ||
{ | ||
"type": "record", | ||
"name": "CreateGroupRequest", | ||
"namespace": "net.corda.data.permissions.management.group", | ||
"fields": [ | ||
{ | ||
"name": "groupName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "parentGroupId", | ||
"type": [ "null", "string" ] | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
...c/main/resources/avro/net/corda/data/permissions/management/group/DeleteGroupRequest.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,11 @@ | ||
{ | ||
"type": "record", | ||
"name": "DeleteGroupRequest", | ||
"namespace": "net.corda.data.permissions.management.group", | ||
"fields": [ | ||
{ | ||
"name": "groupId", | ||
"type": "string" | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
...esources/avro/net/corda/data/permissions/management/group/RemoveRoleFromGroupRequest.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,15 @@ | ||
{ | ||
"type": "record", | ||
"name": "RemoveRoleFromGroupRequest", | ||
"namespace": "net.corda.data.permissions.management.group", | ||
"fields": [ | ||
{ | ||
"name": "groupId", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "roleId", | ||
"type": "string" | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
...urces/avro/net/corda/data/permissions/management/user/ChangeUserParentGroupIdRequest.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,15 @@ | ||
{ | ||
"type": "record", | ||
"name": "ChangeUserParentGroupIdRequest", | ||
"namespace": "net.corda.data.permissions.management.user", | ||
"fields": [ | ||
{ | ||
"name": "userId", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "newParentGroupId", | ||
"type": [ "null", "string" ] | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
...src/main/resources/avro/net/corda/data/permissions/management/user/DeleteUserRequest.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,11 @@ | ||
{ | ||
"type": "record", | ||
"name": "DeleteUserRequest", | ||
"namespace": "net.corda.data.permissions.management.user", | ||
"fields": [ | ||
{ | ||
"name": "loginName", | ||
"type": "string" | ||
} | ||
] | ||
} |
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> |
Oops, something went wrong.