diff --git a/src/node/rpc/cose_signatures_config.h b/src/node/rpc/cose_signatures_config.h new file mode 100644 index 00000000000..c7d29b01056 --- /dev/null +++ b/src/node/rpc/cose_signatures_config.h @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache 2.0 License. +#pragma once + +#include "ccf/ds/json.h" + +#include + +struct COSESignaturesConfig +{ + std::string issuer; + std::string subject; + + bool operator==(const COSESignaturesConfig& other) const = default; +}; + +DECLARE_JSON_TYPE(COSESignaturesConfig); +DECLARE_JSON_REQUIRED_FIELDS(COSESignaturesConfig, issuer, subject); \ No newline at end of file diff --git a/src/node/rpc/node_call_types.h b/src/node/rpc/node_call_types.h index ecac56781d3..d48ff6c016e 100644 --- a/src/node/rpc/node_call_types.h +++ b/src/node/rpc/node_call_types.h @@ -14,6 +14,7 @@ #include "enclave/interface.h" #include "node/identity.h" #include "node/ledger_secrets.h" +#include "node/rpc/cose_signatures_config.h" #include "node/uvm_endorsements.h" #include @@ -105,6 +106,8 @@ namespace ccf std::optional service_status = std::nullopt; std::optional endorsed_certificate = std::nullopt; + std::optional cose_signatures_config = + std::nullopt; NetworkInfo() {} @@ -114,13 +117,15 @@ namespace ccf const LedgerSecretsMap& ledger_secrets, const NetworkIdentity& identity, ServiceStatus service_status, - const std::optional& endorsed_certificate) : + const std::optional& endorsed_certificate, + const std::optional& cose_signatures_config_) : public_only(public_only), last_recovered_signed_idx(last_recovered_signed_idx), ledger_secrets(ledger_secrets), identity(identity), service_status(service_status), - endorsed_certificate(endorsed_certificate) + endorsed_certificate(endorsed_certificate), + cose_signatures_config(cose_signatures_config_) {} bool operator==(const NetworkInfo& other) const @@ -130,7 +135,8 @@ namespace ccf ledger_secrets == other.ledger_secrets && identity == other.identity && service_status == other.service_status && - endorsed_certificate == other.endorsed_certificate; + endorsed_certificate == other.endorsed_certificate && + cose_signatures_config == other.cose_signatures_config; } bool operator!=(const NetworkInfo& other) const diff --git a/src/node/rpc/node_frontend.h b/src/node/rpc/node_frontend.h index d010cb02de6..5935654bf46 100644 --- a/src/node/rpc/node_frontend.h +++ b/src/node/rpc/node_frontend.h @@ -369,7 +369,8 @@ namespace ccf this->network.ledger_secrets->get(tx), *this->network.identity.get(), service_status, - endorsed_certificate}; + endorsed_certificate, + std::nullopt /* cose_signatures_config */}; } return make_success(rep); } @@ -483,7 +484,8 @@ namespace ccf args.tx, existing_node_info->ledger_secret_seqno), *this->network.identity.get(), active_service->status, - existing_node_info->endorsed_certificate); + existing_node_info->endorsed_certificate, + std::nullopt /* cose_signatures_config */); return make_success(rep); } @@ -558,7 +560,8 @@ namespace ccf args.tx, existing_node_info->ledger_secret_seqno), *this->network.identity.get(), active_service->status, - existing_node_info->endorsed_certificate); + existing_node_info->endorsed_certificate, + std::nullopt /* cose_signatures_config */); return make_success(rep); } diff --git a/src/node/rpc/serialization.h b/src/node/rpc/serialization.h index 3d72a9fc40c..b8fdab00fc8 100644 --- a/src/node/rpc/serialization.h +++ b/src/node/rpc/serialization.h @@ -55,7 +55,9 @@ namespace ccf DECLARE_JSON_OPTIONAL_FIELDS( JoinNetworkNodeToNode::Out::NetworkInfo, service_status, - endorsed_certificate) + endorsed_certificate, + cose_signatures_config) + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(JoinNetworkNodeToNode::Out) DECLARE_JSON_REQUIRED_FIELDS(JoinNetworkNodeToNode::Out, node_status) DECLARE_JSON_OPTIONAL_FIELDS(