Skip to content

Commit

Permalink
Merge pull request #100 from bulwark-security/hide-undocumented-items
Browse files Browse the repository at this point in the history
Hide undocumented items
  • Loading branch information
sporkmonger authored Aug 2, 2023
2 parents ed5b67d + 7cf79b0 commit 97854a9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/wasm-host/src/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#[doc(hidden)]
mod bulwark_host {
wasmtime::component::bindgen!({
world: "bulwark:plugin/host-api",
async: true,
});
}

#[doc(hidden)]
mod handlers {
wasmtime::component::bindgen!({
world: "bulwark:plugin/handlers",
Expand Down
16 changes: 16 additions & 0 deletions crates/wasm-sdk-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ extern crate proc_macro;

/// The `bulwark_plugin` attribute generates default implementations for all handler traits in a module
/// and produces friendly errors for common mistakes.
///
/// # Example
///
/// ```no_compile
/// use bulwark_wasm_sdk::*;
///
/// struct ExamplePlugin;
///
/// #[bulwark_plugin]
/// impl Handlers for ExamplePlugin {
/// fn on_request_decision() -> Result {
/// // implement detection logic here
/// Ok(())
/// }
/// }
/// ```
#[proc_macro_attribute]
pub fn bulwark_plugin(_: TokenStream, input: TokenStream) -> TokenStream {
// Parse the input token stream as an impl, or return an error.
Expand Down
2 changes: 2 additions & 0 deletions crates/wasm-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ pub use bulwark_wasm_sdk_macros::{bulwark_plugin, handler};

// Each macro invocation has to be scoped to its own mod to avoid fixed constant name collisions
#[allow(unused_macros)]
#[doc(hidden)]
pub mod bulwark_host {
wit_bindgen::generate!({
world: "bulwark:plugin/host-api"
});
}
#[allow(unused_macros)]
#[doc(hidden)]
pub mod handlers {
wit_bindgen::generate!({
world: "bulwark:plugin/handlers"
Expand Down

0 comments on commit 97854a9

Please sign in to comment.