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

actors.h does not need to be public #6340

Merged
merged 5 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ set(CCF_ENDPOINTS_SOURCES
${CCF_DIR}/src/endpoints/endpoint_registry.cpp
${CCF_DIR}/src/endpoints/base_endpoint_registry.cpp
${CCF_DIR}/src/endpoints/common_endpoint_registry.cpp
${CCF_DIR}/src/endpoints/user_endpoint_registry.cpp
achamayou marked this conversation as resolved.
Show resolved Hide resolved
${CCF_DIR}/src/endpoints/json_handler.cpp
${CCF_DIR}/src/endpoints/authentication/cose_auth.cpp
${CCF_DIR}/src/endpoints/authentication/cert_auth.cpp
Expand Down
19 changes: 6 additions & 13 deletions include/ccf/app_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include "ccf/actors.h"
#include "ccf/ccf_deprecated.h"
#include "ccf/common_endpoint_registry.h"
#include "ccf/js_plugin.h"
Expand All @@ -27,24 +26,18 @@ namespace ccf
class UserEndpointRegistry : public CommonEndpointRegistry
{
public:
UserEndpointRegistry(ccf::AbstractNodeContext& context) :
CommonEndpointRegistry(get_actor_prefix(ActorsType::users), context)
{}
UserEndpointRegistry(ccf::AbstractNodeContext& context);

// Default behaviour is to do nothing - do NOT log summary of every request
// as it completes. Apps may override this if they wish.
void handle_event_request_completed(
const ccf::endpoints::RequestCompletedEvent& event) override
{}
const ccf::endpoints::RequestCompletedEvent& event) override;

// Default behavour is to log dispatch failures, as a coarse metric of
// some user errors, but do not log the raw path, which may contain
// confidential fields misformatted into the wrong url
void handle_event_dispatch_failed(
const ccf::endpoints::DispatchFailedEvent& event) override
{
// Log dispatch failures, as a coarse metric of some user errors, but do
// not log the raw path, which may contain confidential fields
// misformatted into the wrong url
CCF_APP_INFO("DispatchFailedEvent: {} {}", event.method, event.status);
}
const ccf::endpoints::DispatchFailedEvent& event) override;
};
}

Expand Down
1 change: 1 addition & 0 deletions src/apps/js_generic/js_generic_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ccf/node/host_processes_interface.h"
#include "ccf/service/tables/jsengine.h"
#include "ccf/version.h"
#include "ds/actors.h"
#include "enclave/enclave_time.h"
#include "js/global_class_ids.h"
#include "node/rpc_context_impl.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/enclave/rpc_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include "ccf/actors.h"
#include "ds/actors.h"
#include "rpc_handler.h"

namespace ccf
Expand Down
23 changes: 23 additions & 0 deletions src/endpoints/user_endpoint_registry.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.

#include "ccf/app_interface.h"
#include "ds/actors.h"

namespace ccf
{
UserEndpointRegistry::UserEndpointRegistry(
ccf::AbstractNodeContext& context) :
CommonEndpointRegistry(get_actor_prefix(ActorsType::users), context)
{}

void UserEndpointRegistry::handle_event_request_completed(
const ccf::endpoints::RequestCompletedEvent& event)
{}

void UserEndpointRegistry::handle_event_dispatch_failed(
const ccf::endpoints::DispatchFailedEvent& event)
{
CCF_APP_INFO("DispatchFailedEvent: {} {}", event.method, event.status);
}
}
2 changes: 1 addition & 1 deletion src/http/http_rpc_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include "ccf/actors.h"
#include "ccf/http_responder.h"
#include "ccf/odata_error.h"
#include "ccf/rpc_context.h"
#include "ds/actors.h"
#include "http_parser.h"
#include "node/rpc_context_impl.h"

Expand Down
1 change: 1 addition & 0 deletions src/js/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "ccf/js/modules/chained_module_loader.h"
#include "ccf/js/modules/kv_bytecode_module_loader.h"
#include "ccf/js/modules/kv_module_loader.h"
#include "ds/actors.h"
#include "node/rpc_context_impl.h"

namespace ccf::js
Expand Down
2 changes: 1 addition & 1 deletion src/node/acme_challenge_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include "ccf/actors.h"
#include "ccf/common_auth_policies.h"
#include "ccf/common_endpoint_registry.h"
#include "ccf/endpoint_registry.h"
#include "ds/actors.h"
#include "node/network_state.h"
#include "node/rpc/frontend.h"

Expand Down