Skip to content

Commit

Permalink
Merge branch 'main' into document_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou authored Jul 8, 2024
2 parents 355a4e0 + 0a9f970 commit c9b7ba0
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 16 deletions.
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
${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 @@ -19,6 +19,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 "js/modules/chained_module_loader.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 @@ -33,6 +33,7 @@
#include "ccf/js/extensions/ccf/request.h"
#include "ccf/js/extensions/ccf/rpc.h"
#include "ccf/js/interpreter_cache_interface.h"
#include "ds/actors.h"
#include "js/modules/chained_module_loader.h"
#include "js/modules/kv_bytecode_module_loader.h"
#include "js/modules/kv_module_loader.h"
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

0 comments on commit c9b7ba0

Please sign in to comment.