Skip to content

Commit f62f38d

Browse files
achamayouCopilot
andauthored
Move HTTP runtime session adapters into enclave to break http->enclave/node cycles
Relocate src/http/http_session.h, http2_session.h, and http_rpc_context.h into src/enclave/, preserving their http:: namespace and type names. These are internal runtime adapters that bind the HTTP protocol layer to enclave session/RPC machinery and ccf::RpcContextImpl (in src/node), so they belonged with their consumers rather than with the protocol-only http component. Update all in-tree consumers (rpc_sessions.h, forwarder.h, jwt_key_auto_refresh.h) to the new paths, and drop the now-unused http_rpc_context.h include from frontend.h. Make the moved headers self-contained by including enclave/rpc_handler.h and enclave/rpc_map.h directly, and updating relative http/ includes to explicit paths. Clean incidental http -> enclave edges from the remaining protocol headers: http2_parser.h and http_proc.h no longer include enclave/session.h and enclave/tls_session.h respectively (unused), and http_parser.h drops enclave/tls_session.h in favour of a direct ds/internal_logger.h include for the logging macros it actually uses. Extend scripts/source-dependencies.json with the http component's final allowed dependencies (ccf-api, crypto, ds, uv), matching the acyclic policy already enforced for other components. The dependency checker confirms no remaining http -> enclave, http -> host, or http -> node edges. Layer 2 of the acyclic source components stack, based on #8281. Refs #3517. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2127e64 commit f62f38d

11 files changed

Lines changed: 16 additions & 17 deletions

scripts/source-dependencies.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"threading": [],
3434
"tls": ["crypto", "ds"],
3535
"udp": ["ds"],
36-
"uv": []
36+
"uv": [],
37+
"http": ["ccf-api", "crypto", "ds", "uv"]
3738
}
3839
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
#include "ds/internal_logger.h"
66
#include "enclave/rpc_map.h"
7-
#include "error_reporter.h"
7+
#include "http/error_reporter.h"
8+
#include "http/http2_parser.h"
89
#include "http/http2_types.h"
9-
#include "http2_parser.h"
10-
#include "http_responder.h"
10+
#include "http/http_responder.h"
1111
#include "http_rpc_context.h"
1212

1313
namespace http
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#include "ccf/odata_error.h"
66
#include "ccf/rpc_context.h"
77
#include "ds/actors.h"
8-
#include "http_parser.h"
8+
#include "enclave/rpc_handler.h"
9+
#include "enclave/rpc_map.h"
10+
#include "http/http_parser.h"
911
#include "node/rpc_context_impl.h"
1012

1113
namespace http
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#include "ds/internal_logger.h"
66
#include "enclave/rpc_handler.h"
77
#include "enclave/rpc_map.h"
8-
#include "error_reporter.h"
9-
#include "http_parser.h"
10-
#include "http_responder.h"
8+
#include "http/error_reporter.h"
9+
#include "http/http_parser.h"
10+
#include "http/http_responder.h"
1111
#include "http_rpc_context.h"
1212

1313
namespace http

src/enclave/rpc_sessions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include "ds/serialized.h"
99
#include "enclave/session.h"
1010
#include "forwarder_types.h"
11-
#include "http/http2_session.h"
1211
#include "http/http_responder.h"
13-
#include "http/http_session.h"
12+
#include "http2_session.h"
13+
#include "http_session.h"
1414
#include "node/rpc/custom_protocol_subsystem.h"
1515
#include "node/session_metrics.h"
1616
#include "rpc_handler.h"

src/http/http2_parser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
#include "ccf/ds/nonstd.h"
66
#include "ds/internal_logger.h"
7-
#include "enclave/session.h"
87
#include "http2_callbacks.h"
98
#include "http2_types.h"
109
#include "http_proc.h"
11-
#include "http_rpc_context.h"
1210

1311
#include <utility>
1412

src/http/http_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "ccf/ds/hex.h"
66
#include "ccf/http_configuration.h"
77
#include "ccf/http_query.h"
8-
#include "enclave/tls_session.h"
8+
#include "ds/internal_logger.h"
99
#include "http/http_exceptions.h"
1010
#include "http_builder.h"
1111
#include "http_proc.h"

src/http/http_proc.h

Lines changed: 0 additions & 1 deletion
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 "enclave/tls_session.h"
65
#include "http2_types.h"
76
#include "http_builder.h"
87

src/node/jwt_key_auto_refresh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#include "ccf/ds/json.h"
66
#include "ccf/ds/nonstd.h"
77
#include "ccf/service/tables/jwt.h"
8+
#include "enclave/http_rpc_context.h"
89
#include "http/curl.h"
910
#include "http/http_builder.h"
10-
#include "http/http_rpc_context.h"
1111
#include "node/rpc/node_frontend.h"
1212
#include "tasks/basic_task.h"
1313
#include "tasks/task_system.h"

src/node/rpc/forwarder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#pragma once
44

55
#include "enclave/forwarder_types.h"
6+
#include "enclave/http_rpc_context.h"
67
#include "enclave/rpc_map.h"
7-
#include "http/http_rpc_context.h"
88
#include "kv/kv_types.h"
99
#include "node/node_to_node.h"
1010
#include "tasks/basic_task.h"

0 commit comments

Comments
 (0)