From 24b8e5e7c2b88608744c877afb332af413457c82 Mon Sep 17 00:00:00 2001 From: Hinton Date: Fri, 8 Nov 2024 11:25:36 +0100 Subject: [PATCH 1/3] Update SDK docs after move to sdk-internal --- docs/getting-started/sdk/index.md | 87 +---------------- docs/getting-started/sdk/internal/index.md | 93 +++++++++++++++++++ .../sdk/secrets-manager/index.mdx | 38 +++++++- 3 files changed, 133 insertions(+), 85 deletions(-) create mode 100644 docs/getting-started/sdk/internal/index.md diff --git a/docs/getting-started/sdk/index.md b/docs/getting-started/sdk/index.md index e51a7c67..54ef04fe 100644 --- a/docs/getting-started/sdk/index.md +++ b/docs/getting-started/sdk/index.md @@ -5,92 +5,11 @@ sidebar_position: 5 # SDK Bitwarden provides a public Software Development Kit (SDK) for [Secrets Manager][sm] and an internal -SDK for the Bitwarden [Password Manager][pm]. The SDK is written in Rust and provides bindings for +SDK for the Bitwarden [Password Manager][pm]. The SDKs are written in Rust and provides bindings for multiple languages. -For more in-depth documentation please review the [SDK Architecture](../../architecture/sdk) page -and the project's [`README`](https://github.com/bitwarden/sdk). - -## Requirements - -- [Rust](https://www.rust-lang.org/tools/install) latest stable version - (preferably installed via - [rustup](https://rustup.rs/)) -- NodeJS and NPM. - -See the [Tools and Libraries](../tools/index.md) page for more information. - -## Setup instructions - -1. Clone the repository: - - ```bash - git clone https://github.com/bitwarden/sdk.git - cd sdk - ``` - -2. Install the dependencies: - - ```bash - npm ci - ``` - -## Building the SDK - -To build the SDK, run the following command: - -```bash -cargo build -``` - -## Linking the SDK to clients - -After modifying the SDK, it can be beneficial to test the changes in the client applications. To do -so you will need to update the SDK reference in the client applications. - -These instructions assumes you have a directory structure similar to: - -```text -sdk/ -clients/ -ios/ -android/ -``` - -### Web clients - -The web clients uses NPM to install the SDK as a dependency. NPM offers a dedicated command -[`link`][npm-link] which can be used to temporarily replace the packages with a local version. - -```bash -npm link ../sdk/languages/js/sdk-internal -``` - -:::warning - -Running `npm ci` or `npm install` will replace the linked packages with the published version. - -::: - -### Mobile - -#### Android - -1. Build and publish the SDK to the local Maven repository: - - ```bash - ../sdk/languages/kotlin/publish-local.sh - ``` - -2. Set the user property `localSdk=true` in the `user.properties` file. - -#### iOS - -Run the bootstrap script with the `LOCAL_SDK` environment variable set to true in order to use the -local SDK build: - -```bash -LOCAL_SDK=true ./Scripts/bootstrap.sh -``` +- [Internal SDK](./internal) +- [Secrets Manager SDK](./secrets-manager) [npm-link]: https://docs.npmjs.com/cli/v9/commands/npm-link [sm]: https://bitwarden.com/products/secrets-manager/ diff --git a/docs/getting-started/sdk/internal/index.md b/docs/getting-started/sdk/internal/index.md new file mode 100644 index 00000000..5e68de66 --- /dev/null +++ b/docs/getting-started/sdk/internal/index.md @@ -0,0 +1,93 @@ +--- +sidebar_position: 5 +--- + +# Internal SDK + +For more in-depth documentation please review the [SDK Architecture](../../architecture/sdk) and the +Internal SDK project's [`README`](https://github.com/bitwarden/sdk-internal). + +## Requirements + +- [Rust](https://www.rust-lang.org/tools/install) latest stable version - (preferably installed via + [rustup](https://rustup.rs/)) +- NodeJS and NPM. + +See the [Tools and Libraries](../tools/index.md) page for more information. + +## Setup instructions + +1. Clone the repository: + + ```bash + git clone https://github.com/bitwarden/sdk-internal.git + cd sdk + ``` + +2. Install the dependencies: + + ```bash + npm ci + ``` + +## Building the SDK + +To build the SDK, run the following command: + +```bash +cargo build +``` + +## Linking the SDK to clients + +After modifying the SDK, it can be beneficial to test the changes in the client applications. To do +so you will need to update the SDK reference in the client applications. + +These instructions assumes you have a directory structure similar to: + +```text +sdk/ +clients/ +ios/ +android/ +``` + +### Web clients + +The web clients uses NPM to install the SDK as a dependency. NPM offers a dedicated command +[`link`][npm-link] which can be used to temporarily replace the packages with a local version. + +```bash +npm link ../sdk-internal/languages/js/sdk-internal +``` + +:::warning + +Running `npm ci` or `npm install` will replace the linked packages with the published version. + +::: + +### Mobile + +#### Android + +1. Build and publish the SDK to the local Maven repository: + + ```bash + ../sdk-internal/languages/kotlin/publish-local.sh + ``` + +2. Set the user property `localSdk=true` in the `user.properties` file. + +#### iOS + +Run the bootstrap script with the `LOCAL_SDK` environment variable set to true in order to use the +local SDK build: + +```bash +LOCAL_SDK=true ./Scripts/bootstrap.sh +``` + +[npm-link]: https://docs.npmjs.com/cli/v9/commands/npm-link +[sm]: https://bitwarden.com/products/secrets-manager/ +[pm]: https://bitwarden.com/ diff --git a/docs/getting-started/sdk/secrets-manager/index.mdx b/docs/getting-started/sdk/secrets-manager/index.mdx index e4ba790a..486aa437 100644 --- a/docs/getting-started/sdk/secrets-manager/index.mdx +++ b/docs/getting-started/sdk/secrets-manager/index.mdx @@ -3,6 +3,40 @@ This section contains development information for the Bitwarden Secrets Manager CLI, language wrappers, and integrations based on the SDK. +For more in-depth documentation please review the [SDK Architecture](../../architecture/sdk), +Secrets Manager SDK project's [`README`](https://github.com/bitwarden/sdk). + +## Requirements + +- [Rust](https://www.rust-lang.org/tools/install) latest stable version - (preferably installed via + [rustup](https://rustup.rs/)) +- NodeJS and NPM. + +See the [Tools and Libraries](../tools/index.md) page for more information. + +## Setup instructions + +1. Clone the repository: + + ```bash + git clone https://github.com/bitwarden/sdk.git + cd sdk + ``` + +2. Install the dependencies: + + ```bash + npm ci + ``` + +## Building the SDK + +To build the SDK, run the following command: + +```bash +cargo build +``` + ## Web client To start the web client, follow the @@ -17,4 +51,6 @@ If you have enabled Secrets Manager for your org and do not see Secrets Manager switcher, you may need to manually enable it for your user by going to **Admin Console** -> **Members** -> check _"This user can access Secrets Manager"_ for your user. -::: ![Enable for user](enable-sm.png) +![Enable for user](enable-sm.png) + +::: From bf8c282c2df4c2dfafc39ab8c7615649ff7fa329 Mon Sep 17 00:00:00 2001 From: Hinton Date: Fri, 8 Nov 2024 14:53:53 +0100 Subject: [PATCH 2/3] Update to new path --- docs/getting-started/sdk/internal/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/sdk/internal/index.md b/docs/getting-started/sdk/internal/index.md index 5e68de66..2cc13a01 100644 --- a/docs/getting-started/sdk/internal/index.md +++ b/docs/getting-started/sdk/internal/index.md @@ -58,7 +58,7 @@ The web clients uses NPM to install the SDK as a dependency. NPM offers a dedica [`link`][npm-link] which can be used to temporarily replace the packages with a local version. ```bash -npm link ../sdk-internal/languages/js/sdk-internal +npm link ../sdk-internal/crates/bitwarden-wasm-internal/npm ``` :::warning @@ -74,7 +74,7 @@ Running `npm ci` or `npm install` will replace the linked packages with the publ 1. Build and publish the SDK to the local Maven repository: ```bash - ../sdk-internal/languages/kotlin/publish-local.sh + ../sdk-internal/crates/bitwarden-uniffi/kotlin/publish-local.sh ``` 2. Set the user property `localSdk=true` in the `user.properties` file. From b4ff7d45a832336003853dcf001f818710656dd0 Mon Sep 17 00:00:00 2001 From: Hinton Date: Fri, 8 Nov 2024 14:59:32 +0100 Subject: [PATCH 3/3] Fix paths --- docs/getting-started/sdk/internal/index.md | 6 +++--- docs/getting-started/sdk/secrets-manager/index.mdx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/getting-started/sdk/internal/index.md b/docs/getting-started/sdk/internal/index.md index 2cc13a01..c67023bd 100644 --- a/docs/getting-started/sdk/internal/index.md +++ b/docs/getting-started/sdk/internal/index.md @@ -4,8 +4,8 @@ sidebar_position: 5 # Internal SDK -For more in-depth documentation please review the [SDK Architecture](../../architecture/sdk) and the -Internal SDK project's [`README`](https://github.com/bitwarden/sdk-internal). +For more in-depth documentation please review the [SDK Architecture](../../../architecture/sdk) and +the Internal SDK project's [`README`](https://github.com/bitwarden/sdk-internal). ## Requirements @@ -13,7 +13,7 @@ Internal SDK project's [`README`](https://github.com/bitwarden/sdk-internal). [rustup](https://rustup.rs/)) - NodeJS and NPM. -See the [Tools and Libraries](../tools/index.md) page for more information. +See the [Tools and Libraries](../../tools/index.md) page for more information. ## Setup instructions diff --git a/docs/getting-started/sdk/secrets-manager/index.mdx b/docs/getting-started/sdk/secrets-manager/index.mdx index 486aa437..bfe3a3cc 100644 --- a/docs/getting-started/sdk/secrets-manager/index.mdx +++ b/docs/getting-started/sdk/secrets-manager/index.mdx @@ -3,7 +3,7 @@ This section contains development information for the Bitwarden Secrets Manager CLI, language wrappers, and integrations based on the SDK. -For more in-depth documentation please review the [SDK Architecture](../../architecture/sdk), +For more in-depth documentation please review the [SDK Architecture](../../../architecture/sdk), Secrets Manager SDK project's [`README`](https://github.com/bitwarden/sdk). ## Requirements @@ -12,7 +12,7 @@ Secrets Manager SDK project's [`README`](https://github.com/bitwarden/sdk). [rustup](https://rustup.rs/)) - NodeJS and NPM. -See the [Tools and Libraries](../tools/index.md) page for more information. +See the [Tools and Libraries](../../tools/index.md) page for more information. ## Setup instructions