Skip to content
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-20426 Persist the local hosted identities #6123

Merged
merged 33 commits into from May 14, 2024

Conversation

williamvigorr3
Copy link
Contributor

@williamvigorr3 williamvigorr3 commented May 10, 2024

Change CLI tool to write an SQL to persist the locally hosted identities. This will be used during the 5.2.0 to 5.2.1 platform upgrade process.

Testing

To build, build the CLI plugin and copy the jar into corda-cli-plugin-host:

#!/bin/bash
cd ../corda-runtime-os
./gradlew :tools:plugins:package:build  :tools:plugins:upgrade:build
cd ../corda-cli-plugin-host
cp  ../corda-runtime-os/tools/plugins/upgrade/build/libs/upgrade-cli-plugin-5.2.1.0-SNAPSHOT.jar ./build/plugins

Then you can run it using:

./build/generatedScripts/corda-cli.sh upgrade migrate-data-5-2-1  -t https://localhost:8888 -u admin -p admin --insecure -b localhost:9092 --timeout 10000

It will produce SQL which looks like:

insert into hosted_identity (holding_identity_id, preferred_session_key_id, tls_certificate_alias, use_cluster_level_tls, version) values ('290096CEDCCF', 'F3F23B77E83D', 'p2p-tls-cert', true, 1);
insert into hosted_identity_session_key_info (holding_identity_id, session_certificate_alias, session_key_id) values ('290096CEDCCF', 'p2p-session-cert-290096CEDCCF', 'F3F23B77E83D');
insert into hosted_identity (holding_identity_id, preferred_session_key_id, tls_certificate_alias, use_cluster_level_tls, version) values ('26E1462EDBCA', '7365F8EA0D38', 'p2p-tls-cert', true, 1);
insert into hosted_identity_session_key_info (holding_identity_id, session_certificate_alias, session_key_id) values ('26E1462EDBCA', 'p2p-session-cert-26E1462EDBCA', '7365F8EA0D38');
insert into hosted_identity (holding_identity_id, preferred_session_key_id, tls_certificate_alias, use_cluster_level_tls, version) values ('D5EEAB0DAC7A', '1D77E685A3A1', 'p2p-tls-cert', true, 1);
insert into hosted_identity_session_key_info (holding_identity_id, session_certificate_alias, session_key_id) values ('D5EEAB0DAC7A', 'p2p-session-cert-D5EEAB0DAC7A', '1D77E685A3A1');

To the file migrate_member_data.sql. This can be run by adding `SET schema 'config'; before the SQL.

@corda-jenkins-ci02
Copy link
Contributor

corda-jenkins-ci02 bot commented May 10, 2024

Jenkins build for PR 6123 build 9

Build Successful:
Jar artifact version produced by this PR: 5.2.1.0-alpha-1715675620188
Helm chart version produced by this PR: 5.2.1-alpha.1715675620188
Helm chart pushed to: oci://corda-os-docker-dev.software.r3.com/helm-charts/pr-6123/corda
Helm chart Polaris score: 82

@@ -103,4 +123,162 @@ class MigrateHostedIdentities : Runnable {
UpgradePluginWrapper.logger.error("Failed to close consumer from group '$consumerGroup'.", ex)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up in case you weren't aware, the functional part of plugins is moving to a libs/corda-sdk directory in 5.3 so you wont be able to merge this as is. There's nothing you can do about that here because that component doesn't exist in 5.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. We will need to remember this when the merge bot does a forward merge from release/os/5.2 into release/os/5.3. cc: @YashNabar (we will need to the same for CORE-20478 #6120).

Base automatically changed from yash/CORE-20478 to release/os/5.2 May 13, 2024 16:28
Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@williamvigorr3 williamvigorr3 merged commit def3aef into release/os/5.2 May 14, 2024
6 checks passed
@williamvigorr3 williamvigorr3 deleted the WillV/CORE-20478-And-CORE-20426 branch May 14, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants