|
CCF
|
#include <registry.h>
Inherits ccf::UserEndpointRegistry.
Inherited by programmabilityapp::ProgrammabilityHandlers.
Additional Inherited Members | |
Public Types inherited from ccf::endpoints::EndpointRegistry | |
| enum | ReadWrite { Read , Write } |
Public Attributes inherited from ccf::endpoints::EndpointRegistry | |
| const std::string | method_prefix |
| struct ccf::endpoints::EndpointRegistry::OpenApiInfo | openapi_info |
Protected Member Functions inherited from ccf::CommonEndpointRegistry | |
| virtual void | api_endpoint (ccf::endpoints::ReadOnlyEndpointContext &ctx) |
Protected Attributes inherited from ccf::BaseEndpointRegistry | |
| ccf::AbstractNodeContext & | context |
Protected Attributes inherited from ccf::endpoints::EndpointRegistry | |
| EndpointPtr | default_endpoint |
| std::map< std::string, std::map< RESTVerb, EndpointPtr > > | fully_qualified_endpoints |
| std::map< std::string, std::map< RESTVerb, std::shared_ptr< PathTemplatedEndpoint > > > | templated_endpoints |
| ccf::kv::Consensus * | consensus = nullptr |
| ccf::kv::TxHistory * | history = nullptr |
| ccf::js::DynamicJSEndpointRegistry::DynamicJSEndpointRegistry | ( | ccf::AbstractNodeContext & | context, |
| const std::string & | kv_prefix = "public:custom_endpoints" |
||
| ) |
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::check_action_not_replayed_v1 | ( | ccf::kv::Tx & | tx, |
| uint64_t | created_at, | ||
| const std::span< const uint8_t > | action, | ||
| ccf::InvalidArgsReason & | reason | ||
| ) |
Check an action is not being replayed, by looking it up in the history of recent actions. To place an upper bound on the history size, an authenticated timestamp (created_at) is required.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::get_custom_endpoint_module_v1 | ( | std::string & | code, |
| ccf::kv::ReadOnlyTx & | tx, | ||
| const std::string & | module_name | ||
| ) |
Retrieve content of a single JS module.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::get_custom_endpoint_properties_v1 | ( | ccf::endpoints::EndpointProperties & | properties, |
| ccf::kv::ReadOnlyTx & | tx, | ||
| const ccf::RESTVerb & | verb, | ||
| const ccf::endpoints::URI & | uri | ||
| ) |
Retrieve property definition for a single JS endpoint.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::get_custom_endpoints_v1 | ( | ccf::js::Bundle & | bundle, |
| ccf::kv::ReadOnlyTx & | tx | ||
| ) |
Retrieve all endpoint definitions currently in-use. This returns the same bundle written by a recent call to install_custom_endpoints. Note that some values (module paths, casing of HTTP methods) may differ slightly due to internal normalisation.
|
inlinevirtual |
Reimplemented in programmabilityapp::ProgrammabilityHandlers.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::get_js_runtime_options_v1 | ( | ccf::JSRuntimeOptions & | options, |
| ccf::kv::ReadOnlyTx & | tx | ||
| ) |
Get the options which currently control JS execution. If no value has been populated in the KV, this will return the default runtime options which will be applied instead.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::install_custom_endpoints_v1 | ( | ccf::kv::Tx & | tx, |
| const ccf::js::Bundle & | bundle | ||
| ) |
Call this to populate the KV with JS endpoint definitions, so they can later be dispatched to.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::record_action_for_audit_v1 | ( | ccf::kv::Tx & | tx, |
| ccf::ActionFormat | format, | ||
| const std::string & | user_id, | ||
| const std::string & | action_name, | ||
| const std::vector< uint8_t > & | action_body | ||
| ) |
Record action details by storing them in KV maps using a common format, for the purposes of offline audit using the ledger.
| void ccf::js::DynamicJSEndpointRegistry::set_js_kv_namespace_restriction | ( | const ccf::js::NamespaceRestriction & | restriction | ) |
Pass a function to control which maps can be accessed by JS endpoints.
| ccf::ApiResult ccf::js::DynamicJSEndpointRegistry::set_js_runtime_options_v1 | ( | ccf::kv::Tx & | tx, |
| const ccf::JSRuntimeOptions & | options | ||
| ) |
Set options to control JS execution. Some hard limits may be applied to bound any values specified here.