|
7 | 7 | // CCF |
8 | 8 | #include "ccf/app_interface.h" |
9 | 9 | #include "ccf/common_auth_policies.h" |
| 10 | +#include "ccf/cose_signatures_config_interface.h" |
10 | 11 | #include "ccf/crypto/cose.h" |
11 | 12 | #include "ccf/crypto/verifier.h" |
12 | 13 | #include "ccf/ds/hash.h" |
@@ -470,7 +471,7 @@ namespace loggingapp |
470 | 471 | "recording messages at client-specified IDs. It demonstrates most of " |
471 | 472 | "the features available to CCF apps."; |
472 | 473 |
|
473 | | - openapi_info.document_version = "2.7.0"; |
| 474 | + openapi_info.document_version = "2.8.0"; |
474 | 475 |
|
475 | 476 | index_per_public_key = std::make_shared<RecordsIndexingStrategy>( |
476 | 477 | PUBLIC_RECORDS, context, 10000, 20); |
@@ -2100,6 +2101,33 @@ namespace loggingapp |
2100 | 2101 | .set_auto_schema<void, void>() |
2101 | 2102 | .set_forwarding_required(ccf::endpoints::ForwardingRequired::Never) |
2102 | 2103 | .install(); |
| 2104 | + |
| 2105 | + auto get_cose_signatures_config = |
| 2106 | + [&](ccf::endpoints::ReadOnlyEndpointContext& ctx) { |
| 2107 | + auto subsystem = |
| 2108 | + context.get_subsystem<ccf::cose::AbstractCOSESignaturesConfig>(); |
| 2109 | + if (!subsystem) |
| 2110 | + { |
| 2111 | + ctx.rpc_ctx->set_error( |
| 2112 | + HTTP_STATUS_INTERNAL_SERVER_ERROR, |
| 2113 | + ccf::errors::InternalError, |
| 2114 | + "COSE signatures subsystem not available"); |
| 2115 | + return; |
| 2116 | + } |
| 2117 | + auto config = subsystem->get_cose_signatures_config(); |
| 2118 | + |
| 2119 | + ctx.rpc_ctx->set_response_status(HTTP_STATUS_OK); |
| 2120 | + ctx.rpc_ctx->set_response_body(nlohmann::json(config).dump()); |
| 2121 | + }; |
| 2122 | + |
| 2123 | + make_read_only_endpoint( |
| 2124 | + "/cose_signatures_config", |
| 2125 | + HTTP_GET, |
| 2126 | + get_cose_signatures_config, |
| 2127 | + auth_policies) |
| 2128 | + .set_auto_schema<void, void>() |
| 2129 | + .set_forwarding_required(ccf::endpoints::ForwardingRequired::Never) |
| 2130 | + .install(); |
2103 | 2131 | } |
2104 | 2132 | }; |
2105 | 2133 | } |
|
0 commit comments