From 418a618a6a42dd6850e036116d528c131011eaf4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:07:31 -0700 Subject: [PATCH] Add auth sdk page --- docs/SDKs/rust-auth.mdx | 40 +++++++++++++++++++++++++++++++++ docs/examples/authorization.mdx | 15 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 docs/SDKs/rust-auth.mdx diff --git a/docs/SDKs/rust-auth.mdx b/docs/SDKs/rust-auth.mdx new file mode 100644 index 00000000..de2de5c7 --- /dev/null +++ b/docs/SDKs/rust-auth.mdx @@ -0,0 +1,40 @@ +--- +sidebar_position: 2 +title: Soroban Rust Auth SDK +--- + +The `soroban-auth` Rust crate contains the Soroban Rust Auth SDK. It provides +utilities for verifying signatures on invocations of smart contracts. It is +intended for use alongside the [`soroban-sdk`]. + +[`soroban-sdk`]: rust + +:::caution +The `soroban-auth` crate is in early development. Report issues +[here](https://github.com/stellar/rs-soroban-sdk/issues/new/choose). +::: + +## SDK Documentation + +Auth documentation is available at: +https://docs.rs/soroban-auth + +## Subscribe to Releases + +Subscribe to releases on the GitHub repository: +https://github.com/stellar/rs-soroban-sdk + +## Add `soroban-auth` as a Dependency + +Add the following sections to the `Cargo.toml` to import `soroban-auth`. + +```toml +[features] +testutils = ["soroban-auth/testutils"] + +[dependencies] +soroban-auth = "0.0.4" + +[dev_dependencies] +soroban-auth = { version = "0.0.4", features = ["soroban-auth/testutils"] } +``` diff --git a/docs/examples/authorization.mdx b/docs/examples/authorization.mdx index 29361acc..13f70ba7 100644 --- a/docs/examples/authorization.mdx +++ b/docs/examples/authorization.mdx @@ -36,6 +36,21 @@ test test::test ... ok test test::bad_data - should panic ... ok ``` +## Dependencies + +The authorization example uses the Soroban auth SDK, and has the following +Soroban dependencies in its Cargo.toml file. + +```toml title="authorization/src/Cargo.toml +[dependencies] +soroban-sdk = "0.0.4" +soroban-auth = "0.0.4" + +[dev_dependencies] +soroban-sdk = { version = "0.0.4", features = ["testutils"] } +soroban-auth = { version = "0.0.4", features = ["testutils"] } +``` + ## Code ```rust title="authorization/src/lib.rs"