Skip to content

Commit 7f4c9b3

Browse files
Copilotachamayoueddyashton
authored
Remove unused get_responder() from RpcContext and make http_responder.h private (#7827)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com> Co-authored-by: eddyashton <6000239+eddyashton@users.noreply.github.com> Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
1 parent a993226 commit 7f4c9b3

7 files changed

Lines changed: 5 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1616
### Removed
1717

1818
- Removed `aes_gcm_encrypt()`, `aes_gcm_decrypt()`, and `default_iv` from `ccf::crypto` (#7811).
19+
- Removed `get_responder()` from the public `ccf::RpcContext` API and made `http_responder.h` a private header (#7818).
1920
- Removed the `/node/memory` endpoint. This endpoint was originally useful for monitoring SGX enclave memory usage, which is no longer relevant now that SGX support has been removed.
2021

2122
## [7.0.0-rc1]

include/ccf/rpc_context.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "ccf/frame_format.h"
88
#include "ccf/http_consts.h"
99
#include "ccf/http_header_map.h"
10-
#include "ccf/http_responder.h"
1110
#include "ccf/odata_error.h"
1211
#include "ccf/redirect.h"
1312
#include "ccf/rest_verb.h"
@@ -83,8 +82,6 @@ namespace ccf
8382
[[nodiscard]] virtual const ccf::RESTVerb& get_request_verb() const = 0;
8483
[[nodiscard]] virtual std::string get_request_path() const = 0;
8584
[[nodiscard]] virtual std::string get_method() const = 0;
86-
[[nodiscard]] virtual std::shared_ptr<ccf::http::HTTPResponder>
87-
get_responder() const = 0;
8885

8986
/// Returns a map of all PathParams parsed out of the original query path.
9087
/// For instance if this endpoint was installed at `/foo/{name}/{age}`, and

src/enclave/rpc_sessions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// Licensed under the Apache 2.0 License.
33
#pragma once
44

5-
#include "ccf/http_responder.h"
65
#include "ccf/pal/locking.h"
76
#include "ccf/service/node_info_network.h"
87
#include "ds/internal_logger.h"
98
#include "ds/serialized.h"
109
#include "enclave/session.h"
1110
#include "forwarder_types.h"
1211
#include "http/http2_session.h"
12+
#include "http/http_responder.h"
1313
#include "http/http_session.h"
1414
#include "node/rpc/custom_protocol_subsystem.h"
1515
#include "node/session_metrics.h"

src/http/http2_session.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Licensed under the Apache 2.0 License.
33
#pragma once
44

5-
#include "ccf/http_responder.h"
65
#include "ds/internal_logger.h"
76
#include "enclave/client_session.h"
87
#include "enclave/rpc_map.h"
98
#include "error_reporter.h"
109
#include "http/http2_types.h"
1110
#include "http2_parser.h"
11+
#include "http_responder.h"
1212
#include "http_rpc_context.h"
1313

1414
namespace http
@@ -352,8 +352,7 @@ namespace http
352352
verb,
353353
url,
354354
std::move(headers),
355-
std::move(body),
356-
responder);
355+
std::move(body));
357356
}
358357
catch (std::exception& e)
359358
{

src/http/http_rpc_context.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache 2.0 License.
33
#pragma once
44

5-
#include "ccf/http_responder.h"
65
#include "ccf/odata_error.h"
76
#include "ccf/rpc_context.h"
87
#include "ds/actors.h"
@@ -49,8 +48,6 @@ namespace http
4948

5049
std::vector<uint8_t> request_body;
5150

52-
std::shared_ptr<ccf::http::HTTPResponder> responder = nullptr;
53-
5451
std::vector<uint8_t> serialised_request;
5552

5653
ccf::http::HeaderMap response_headers;
@@ -99,14 +96,12 @@ namespace http
9996
const std::string_view& url_,
10097
ccf::http::HeaderMap headers_,
10198
const std::vector<uint8_t>& body_,
102-
const std::shared_ptr<ccf::http::HTTPResponder>& responder_ = nullptr,
10399
const std::vector<uint8_t>& raw_request_ = {}) :
104100
RpcContextImpl(s, http_version),
105101
verb(verb_),
106102
url(url_),
107103
request_headers(std::move(headers_)),
108104
request_body(body_),
109-
responder(responder_),
110105
serialised_request(raw_request_)
111106
{
112107
const auto [path_, query_, fragment_] = split_url_path(url);
@@ -202,12 +197,6 @@ namespace http
202197
return url;
203198
}
204199

205-
[[nodiscard]] std::shared_ptr<ccf::http::HTTPResponder> get_responder()
206-
const override
207-
{
208-
return responder;
209-
}
210-
211200
template <typename T>
212201
void _set_response_body(T&& body)
213202
{
@@ -396,7 +385,6 @@ namespace ccf
396385
msg.url,
397386
msg.headers,
398387
msg.body,
399-
nullptr,
400388
packed);
401389
}
402390

src/http/http_session.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Licensed under the Apache 2.0 License.
33
#pragma once
44

5-
#include "ccf/http_responder.h"
65
#include "ds/internal_logger.h"
76
#include "enclave/client_session.h"
87
#include "enclave/rpc_handler.h"
98
#include "enclave/rpc_map.h"
109
#include "error_reporter.h"
1110
#include "http_parser.h"
11+
#include "http_responder.h"
1212
#include "http_rpc_context.h"
1313

1414
namespace http

0 commit comments

Comments
 (0)