From a76013c44829874ab0f8e20ba733693c3d9256ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:46:50 -0400 Subject: [PATCH 01/39] [deps]: Update System.Text.Json to 8.0.5 [SECURITY] (#1121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [System.Text.Json](https://dot.net/) ([source](https://redirect.github.com/dotnet/runtime)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/System.Text.Json/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/System.Text.Json/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/System.Text.Json/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/System.Text.Json/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [CVE-2024-43485](https://redirect.github.com/dotnet/runtime/security/advisories/GHSA-8g4q-xg66-9fp4) # Microsoft Security Advisory CVE-2024-43485 | .NET Denial of Service Vulnerability ## Executive summary Microsoft is releasing this security advisory to provide information about a vulnerability in System.Text.Json 6.0.x and 8.0.x. This advisory also provides guidance on what developers can do to update their applications to remove this vulnerability. In System.Text.Json 6.0.x and 8.0.x, applications which deserialize input to a model with an `[ExtensionData]` property can be vulnerable to an algorithmic complexity attack resulting in Denial of Service. ## Announcement Announcement for this issue can be found at [https://github.com/dotnet/announcements/issues/329](https://redirect.github.com/dotnet/announcements/issues/329) ## Mitigation factors JSON models which do not utilize the `[ExtensionData]` feature are not impacted by this vulnerability. ## Affected software * Any .NET 8.0 application running on .NET 8.0.8 or earlier. * Any .NET 6.0 aplication running on .NET 6.0.33 or earlier. * Any application consuming one of the [vulnerable packages](affected-packages). ## Affected Packages The vulnerability affects any Microsoft .NET Core project if it uses any of affected packages versions listed below ### .NET 8 Package name | Affected version | Patched version ------------ | ---------------- | ------------------------- [System.Text.Json](https://www.nuget.org/packages/System.Text.Json) | >= 8.0.0, <= 8.0.4 | 8.0.5 ### .NET 6 Package name | Affected version | Patched version ------------ | ---------------- | ------------------------- [System.Text.Json](https://www.nuget.org/packages/System.Text.Json) | >= 6.0.0, <= 6.0.9 | 6.0.10 ## Advisory FAQ ### How do I know if I am affected? If you have a runtime or SDK with a version listed, or an affected package listed in [affected software](#affected-packages) or [affected packages](#affected-software), you're exposed to the vulnerability. ### How do I fix the issue? * To fix the issue please install the latest version of .NET 8.0 or .NET 6.0. If you have installed one or more .NET SDKs through Visual Studio, Visual Studio will prompt you to update Visual Studio, which will also update your .NET SDKs. * .NET Framework-based applications and other application types need to perform a package update. * If you have .NET 6.0 or greater installed, you can list the versions you have installed by running the `dotnet --info` command. You will see output like the following; ``` .NET Core SDK (reflecting any global.json): Version: 8.0.200 Commit: 8473146e7d Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.300\ Host (useful for support): Version: 8.0.3 Commit: 8473146e7d .NET Core SDKs installed: 8.0.200 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspAspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspAspNetCore.App] Microsoft.AspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.WindowsDesktop.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download ``` * If you're using .NET 6.0, you should download and install .NET 6.0.35 Runtime or .NET 6.0.135 SDK (for Visual Studio 2022 v17.6) from https://dotnet.microsoft.com/download/dotnet-core/6.0. * If you're using .NET 8.0, you should download and install .NET 8.0.10 Runtime or .NET 8.0.110 SDK (for Visual Studio 2022 v17.8) from https://dotnet.microsoft.com/download/dotnet-core/8.0. .NET 8.0 and .NET 6.0 updates are also available from Microsoft Update. To access this either type "Check for updates" in your Windows search, or open Settings, choose Update & Security and then click Check for Updates. Once you have installed the updated runtime or SDK, restart your apps for the update to take effect. Additionally, if you've deployed [self-contained applications](https://docs.microsoft.com/dotnet/core/deploying/#self-contained-deployments-scd) targeting any of the impacted versions, these applications are also vulnerable and must be recompiled and redeployed. ## Other Information ### Reporting Security Issues If you have found a potential security issue in .NET 8.0 or .NET 6.0, please email details to secure@microsoft.com. Reports may qualify for the Microsoft .NET Core & .NET 5 Bounty. Details of the Microsoft .NET Bounty Program including terms and conditions are at . ### Support You can ask questions about this issue on GitHub in the .NET GitHub organization. The main repos are located at https://github.com/dotnet/runtime and https://github.com/dotnet/aspnet/. The Announcements repo (https://github.com/dotnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue. You can ask questions in the linked discussion issue. ### Disclaimer The information provided in this advisory is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply. ### External Links [CVE-2024-43485]( https://www.cve.org/CVERecord?id=CVE-2024-43485) ### Revisions V1.0 (October 08, 2024): Advisory published. _Version 1.0_ _Last Updated 2024-10-08_ --- ### Release Notes
dotnet/runtime (System.Text.Json) ### [`v8.0.5`](https://redirect.github.com/dotnet/runtime/releases/tag/v8.0.5): .NET 8.0.5 [Release](https://redirect.github.com/dotnet/core/releases/tag/v8.0.5) #### What's Changed - \[release/8.0-staging] Fix AsyncVoidMethodBuilder race condition around SynchronizationContext by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99640](https://redirect.github.com/dotnet/runtime/pull/99640) - \[release/8.0-staging] Always keep global symbols on ApplePlatforms by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99650](https://redirect.github.com/dotnet/runtime/pull/99650) - \[release/8.0-staging] Delete Decrypt_Pkcs1\_ErrorsForInvalidPadding by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99653](https://redirect.github.com/dotnet/runtime/pull/99653) - \[8.0] Rename MSBuild property MicrosoftNativeQuicMsQuicVersion -> MicrosoftNativeQuicMsQuicSchannelVersion by [@​carlossanlop](https://redirect.github.com/carlossanlop) in [https://github.com/dotnet/runtime/pull/99714](https://redirect.github.com/dotnet/runtime/pull/99714) - \[release/8.0] Fixing SignedXml.CheckSignature for enveloped signature with `#xpointer(/)` Reference by [@​bartonjs](https://redirect.github.com/bartonjs) in [https://github.com/dotnet/runtime/pull/99651](https://redirect.github.com/dotnet/runtime/pull/99651) - \[release/8.0-staging] disable optimizations for PopCount by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99832](https://redirect.github.com/dotnet/runtime/pull/99832) - \[release/8.0-staging] Handle NativeOverlapped\* coming from both the Windows or Portable thread pool in NativeRuntimeEventSource by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99656](https://redirect.github.com/dotnet/runtime/pull/99656) - \[release/8.0-staging] Fix exporting certificate keys on macOS 14.4. by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99776](https://redirect.github.com/dotnet/runtime/pull/99776) - \[release/8.0] Upgrade zlib to 1.3.1 by [@​carlossanlop](https://redirect.github.com/carlossanlop) in [https://github.com/dotnet/runtime/pull/99473](https://redirect.github.com/dotnet/runtime/pull/99473) - \[release/8.0] Fix failing CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback test ([#​99915](https://redirect.github.com/dotnet/runtime/issues/99915)) by [@​rzikm](https://redirect.github.com/rzikm) in [https://github.com/dotnet/runtime/pull/99950](https://redirect.github.com/dotnet/runtime/pull/99950) - \[mono] Stop exporting ICU symbols from Mono by [@​matouskozak](https://redirect.github.com/matouskozak) in [https://github.com/dotnet/runtime/pull/99449](https://redirect.github.com/dotnet/runtime/pull/99449) - \[release/8.0-staging] Fix AV in HttpTelemetry.WriteEvent by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99607](https://redirect.github.com/dotnet/runtime/pull/99607) - \[release/8.0-staging] \[HTTP/2] Fix handling of effectively empty DATA frame ([#​99502](https://redirect.github.com/dotnet/runtime/issues/99502)) by [@​ManickaP](https://redirect.github.com/ManickaP) in [https://github.com/dotnet/runtime/pull/99677](https://redirect.github.com/dotnet/runtime/pull/99677) - \[release/8.0-staging] \[HttpStress] \[SslStress] Workaround image bug in 1es-windows-2022-open by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100303](https://redirect.github.com/dotnet/runtime/pull/100303) - \[release/8.0-staging] Support building against clang 18 by [@​omajid](https://redirect.github.com/omajid) in [https://github.com/dotnet/runtime/pull/100258](https://redirect.github.com/dotnet/runtime/pull/100258) - \[release/8.0]\[browser] WebSocket works differently depending on if we look up its state or not by [@​ilonatommy](https://redirect.github.com/ilonatommy) in [https://github.com/dotnet/runtime/pull/99673](https://redirect.github.com/dotnet/runtime/pull/99673) - \[release/8.0-staging] Call the Copy Constructor for stack arguments in C++/CLI on x86 by [@​AaronRobinsonMSFT](https://redirect.github.com/AaronRobinsonMSFT) in [https://github.com/dotnet/runtime/pull/100221](https://redirect.github.com/dotnet/runtime/pull/100221) - \[release/8.0] Don't unset ALPN list pointer during ALPN selection callback. by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99670](https://redirect.github.com/dotnet/runtime/pull/99670) - \[release/8.0-staging]\[mono]\[debugger] Fix inspect Span by [@​thaystg](https://redirect.github.com/thaystg) in [https://github.com/dotnet/runtime/pull/99844](https://redirect.github.com/dotnet/runtime/pull/99844) - Update branding to 8.0.5 by [@​vseanreesermsft](https://redirect.github.com/vseanreesermsft) in [https://github.com/dotnet/runtime/pull/100547](https://redirect.github.com/dotnet/runtime/pull/100547) - \[release/8.0-staging] Ensure that Sse3.MoveAndDuplicate correctly tracks supporting SIMD scalar loads by [@​tannergooding](https://redirect.github.com/tannergooding) in [https://github.com/dotnet/runtime/pull/100417](https://redirect.github.com/dotnet/runtime/pull/100417) - \[release/8.0] Avoid allocating collectible instances in the frozen heap ([#​100444](https://redirect.github.com/dotnet/runtime/issues/100444)) by [@​jkotas](https://redirect.github.com/jkotas) in [https://github.com/dotnet/runtime/pull/100509](https://redirect.github.com/dotnet/runtime/pull/100509) - \[release/8.0-staging] Use clang --version to get Apple toolset version by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100199](https://redirect.github.com/dotnet/runtime/pull/100199) - \[release/8.0-staging] Azure Linux 3.0 deps package by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100684](https://redirect.github.com/dotnet/runtime/pull/100684) - \[release/8.0-staging] Fix Http2 deadlock by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100086](https://redirect.github.com/dotnet/runtime/pull/100086) - Merging internal commits for release/8.0 by [@​vseanreesermsft](https://redirect.github.com/vseanreesermsft) in [https://github.com/dotnet/runtime/pull/100835](https://redirect.github.com/dotnet/runtime/pull/100835) - \[release/8.0-staging] Update CI builds to not use VS Previews by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100622](https://redirect.github.com/dotnet/runtime/pull/100622) - \[release/8.0-staging] Update dependencies from dotnet/hotreload-utils by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100892](https://redirect.github.com/dotnet/runtime/pull/100892) - \[release/8.0-staging] Update dependencies from dotnet/runtime-assets by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100073](https://redirect.github.com/dotnet/runtime/pull/100073) - \[automated] Merge branch 'release/8.0' => 'release/8.0-staging' by [@​dotnet-maestro-bot](https://redirect.github.com/dotnet-maestro-bot) in [https://github.com/dotnet/runtime/pull/99585](https://redirect.github.com/dotnet/runtime/pull/99585) - \[release/8.0-staging] Update dependencies from dotnet/source-build-externals by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/99601](https://redirect.github.com/dotnet/runtime/pull/99601) - \[release/8.0-staging] Update dependencies from dotnet/xharness by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100883](https://redirect.github.com/dotnet/runtime/pull/100883) - \[release/8.0-staging] Update dependencies from dotnet/source-build-reference-packages by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/99902](https://redirect.github.com/dotnet/runtime/pull/99902) - \[release/8.0-staging] Update dependencies from dotnet/source-build-externals by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100015](https://redirect.github.com/dotnet/runtime/pull/100015) - \[release/8.0-staging] Update dependencies from dotnet/runtime-assets by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100958](https://redirect.github.com/dotnet/runtime/pull/100958) - \[release/8.0-staging] Update dependencies from dotnet/arcade by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/100885](https://redirect.github.com/dotnet/runtime/pull/100885) - \[release/8.0-staging] Fix native leak in CryptoNative_GetX509nameInfo by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100793](https://redirect.github.com/dotnet/runtime/pull/100793) - \[release/8.0-staging] Update dependencies from dotnet/emsdk by [@​dotnet-maestro](https://redirect.github.com/dotnet-maestro) in [https://github.com/dotnet/runtime/pull/99696](https://redirect.github.com/dotnet/runtime/pull/99696) - \[release/8.0-staging] \[mono]\[debugger] Search for seqpoints directly from jitinfo if it's not find on get_default_jit_mm by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100978](https://redirect.github.com/dotnet/runtime/pull/100978) - \[release/8.0]\[browser] fix emscripten out/err overrides by [@​pavelsavara](https://redirect.github.com/pavelsavara) in [https://github.com/dotnet/runtime/pull/100818](https://redirect.github.com/dotnet/runtime/pull/100818) - \[release/8.0-staging] \[mono]\[eventpipe] Fix firing dynamic method wrappers crash by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/99712](https://redirect.github.com/dotnet/runtime/pull/99712) - Update Alpine versions for `release/8.0-staging` by [@​richlander](https://redirect.github.com/richlander) in [https://github.com/dotnet/runtime/pull/99849](https://redirect.github.com/dotnet/runtime/pull/99849) - \[release/8.0-staging] Guard against -1 Returned from sysconf for the Cache Sizes Causing Large Gen0 Sizes and Budgets for Certain Linux Distributions. by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100575](https://redirect.github.com/dotnet/runtime/pull/100575) - \[Release/8.0] Remove preventing EH at shutdown by [@​janvorli](https://redirect.github.com/janvorli) in [https://github.com/dotnet/runtime/pull/100836](https://redirect.github.com/dotnet/runtime/pull/100836) - \[release/8.8] Add metadata for workload automation by [@​joeloff](https://redirect.github.com/joeloff) in [https://github.com/dotnet/runtime/pull/100649](https://redirect.github.com/dotnet/runtime/pull/100649) - \[8.0] Reset OOB packages enabled in the April release by [@​carlossanlop](https://redirect.github.com/carlossanlop) in [https://github.com/dotnet/runtime/pull/99583](https://redirect.github.com/dotnet/runtime/pull/99583) - \[release/8.0-staging] Always zero-init if object contains pointers by [@​VSadov](https://redirect.github.com/VSadov) in [https://github.com/dotnet/runtime/pull/100426](https://redirect.github.com/dotnet/runtime/pull/100426) - \[release/8.0-staging] JIT: Fixed incorrect reversed condition for GT by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/100372](https://redirect.github.com/dotnet/runtime/pull/100372) - \[manual] Merge release/8.0-staging into release/8.0 by [@​directhex](https://redirect.github.com/directhex) in [https://github.com/dotnet/runtime/pull/101091](https://redirect.github.com/dotnet/runtime/pull/101091) - \[release/8.0] \[release/8.0] Update MicrosoftBuildVersion to latest by [@​github-actions](https://redirect.github.com/github-actions) in [https://github.com/dotnet/runtime/pull/101145](https://redirect.github.com/dotnet/runtime/pull/101145) **Full Changelog**: https://github.com/dotnet/runtime/compare/v8.0.4...v8.0.5
--- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj b/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj index d2363f4a..a7c82e4b 100644 --- a/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj +++ b/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj @@ -25,7 +25,7 @@ - + From 89b23bd85ea09f3af43a41e216cfd7fe9917b188 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:02:59 +0200 Subject: [PATCH 02/39] [deps]: Lock file maintenance (#1125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. đŸ‘ģ **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 190 +++++++++++----------- languages/js/sdk-client/package-lock.json | 12 +- package-lock.json | 18 +- 3 files changed, 111 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e0d1411..5397271c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -861,9 +861,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.22" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "shlex", ] @@ -935,9 +935,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -945,9 +945,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -957,9 +957,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.29" +version = "4.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" +checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" dependencies = [ "clap", ] @@ -984,9 +984,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clap_mangen" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17415fd4dfbea46e3274fcd8d368284519b358654772afb700dc2e8d2b24eeb" +checksum = "fbae9cbfdc5d4fa8711c09bd7b83f644cb48281ac35bf97af3e47b0675864bdf" dependencies = [ "clap", "roff", @@ -1414,18 +1414,18 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ "darling", "proc-macro2", @@ -1435,9 +1435,9 @@ dependencies = [ [[package]] name = "derive_builder_macro" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", "syn 2.0.79", @@ -1652,9 +1652,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1667,9 +1667,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1677,15 +1677,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1694,15 +1694,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1711,21 +1711,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1840,7 +1840,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1869,6 +1869,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "heck" version = "0.4.1" @@ -1962,9 +1968,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2093,12 +2099,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -2137,9 +2143,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -2210,9 +2216,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" dependencies = [ "wasm-bindgen", ] @@ -2551,12 +2557,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "onig" @@ -2706,7 +2709,7 @@ dependencies = [ "coset", "data-encoding", "getrandom", - "indexmap 2.5.0", + "indexmap 2.6.0", "rand", "serde", "serde_json", @@ -2816,7 +2819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64", - "indexmap 2.5.0", + "indexmap 2.6.0", "quick-xml", "serde", "time", @@ -2906,9 +2909,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3110,9 +3113,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -3159,9 +3162,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", @@ -3287,9 +3290,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", "ring", @@ -3314,11 +3317,10 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", "rustls-pki-types", ] @@ -3389,9 +3391,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -3564,7 +3566,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -3616,15 +3618,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -3634,9 +3636,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", @@ -3650,7 +3652,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -4122,7 +4124,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4223,9 +4225,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -4313,9 +4315,9 @@ dependencies = [ [[package]] name = "uniffi_checksum_derive" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22dbe67c1c957ac6e7611bdf605a6218aa86b0eebeb8be58b70ae85ad7d73dc" +checksum = "d2c801f0f05b06df456a2da4c41b9c2c4fdccc6b9916643c6c67275c4c9e4d07" dependencies = [ "quote", "syn 2.0.79", @@ -4507,9 +4509,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" dependencies = [ "cfg-if", "once_cell", @@ -4520,9 +4522,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" dependencies = [ "bumpalo", "log", @@ -4535,9 +4537,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" dependencies = [ "cfg-if", "js-sys", @@ -4547,9 +4549,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4557,9 +4559,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" dependencies = [ "proc-macro2", "quote", @@ -4570,15 +4572,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" [[package]] name = "wasm-bindgen-test" -version = "0.3.43" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9" +checksum = "a93d2a9ae98f1af8953f6415397299d808cce0a24f6d7c613d27bd83edf98da8" dependencies = [ "console_error_panic_hook", "js-sys", @@ -4591,9 +4593,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.43" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" +checksum = "fb8b294691f640bad8f2bb35a11bb28272701b1d687bd5fd661a27684e894d4d" dependencies = [ "proc-macro2", "quote", @@ -4602,9 +4604,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/languages/js/sdk-client/package-lock.json b/languages/js/sdk-client/package-lock.json index f5b6f590..5911a333 100644 --- a/languages/js/sdk-client/package-lock.json +++ b/languages/js/sdk-client/package-lock.json @@ -30,9 +30,9 @@ } }, "node_modules/@types/node": { - "version": "20.16.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", - "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", + "version": "20.16.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", + "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", "dev": true, "license": "MIT", "dependencies": { @@ -436,9 +436,9 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package-lock.json b/package-lock.json index 9ceb5ffe..3d3e1669 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,9 +19,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", - "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", "dev": true, "license": "MIT", "dependencies": { @@ -359,9 +359,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "dev": true, "license": "MIT", "peer": true, @@ -1069,9 +1069,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, "license": "MIT", "dependencies": { From 4e341e55541f9c9f70c765c4a2d9ac8e98d3a750 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 10 Oct 2024 05:46:39 -0400 Subject: [PATCH 03/39] BRE-359 - Update Build C++ workflow (#1123) --- .github/workflows/build-cpp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 01222aac..68636936 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -95,7 +95,6 @@ jobs: working-directory: languages/cpp shell: bash run: | - mv include/release/* include/ if [[ '${{ runner.os }}' == 'macOS' || '${{ runner.os }}' == 'Linux' ]]; then ls include/libbitwarden_c.* || { echo "Missing libbitwarden_c.*"; exit 1; } fi @@ -103,7 +102,6 @@ jobs: ls include/bitwarden_c.dll || { echo "Missing bitwarden_c.dll"; exit 1; } ls include/bitwarden_c.dll.lib || { echo "Missing bitwarden_c.dll.lib"; exit 1; } fi - rmdir include/release - name: Build unix working-directory: languages/cpp From 7e663e9cfa88782ccb45376690c5dca41c0b1711 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 10 Oct 2024 13:36:42 +0200 Subject: [PATCH 04/39] Remove the old doc script (#1126) --- crates/bitwarden-uniffi/README.md | 12 --- crates/bitwarden-uniffi/src/docs.rs | 49 ---------- crates/bitwarden-uniffi/src/lib.rs | 3 - crates/sdk-schemas/Cargo.toml | 6 +- crates/sdk-schemas/src/main.rs | 3 - package-lock.json | 64 ------------- package.json | 1 - support/docs/docs.ts | 139 ---------------------------- support/docs/rustdoc.ts | 12 --- support/docs/template.hbs | 91 ------------------ 10 files changed, 1 insertion(+), 379 deletions(-) delete mode 100644 crates/bitwarden-uniffi/src/docs.rs delete mode 100644 support/docs/docs.ts delete mode 100644 support/docs/rustdoc.ts delete mode 100644 support/docs/template.hbs diff --git a/crates/bitwarden-uniffi/README.md b/crates/bitwarden-uniffi/README.md index 4b2e6171..c2e4d6c4 100644 --- a/crates/bitwarden-uniffi/README.md +++ b/crates/bitwarden-uniffi/README.md @@ -1,13 +1 @@ # Bitwarden-uniffi - -## Generating documentation - -If desired we have some scripts that generates markdown documentation from the rustdoc output. - -```bash -cargo +nightly rustdoc -p bitwarden -- -Zunstable-options --output-format json -cargo +nightly rustdoc -p bitwarden-uniffi -- -Zunstable-options --output-format json -npm run schemas - -npx ts-node ./support/docs/docs.ts > doc.md -``` diff --git a/crates/bitwarden-uniffi/src/docs.rs b/crates/bitwarden-uniffi/src/docs.rs deleted file mode 100644 index 5edbc714..00000000 --- a/crates/bitwarden-uniffi/src/docs.rs +++ /dev/null @@ -1,49 +0,0 @@ -use bitwarden::{ - auth::password::MasterPasswordPolicyOptions, - exporters::ExportFormat, - generators::{PassphraseGeneratorRequest, PasswordGeneratorRequest}, - mobile::crypto::{InitOrgCryptoRequest, InitUserCryptoRequest}, - platform::FingerprintRequest, - send::{Send, SendListView, SendView}, - vault::{Cipher, CipherView, Collection, Folder, FolderView, TotpResponse}, -}; -use bitwarden_crypto::{HashPurpose, Kdf}; -use schemars::JsonSchema; - -#[derive(JsonSchema)] -#[allow(clippy::large_enum_variant)] -pub enum DocRef { - // Vault - Cipher(Cipher), - CipherView(CipherView), - Collection(Collection), - Folder(Folder), - FolderView(FolderView), - Send(Send), - SendView(SendView), - SendListView(SendListView), - - // Crypto - InitUserCryptoRequest(InitUserCryptoRequest), - InitOrgCryptoRequest(InitOrgCryptoRequest), - HashPurpose(HashPurpose), - - // Generators - PasswordGeneratorRequest(PasswordGeneratorRequest), - PassphraseGeneratorRequest(PassphraseGeneratorRequest), - - // Exporters - ExportFormat(ExportFormat), - - // Platform - FingerprintRequest(FingerprintRequest), - - // Auth - MasterPasswordPolicyOptions(MasterPasswordPolicyOptions), - - // Kdf - Kdf(Kdf), - - /// TOTP - TotpResponse(TotpResponse), -} diff --git a/crates/bitwarden-uniffi/src/lib.rs b/crates/bitwarden-uniffi/src/lib.rs index 0d89ffdb..a9eb6a3e 100644 --- a/crates/bitwarden-uniffi/src/lib.rs +++ b/crates/bitwarden-uniffi/src/lib.rs @@ -13,9 +13,6 @@ pub mod tool; mod uniffi_support; pub mod vault; -#[cfg(feature = "docs")] -pub mod docs; - #[cfg(target_os = "android")] mod android_support; diff --git a/crates/sdk-schemas/Cargo.toml b/crates/sdk-schemas/Cargo.toml index 8d48cd69..b4dd496a 100644 --- a/crates/sdk-schemas/Cargo.toml +++ b/crates/sdk-schemas/Cargo.toml @@ -12,11 +12,7 @@ license-file.workspace = true keywords.workspace = true [features] -internal = [ - "bitwarden/internal", - "bitwarden-json/internal", - "bitwarden-uniffi/docs", -] +internal = ["bitwarden/internal", "bitwarden-json/internal"] [dependencies] anyhow = "1.0.82" diff --git a/crates/sdk-schemas/src/main.rs b/crates/sdk-schemas/src/main.rs index 94959fa6..66683256 100644 --- a/crates/sdk-schemas/src/main.rs +++ b/crates/sdk-schemas/src/main.rs @@ -121,8 +121,5 @@ struct SchemaTypes { fn main() -> Result<()> { write_schema_for!("schema_types", SchemaTypes); - #[cfg(feature = "internal")] - write_schema_for!(bitwarden_uniffi::docs::DocRef); - Ok(()) } diff --git a/package-lock.json b/package-lock.json index 3d3e1669..894ec74e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "SEE LICENSE IN LICENSE", "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.4", - "handlebars": "^4.7.8", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", @@ -1144,28 +1143,6 @@ "dev": true, "license": "ISC" }, - "node_modules/handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1450,16 +1427,6 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -1484,13 +1451,6 @@ "dev": true, "license": "ISC" }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "license": "MIT" - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -1939,16 +1899,6 @@ "dev": true, "license": "ISC" }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", @@ -2158,20 +2108,6 @@ "node": ">=14.17" } }, - "node_modules/uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "dev": true, - "license": "BSD-2-Clause", - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/uid": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", diff --git a/package.json b/package.json index 8f40e36a..e7e41946 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.4", - "handlebars": "^4.7.8", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", diff --git a/support/docs/docs.ts b/support/docs/docs.ts deleted file mode 100644 index 067ff082..00000000 --- a/support/docs/docs.ts +++ /dev/null @@ -1,139 +0,0 @@ -// Quick script that parses the rustdoc json output and generates a basic markdown documentation. -// -// Do note that this script follows no best practices and will not handle anything many edge cases. - -import fs from "fs"; -import path from "path"; -import Handlebars from "handlebars"; - -import { Input, InputType } from "./rustdoc"; - -const doc = JSON.parse(fs.readFileSync("./target/doc/bitwarden_uniffi.json", "utf8")); -const command = JSON.parse( - fs.readFileSync("./support/schemas/bitwarden_uniffi/DocRef.json", "utf8"), -); - -const template = Handlebars.compile( - fs.readFileSync(path.resolve(__dirname, "template.hbs"), "utf8"), -); - -// Modify this to include more root elements -const rootElements = [ - "Client", - "ClientAuth", - "ClientAttachments", - "ClientCiphers", - "ClientCollections", - "ClientCrypto", - "ClientExporters", - "ClientFolders", - "ClientGenerators", - "ClientPasswordHistory", - "ClientPlatform", - "ClientSends", - "ClientVault", -]; - -const localIndexArray = Object.values(doc.index).filter((entry: any) => entry.crate_id == 0); -const localIndex = localIndexArray.reduce((map: any, obj: any) => { - map[obj.id] = obj; - return map; -}, {}) as Record; - -let usedDefinitions: any[] = []; - -const out = rootElements.map((rootElement) => { - const root: any = localIndexArray.find((entry: any) => entry.name == rootElement); - const impls = root.inner.struct.impls; - - const elements = impls - .flatMap((e: any) => localIndex[e]) - .flatMap((e: any) => e.inner.impl.items) - .map((e: any) => localIndex[e]) - .filter((e: any) => e?.docs != null); - - return { - name: rootElement, - elements: elements.map((e: any) => { - return { - name: e.name, - docs: e.docs, - args: e.inner.function.decl.inputs.map((e: any) => map_input(e)), - output: map_type(e.inner.function.decl.output), - }; - }), - }; -}); - -function stripDef(str: string) { - return str.replace(/#\/definitions\//g, ""); -} - -Handlebars.registerHelper("stripDef", (str: string) => { - return stripDef(str); -}); - -// Add references -for (let i = 0; i < usedDefinitions.length; i++) { - const key = usedDefinitions[i]; - const cmd = command.definitions[key]; - if (cmd == null) { - continue; - } - - Object.entries(cmd.properties ?? {}).forEach((prop: any) => { - prop[1].allOf?.forEach((e: any) => { - usedDefinitions.push(stripDef(e["$ref"] as string)); - }); - }); -} - -const filteredDefinitions = [...new Set(usedDefinitions)] - .sort() - .map((key) => [key, command.definitions[key]]) - .filter((e) => e[1] != null) - .reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {}); - -console.log(template({ sections: out, commands: filteredDefinitions })); - -/// -/// Implementation details below. -/// - -// Format -function map_input(input: Input) { - return { - name: input[0], - type: map_type(input[1]), - }; -} - -function map_type(t: InputType) { - const args = t.resolved_path?.args; - const name = t.resolved_path?.name; - - let out = ""; - - if (name) { - usedDefinitions.push(name); - - if (command.definitions[name] != null) { - out += `[${name}](#${name.toLowerCase()})`; - } else { - out += name; - } - } - - if (args != null && args.angle_bracketed.args.length > 0) { - out += "<"; - out += args.angle_bracketed.args.map((t: any) => { - if (t.type.generic) { - return t.type.generic; - } else if (t.type.resolved_path) { - return t.type.resolved_path.name; - } - }); - out += ">"; - } - return out; -} diff --git a/support/docs/rustdoc.ts b/support/docs/rustdoc.ts deleted file mode 100644 index 2622b711..00000000 --- a/support/docs/rustdoc.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type Input = [string, InputType]; - -export type InputType = { - resolved_path?: { - name: string; - args: { - angle_bracketed: { - args: any[]; - }; - }; - }; -}; diff --git a/support/docs/template.hbs b/support/docs/template.hbs deleted file mode 100644 index bd78d138..00000000 --- a/support/docs/template.hbs +++ /dev/null @@ -1,91 +0,0 @@ -# Bitwarden Mobile SDK - -Auto generated documentation for the Bitwarden Mobile SDK. For more information please refer to -the rust crates `bitwarden` and `bitwarden-uniffi`. For code samples check the -`languages/kotlin/app` and `languages/swift/app` directories. - -{{#each sections}} - -## {{name}} - -{{#each elements}} -### `{{name}}` -{{docs}} - -**Arguments**: -{{#each args}} -- {{name}}: {{{type}}} -{{/each}} - -**Output**: {{{output}}} - -{{/each}} -{{/each}} - -# References - -References are generated from the JSON schemas and should mostly match the kotlin and swift -implementations. - -{{#each commands}} - -## `{{@key}}` - -{{#if oneOf}} - - - - - - -{{#each oneOf}} -{{#each properties}} - - - - - -{{#if properties}} - - - -{{/if}} -{{/each}} -{{/each}} -
KeyTypeDescription
{{@key}}{{type}}
- - - - - - - {{#each properties}} - - - - - - {{/each}} -
KeyTypeDescription
{{@key}}{{type}}{{{description}}}
-
- -{{/if}} - -{{#unless oneOf}} - - - - - - -{{#each properties}} - - - - - -{{/each}} -
KeyTypeDescription
{{@key}}{{type}}{{description}}
-{{/unless}} - -{{/each}} From 0ae6d73e6b066bac69dd3769e643137a2bec119c Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 10 Oct 2024 17:00:06 +0200 Subject: [PATCH 05/39] fix: .editorconfig not being applied properly (#1127) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking ## 📔 Objective `[*.{ts}]` -> `[*.ts]` ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- .editorconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 28ef180e..33fa272b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,10 +12,10 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.{ts}] -quote_type = single +[*.ts] +quote_type = double -[*.{rs}] +[*.rs] indent_style = space indent_size = 4 @@ -23,6 +23,6 @@ indent_size = 4 indent_style = space indent_size = 4 -[*.{xml}] +[*.xml] # VS Code XML extension removes the final newline insert_final_newline = false From 7e90f52cfd9fe3741816962cb3555cac40627ad4 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 11 Oct 2024 13:09:52 +0200 Subject: [PATCH 06/39] [PM-13371] Repository split - Avoid depdending on Bitwarden (#1124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking Epic: https://bitwarden.atlassian.net/browse/PM-13370 Phase: https://bitwarden.atlassian.net/browse/PM-13371 ## 📔 Objective Decouples our internal crates from depending on the public `bitwarden` crate. `uniffi`, `wasm-internal` and `bw` now depends directly on feature crates. --- .github/workflows/build-rust-crates.yml | 6 -- Cargo.lock | 12 +--- crates/bitwarden-json/Cargo.toml | 3 +- crates/bitwarden-json/src/client.rs | 14 ---- crates/bitwarden-json/src/command.rs | 46 ------------- crates/bitwarden-uniffi/Cargo.toml | 4 +- crates/bitwarden-uniffi/src/auth/mod.rs | 2 +- crates/bitwarden-uniffi/src/crypto.rs | 2 +- crates/bitwarden-uniffi/src/error.rs | 52 +++++++++++++-- crates/bitwarden-uniffi/src/lib.rs | 10 +-- crates/bitwarden-uniffi/src/platform/fido2.rs | 41 ++++++------ crates/bitwarden-uniffi/src/platform/mod.rs | 2 +- crates/bitwarden-uniffi/src/tool/mod.rs | 18 ++--- crates/bitwarden-uniffi/src/tool/sends.rs | 2 +- crates/bitwarden-uniffi/src/uniffi_support.rs | 8 ++- .../bitwarden-uniffi/src/vault/attachments.rs | 2 +- crates/bitwarden-uniffi/src/vault/ciphers.rs | 8 +-- .../bitwarden-uniffi/src/vault/collections.rs | 2 +- crates/bitwarden-uniffi/src/vault/folders.rs | 2 +- crates/bitwarden-uniffi/src/vault/mod.rs | 11 ++-- .../src/vault/password_history.rs | 2 +- crates/bitwarden-wasm-internal/Cargo.toml | 2 +- crates/bitwarden-wasm/Cargo.toml | 5 +- crates/bitwarden/Cargo.toml | 23 ------- crates/bitwarden/src/error.rs | 66 +------------------ crates/bitwarden/src/lib.rs | 29 +------- crates/bw/Cargo.toml | 4 +- crates/bw/src/auth/login.rs | 6 +- crates/bw/src/main.rs | 15 ++--- crates/sdk-schemas/Cargo.toml | 1 - crates/sdk-schemas/src/main.rs | 7 -- support/scripts/schemas.ts | 12 ---- 32 files changed, 124 insertions(+), 295 deletions(-) diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index d4116bcf..8400fcbf 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -49,12 +49,6 @@ jobs: env: RUSTFLAGS: "-D warnings" - - name: Build Internal - if: ${{ matrix.package == 'bitwarden' }} - run: cargo build -p ${{ matrix.package }} --features internal --release - env: - RUSTFLAGS: "-D warnings" - release-dry-run: name: Release dry-run runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 5397271c..024abbe0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -362,16 +362,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" name = "bitwarden" version = "1.0.0" dependencies = [ - "bitwarden-api-api", - "bitwarden-api-identity", "bitwarden-core", - "bitwarden-crypto", - "bitwarden-exporters", - "bitwarden-fido", "bitwarden-generators", - "bitwarden-send", "bitwarden-sm", - "bitwarden-vault", "thiserror", "uuid", ] @@ -623,7 +616,6 @@ version = "0.1.0" dependencies = [ "android_logger", "async-trait", - "bitwarden", "bitwarden-core", "bitwarden-crypto", "bitwarden-exporters", @@ -746,9 +738,11 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" name = "bw" version = "0.0.2" dependencies = [ - "bitwarden", "bitwarden-cli", + "bitwarden-core", "bitwarden-crypto", + "bitwarden-generators", + "bitwarden-vault", "clap", "color-eyre", "env_logger", diff --git a/crates/bitwarden-json/Cargo.toml b/crates/bitwarden-json/Cargo.toml index ed1b3958..b5b8052b 100644 --- a/crates/bitwarden-json/Cargo.toml +++ b/crates/bitwarden-json/Cargo.toml @@ -16,8 +16,7 @@ repository.workspace = true license-file.workspace = true [features] -internal = ["bitwarden/internal"] # Internal testing methods -secrets = ["bitwarden/secrets"] # Secrets manager API +secrets = ["bitwarden/secrets"] # Secrets manager API [dependencies] bitwarden = { workspace = true } diff --git a/crates/bitwarden-json/src/client.rs b/crates/bitwarden-json/src/client.rs index dc84c559..8da635a2 100644 --- a/crates/bitwarden-json/src/client.rs +++ b/crates/bitwarden-json/src/client.rs @@ -1,5 +1,3 @@ -#[cfg(feature = "internal")] -use bitwarden::vault::ClientVaultExt; use bitwarden::ClientSettings; #[cfg(feature = "secrets")] use bitwarden::{ @@ -54,22 +52,10 @@ impl Client { let client = &self.0; match cmd { - #[cfg(feature = "internal")] - Command::PasswordLogin(req) => client.auth().login_password(&req).await.into_string(), #[cfg(feature = "secrets")] Command::LoginAccessToken(req) => { client.auth().login_access_token(&req).await.into_string() } - #[cfg(feature = "internal")] - Command::GetUserApiKey(req) => { - client.platform().get_user_api_key(req).await.into_string() - } - #[cfg(feature = "internal")] - Command::ApiKeyLogin(req) => client.auth().login_api_key(&req).await.into_string(), - #[cfg(feature = "internal")] - Command::Sync(req) => client.vault().sync(&req).await.into_string(), - #[cfg(feature = "internal")] - Command::Fingerprint(req) => client.platform().fingerprint(&req).into_string(), #[cfg(feature = "secrets")] Command::Secrets(cmd) => match cmd { diff --git a/crates/bitwarden-json/src/command.rs b/crates/bitwarden-json/src/command.rs index 7483b90c..faaa8177 100644 --- a/crates/bitwarden-json/src/command.rs +++ b/crates/bitwarden-json/src/command.rs @@ -13,38 +13,12 @@ use bitwarden::{ }, }, }; -#[cfg(feature = "internal")] -use bitwarden::{ - auth::login::{ApiKeyLoginRequest, PasswordLoginRequest}, - platform::{FingerprintRequest, SecretVerificationRequest}, - vault::SyncRequest, -}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, JsonSchema, Debug)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub enum Command { - #[cfg(feature = "internal")] - /// Login with username and password - /// - /// This command is for initiating an authentication handshake with Bitwarden. - /// Authorization may fail due to requiring 2fa or captcha challenge completion - /// despite accurate credentials. - /// - /// This command is not capable of handling authentication requiring 2fa or captcha. - /// - /// Returns: [PasswordLoginResponse](bitwarden::auth::login::PasswordLoginResponse) - PasswordLogin(PasswordLoginRequest), - - #[cfg(feature = "internal")] - /// Login with API Key - /// - /// This command is for initiating an authentication handshake with Bitwarden. - /// - /// Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse) - ApiKeyLogin(ApiKeyLoginRequest), - #[cfg(feature = "secrets")] /// Login with Secrets Manager Access Token /// @@ -53,26 +27,6 @@ pub enum Command { /// Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse) LoginAccessToken(AccessTokenLoginRequest), - #[cfg(feature = "internal")] - /// > Requires Authentication - /// Get the API key of the currently authenticated user - /// - /// Returns: [UserApiKeyResponse](bitwarden::platform::UserApiKeyResponse) - GetUserApiKey(SecretVerificationRequest), - - #[cfg(feature = "internal")] - /// Get the user's passphrase - /// - /// Returns: String - Fingerprint(FingerprintRequest), - - #[cfg(feature = "internal")] - /// > Requires Authentication - /// Retrieve all user data, ciphers and organizations the user is a part of - /// - /// Returns: [SyncResponse](bitwarden::vault::SyncResponse) - Sync(SyncRequest), - #[cfg(feature = "secrets")] Secrets(SecretsCommand), #[cfg(feature = "secrets")] diff --git a/crates/bitwarden-uniffi/Cargo.toml b/crates/bitwarden-uniffi/Cargo.toml index 822ed0d3..2e57e23b 100644 --- a/crates/bitwarden-uniffi/Cargo.toml +++ b/crates/bitwarden-uniffi/Cargo.toml @@ -11,7 +11,6 @@ repository.workspace = true license-file.workspace = true [features] -docs = ["dep:schemars"] # Docs [lib] crate-type = ["lib", "staticlib", "cdylib"] @@ -19,7 +18,6 @@ bench = false [dependencies] async-trait = "0.1.80" -bitwarden = { workspace = true, features = ["internal", "uniffi"] } bitwarden-core = { workspace = true, features = ["uniffi"] } bitwarden-crypto = { workspace = true, features = ["uniffi"] } bitwarden-exporters = { workspace = true, features = ["uniffi"] } @@ -28,8 +26,8 @@ bitwarden-generators = { workspace = true, features = ["uniffi"] } bitwarden-send = { workspace = true, features = ["uniffi"] } bitwarden-vault = { workspace = true, features = ["uniffi"] } chrono = { workspace = true, features = ["std"] } -log = { workspace = true } env_logger = "0.11.1" +log = { workspace = true } schemars = { workspace = true, optional = true } thiserror = { workspace = true } uniffi = { workspace = true } diff --git a/crates/bitwarden-uniffi/src/auth/mod.rs b/crates/bitwarden-uniffi/src/auth/mod.rs index d036991e..43496080 100644 --- a/crates/bitwarden-uniffi/src/auth/mod.rs +++ b/crates/bitwarden-uniffi/src/auth/mod.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::{ +use bitwarden_core::{ auth::{ password::MasterPasswordPolicyOptions, AuthRequestResponse, KeyConnectorResponse, RegisterKeyResponse, RegisterTdeKeyResponse, diff --git a/crates/bitwarden-uniffi/src/crypto.rs b/crates/bitwarden-uniffi/src/crypto.rs index 608698fc..6404d62f 100644 --- a/crates/bitwarden-uniffi/src/crypto.rs +++ b/crates/bitwarden-uniffi/src/crypto.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::{ +use bitwarden_core::{ mobile::crypto::{ DeriveKeyConnectorRequest, DerivePinKeyResponse, InitOrgCryptoRequest, InitUserCryptoRequest, UpdatePasswordResponse, diff --git a/crates/bitwarden-uniffi/src/error.rs b/crates/bitwarden-uniffi/src/error.rs index 5a1dfe43..889e3c7f 100644 --- a/crates/bitwarden-uniffi/src/error.rs +++ b/crates/bitwarden-uniffi/src/error.rs @@ -1,21 +1,24 @@ use std::fmt::{Display, Formatter}; +use bitwarden_exporters::ExportError; +use bitwarden_generators::{PassphraseError, PasswordError, UsernameError}; + // Name is converted from *Error to *Exception, so we can't just name the enum Error because // Exception already exists #[derive(uniffi::Error, Debug)] #[uniffi(flat_error)] pub enum BitwardenError { - E(bitwarden::error::Error), + E(Error), } -impl From for BitwardenError { - fn from(e: bitwarden::Error) -> Self { +impl From for BitwardenError { + fn from(e: bitwarden_core::Error) -> Self { Self::E(e.into()) } } -impl From for BitwardenError { - fn from(e: bitwarden::error::Error) -> Self { +impl From for BitwardenError { + fn from(e: Error) -> Self { Self::E(e) } } @@ -37,3 +40,42 @@ impl std::error::Error for BitwardenError { } pub type Result = std::result::Result; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error(transparent)] + Core(#[from] bitwarden_core::Error), + + // Generators + #[error(transparent)] + UsernameError(#[from] UsernameError), + #[error(transparent)] + PassphraseError(#[from] PassphraseError), + #[error(transparent)] + PasswordError(#[from] PasswordError), + + // Vault + #[error(transparent)] + Cipher(#[from] bitwarden_vault::CipherError), + #[error(transparent)] + Totp(#[from] bitwarden_vault::TotpError), + + #[error(transparent)] + ExportError(#[from] ExportError), + + // Fido + #[error(transparent)] + MakeCredential(#[from] bitwarden_fido::MakeCredentialError), + #[error(transparent)] + GetAssertion(#[from] bitwarden_fido::GetAssertionError), + #[error(transparent)] + SilentlyDiscoverCredentials(#[from] bitwarden_fido::SilentlyDiscoverCredentialsError), + #[error(transparent)] + CredentialsForAutofillError(#[from] bitwarden_fido::CredentialsForAutofillError), + #[error(transparent)] + DecryptFido2AutofillCredentialsError( + #[from] bitwarden_fido::DecryptFido2AutofillCredentialsError, + ), + #[error(transparent)] + Fido2Client(#[from] bitwarden_fido::Fido2ClientError), +} diff --git a/crates/bitwarden-uniffi/src/lib.rs b/crates/bitwarden-uniffi/src/lib.rs index a9eb6a3e..aae35c37 100644 --- a/crates/bitwarden-uniffi/src/lib.rs +++ b/crates/bitwarden-uniffi/src/lib.rs @@ -3,7 +3,7 @@ uniffi::setup_scaffolding!(); use std::sync::Arc; use auth::ClientAuth; -use bitwarden::ClientSettings; +use bitwarden_core::ClientSettings; pub mod auth; pub mod crypto; @@ -23,7 +23,7 @@ use tool::{ClientExporters, ClientGenerators, ClientSends}; use vault::ClientVault; #[derive(uniffi::Object)] -pub struct Client(bitwarden::Client); +pub struct Client(bitwarden_core::Client); #[uniffi::export(async_runtime = "tokio")] impl Client { @@ -35,7 +35,7 @@ impl Client { #[cfg(target_os = "android")] android_support::init(); - Arc::new(Self(bitwarden::Client::new(settings))) + Arc::new(Self(bitwarden_core::Client::new(settings))) } /// Crypto operations @@ -84,9 +84,9 @@ impl Client { .get(&url) .send() .await - .map_err(bitwarden::Error::Reqwest)?; + .map_err(bitwarden_core::Error::Reqwest)?; - Ok(res.text().await.map_err(bitwarden::Error::Reqwest)?) + Ok(res.text().await.map_err(bitwarden_core::Error::Reqwest)?) } } diff --git a/crates/bitwarden-uniffi/src/platform/fido2.rs b/crates/bitwarden-uniffi/src/platform/fido2.rs index f483ff34..99c99864 100644 --- a/crates/bitwarden-uniffi/src/platform/fido2.rs +++ b/crates/bitwarden-uniffi/src/platform/fido2.rs @@ -1,19 +1,18 @@ use std::sync::Arc; -use bitwarden::{ - error::Error, - fido::{ - CheckUserOptions, ClientData, ClientFido2Ext, Fido2CallbackError as BitFido2CallbackError, - GetAssertionRequest, GetAssertionResult, MakeCredentialRequest, MakeCredentialResult, - PublicKeyCredentialAuthenticatorAssertionResponse, - PublicKeyCredentialAuthenticatorAttestationResponse, PublicKeyCredentialRpEntity, - PublicKeyCredentialUserEntity, - }, - vault::{Cipher, CipherView, Fido2CredentialNewView}, +use bitwarden_fido::{ + CheckUserOptions, ClientData, ClientFido2Ext, Fido2CallbackError as BitFido2CallbackError, + Fido2CredentialAutofillView, GetAssertionRequest, GetAssertionResult, MakeCredentialRequest, + MakeCredentialResult, Origin, PublicKeyCredentialAuthenticatorAssertionResponse, + PublicKeyCredentialAuthenticatorAttestationResponse, PublicKeyCredentialRpEntity, + PublicKeyCredentialUserEntity, }; -use bitwarden_fido::{Fido2CredentialAutofillView, Origin}; +use bitwarden_vault::{Cipher, CipherView, Fido2CredentialNewView}; -use crate::{error::Result, Client}; +use crate::{ + error::{Error, Result}, + Client, +}; #[derive(uniffi::Object)] pub struct ClientFido2(pub(crate) Arc); @@ -180,7 +179,7 @@ pub struct CheckUserResult { user_verified: bool, } -impl From for bitwarden::fido::CheckUserResult { +impl From for bitwarden_fido::CheckUserResult { fn from(val: CheckUserResult) -> Self { Self { user_present: val.user_present, @@ -268,7 +267,7 @@ pub trait Fido2CredentialStore: Send + Sync { struct UniffiTraitBridge(T); #[async_trait::async_trait] -impl bitwarden::fido::Fido2CredentialStore for UniffiTraitBridge<&dyn Fido2CredentialStore> { +impl bitwarden_fido::Fido2CredentialStore for UniffiTraitBridge<&dyn Fido2CredentialStore> { async fn find_credentials( &self, ids: Option>>, @@ -306,9 +305,9 @@ pub enum UIHint { RequestExistingCredential(CipherView), } -impl From> for UIHint { - fn from(hint: bitwarden::fido::UIHint<'_, CipherView>) -> Self { - use bitwarden::fido::UIHint as BWUIHint; +impl From> for UIHint { + fn from(hint: bitwarden_fido::UIHint<'_, CipherView>) -> Self { + use bitwarden_fido::UIHint as BWUIHint; match hint { BWUIHint::InformExcludedCredentialFound(cipher) => { UIHint::InformExcludedCredentialFound(cipher.clone()) @@ -333,12 +332,12 @@ impl From> for UIHint { } #[async_trait::async_trait] -impl bitwarden::fido::Fido2UserInterface for UniffiTraitBridge<&dyn Fido2UserInterface> { +impl bitwarden_fido::Fido2UserInterface for UniffiTraitBridge<&dyn Fido2UserInterface> { async fn check_user<'a>( &self, options: CheckUserOptions, - hint: bitwarden::fido::UIHint<'a, CipherView>, - ) -> Result { + hint: bitwarden_fido::UIHint<'a, CipherView>, + ) -> Result { self.0 .check_user(options.clone(), hint.into()) .await @@ -359,7 +358,7 @@ impl bitwarden::fido::Fido2UserInterface for UniffiTraitBridge<&dyn Fido2UserInt &self, options: CheckUserOptions, new_credential: Fido2CredentialNewView, - ) -> Result<(CipherView, bitwarden::fido::CheckUserResult), BitFido2CallbackError> { + ) -> Result<(CipherView, bitwarden_fido::CheckUserResult), BitFido2CallbackError> { self.0 .check_user_and_pick_credential_for_creation(options, new_credential) .await diff --git a/crates/bitwarden-uniffi/src/platform/mod.rs b/crates/bitwarden-uniffi/src/platform/mod.rs index 63ff6e18..b5d94415 100644 --- a/crates/bitwarden-uniffi/src/platform/mod.rs +++ b/crates/bitwarden-uniffi/src/platform/mod.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::platform::FingerprintRequest; +use bitwarden_core::platform::FingerprintRequest; use crate::{error::Result, Client}; diff --git a/crates/bitwarden-uniffi/src/tool/mod.rs b/crates/bitwarden-uniffi/src/tool/mod.rs index 1fd439a4..49888421 100644 --- a/crates/bitwarden-uniffi/src/tool/mod.rs +++ b/crates/bitwarden-uniffi/src/tool/mod.rs @@ -1,16 +1,16 @@ use std::sync::Arc; -use bitwarden::{ - error::Error, - exporters::{ClientExportersExt, ExportFormat}, - generators::{ - ClientGeneratorExt, PassphraseGeneratorRequest, PasswordGeneratorRequest, - UsernameGeneratorRequest, - }, - vault::{Cipher, Collection, Folder}, +use bitwarden_exporters::{ClientExportersExt, ExportFormat}; +use bitwarden_generators::{ + ClientGeneratorExt, PassphraseGeneratorRequest, PasswordGeneratorRequest, + UsernameGeneratorRequest, }; +use bitwarden_vault::{Cipher, Collection, Folder}; -use crate::{error::Result, Client}; +use crate::{ + error::{Error, Result}, + Client, +}; mod sends; pub use sends::ClientSends; diff --git a/crates/bitwarden-uniffi/src/tool/sends.rs b/crates/bitwarden-uniffi/src/tool/sends.rs index 1d5a056a..18732f57 100644 --- a/crates/bitwarden-uniffi/src/tool/sends.rs +++ b/crates/bitwarden-uniffi/src/tool/sends.rs @@ -1,6 +1,6 @@ use std::{path::Path, sync::Arc}; -use bitwarden::send::{ClientSendsExt, Send, SendListView, SendView}; +use bitwarden_send::{ClientSendsExt, Send, SendListView, SendView}; use crate::{Client, Result}; diff --git a/crates/bitwarden-uniffi/src/uniffi_support.rs b/crates/bitwarden-uniffi/src/uniffi_support.rs index 74f48486..282b0346 100644 --- a/crates/bitwarden-uniffi/src/uniffi_support.rs +++ b/crates/bitwarden-uniffi/src/uniffi_support.rs @@ -4,6 +4,10 @@ use uuid::Uuid; // Forward the type definitions to the main bitwarden crate type DateTime = chrono::DateTime; uniffi::ffi_converter_forward!(DateTime, bitwarden_core::UniFfiTag, crate::UniFfiTag); -uniffi::ffi_converter_forward!(EncString, bitwarden::UniFfiTag, crate::UniFfiTag); -uniffi::ffi_converter_forward!(AsymmetricEncString, bitwarden::UniFfiTag, crate::UniFfiTag); +uniffi::ffi_converter_forward!(EncString, bitwarden_core::UniFfiTag, crate::UniFfiTag); +uniffi::ffi_converter_forward!( + AsymmetricEncString, + bitwarden_core::UniFfiTag, + crate::UniFfiTag +); uniffi::ffi_converter_forward!(Uuid, bitwarden_core::UniFfiTag, crate::UniFfiTag); diff --git a/crates/bitwarden-uniffi/src/vault/attachments.rs b/crates/bitwarden-uniffi/src/vault/attachments.rs index e8bddd12..cb2a011a 100644 --- a/crates/bitwarden-uniffi/src/vault/attachments.rs +++ b/crates/bitwarden-uniffi/src/vault/attachments.rs @@ -1,6 +1,6 @@ use std::{path::Path, sync::Arc}; -use bitwarden::vault::{ +use bitwarden_vault::{ Attachment, AttachmentEncryptResult, AttachmentView, Cipher, ClientVaultExt, }; diff --git a/crates/bitwarden-uniffi/src/vault/ciphers.rs b/crates/bitwarden-uniffi/src/vault/ciphers.rs index 1195cf81..64751b37 100644 --- a/crates/bitwarden-uniffi/src/vault/ciphers.rs +++ b/crates/bitwarden-uniffi/src/vault/ciphers.rs @@ -1,13 +1,9 @@ use std::sync::Arc; -use bitwarden::{ - error::Error, - vault::{Cipher, CipherListView, CipherView, ClientVaultExt}, -}; -use bitwarden_vault::Fido2CredentialView; +use bitwarden_vault::{Cipher, CipherListView, CipherView, ClientVaultExt, Fido2CredentialView}; use uuid::Uuid; -use crate::{Client, Result}; +use crate::{error::Error, Client, Result}; #[derive(uniffi::Object)] pub struct ClientCiphers(pub Arc); diff --git a/crates/bitwarden-uniffi/src/vault/collections.rs b/crates/bitwarden-uniffi/src/vault/collections.rs index 84d928e6..250588e8 100644 --- a/crates/bitwarden-uniffi/src/vault/collections.rs +++ b/crates/bitwarden-uniffi/src/vault/collections.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::vault::{ClientVaultExt, Collection, CollectionView}; +use bitwarden_vault::{ClientVaultExt, Collection, CollectionView}; use crate::{Client, Result}; diff --git a/crates/bitwarden-uniffi/src/vault/folders.rs b/crates/bitwarden-uniffi/src/vault/folders.rs index 2efeb1f1..758d0917 100644 --- a/crates/bitwarden-uniffi/src/vault/folders.rs +++ b/crates/bitwarden-uniffi/src/vault/folders.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::vault::{ClientVaultExt, Folder, FolderView}; +use bitwarden_vault::{ClientVaultExt, Folder, FolderView}; use crate::{Client, Result}; diff --git a/crates/bitwarden-uniffi/src/vault/mod.rs b/crates/bitwarden-uniffi/src/vault/mod.rs index 4cf84086..cec625e3 100644 --- a/crates/bitwarden-uniffi/src/vault/mod.rs +++ b/crates/bitwarden-uniffi/src/vault/mod.rs @@ -1,13 +1,12 @@ use std::sync::Arc; -use bitwarden::{ - error::Error, - vault::{ClientVaultExt, TotpResponse}, -}; -use bitwarden_vault::CipherListView; +use bitwarden_vault::{CipherListView, ClientVaultExt, TotpResponse}; use chrono::{DateTime, Utc}; -use crate::{error::Result, Client}; +use crate::{ + error::{Error, Result}, + Client, +}; pub mod attachments; pub mod ciphers; diff --git a/crates/bitwarden-uniffi/src/vault/password_history.rs b/crates/bitwarden-uniffi/src/vault/password_history.rs index 3fa0fd3b..330e9121 100644 --- a/crates/bitwarden-uniffi/src/vault/password_history.rs +++ b/crates/bitwarden-uniffi/src/vault/password_history.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden::vault::{ClientVaultExt, PasswordHistory, PasswordHistoryView}; +use bitwarden_vault::{ClientVaultExt, PasswordHistory, PasswordHistoryView}; use crate::{Client, Result}; diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index df69015c..4f68c08d 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -15,7 +15,7 @@ keywords.workspace = true crate-type = ["cdylib"] [dependencies] -bitwarden = { workspace = true, features = ["internal", "wasm"] } +bitwarden = { workspace = true, features = ["wasm"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml index c4be614d..fd3c278f 100644 --- a/crates/bitwarden-wasm/Cargo.toml +++ b/crates/bitwarden-wasm/Cargo.toml @@ -19,10 +19,7 @@ argon2 = { version = ">=0.5.0, <0.6", features = [ "alloc", "zeroize", ], default-features = false } -bitwarden-json = { path = "../bitwarden-json", features = [ - "secrets", - "internal", -] } +bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden/Cargo.toml b/crates/bitwarden/Cargo.toml index 1d09377c..3626f9d1 100644 --- a/crates/bitwarden/Cargo.toml +++ b/crates/bitwarden/Cargo.toml @@ -16,25 +16,9 @@ license-file.workspace = true [features] default = ["secrets"] -internal = [ - "bitwarden-core/internal", - "dep:bitwarden-exporters", - "dep:bitwarden-generators", - "dep:bitwarden-send", - "dep:bitwarden-vault", -] # Internal testing methods no-memory-hardening = [ "bitwarden-core/no-memory-hardening", ] # Disable memory hardening features -uniffi = [ - "bitwarden-core/uniffi", - "bitwarden-crypto/uniffi", - "bitwarden-exporters/uniffi", - "bitwarden-fido/uniffi", - "bitwarden-generators/uniffi", - "bitwarden-send/uniffi", - "bitwarden-vault/uniffi", -] # Uniffi bindings secrets = [ "bitwarden-core/secrets", "dep:bitwarden-sm", @@ -43,16 +27,9 @@ secrets = [ wasm = ["bitwarden-core/wasm"] # WASM support [dependencies] -bitwarden-api-api = { workspace = true } -bitwarden-api-identity = { workspace = true } bitwarden-core = { workspace = true } -bitwarden-crypto = { workspace = true } -bitwarden-exporters = { workspace = true, optional = true } -bitwarden-fido = { workspace = true, optional = true } bitwarden-generators = { workspace = true, optional = true } -bitwarden-send = { workspace = true, optional = true } bitwarden-sm = { workspace = true, optional = true } -bitwarden-vault = { workspace = true, optional = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/crates/bitwarden/src/error.rs b/crates/bitwarden/src/error.rs index 06ef0964..163ccc20 100644 --- a/crates/bitwarden/src/error.rs +++ b/crates/bitwarden/src/error.rs @@ -1,77 +1,13 @@ //! Errors that can occur when using this SDK -use std::{borrow::Cow, fmt::Debug}; +use std::fmt::Debug; -#[cfg(feature = "internal")] -use bitwarden_exporters::ExportError; -#[cfg(feature = "internal")] -use bitwarden_generators::{PassphraseError, PasswordError, UsernameError}; use thiserror::Error; #[derive(Debug, Error)] pub enum Error { #[error(transparent)] Core(#[from] bitwarden_core::Error), - - // Generators - #[cfg(feature = "internal")] - #[error(transparent)] - UsernameError(#[from] UsernameError), - #[cfg(feature = "internal")] - #[error(transparent)] - PassphraseError(#[from] PassphraseError), - #[cfg(feature = "internal")] - #[error(transparent)] - PasswordError(#[from] PasswordError), - - // Vault - #[cfg(feature = "internal")] - #[error(transparent)] - Cipher(#[from] bitwarden_vault::CipherError), - #[cfg(feature = "internal")] - #[error(transparent)] - Totp(#[from] bitwarden_vault::TotpError), - - #[cfg(feature = "internal")] - #[error(transparent)] - ExportError(#[from] ExportError), - - // Fido - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - MakeCredential(#[from] bitwarden_fido::MakeCredentialError), - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - GetAssertion(#[from] bitwarden_fido::GetAssertionError), - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - SilentlyDiscoverCredentials(#[from] bitwarden_fido::SilentlyDiscoverCredentialsError), - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - CredentialsForAutofillError(#[from] bitwarden_fido::CredentialsForAutofillError), - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - DecryptFido2AutofillCredentialsError( - #[from] bitwarden_fido::DecryptFido2AutofillCredentialsError, - ), - #[cfg(all(feature = "uniffi", feature = "internal"))] - #[error(transparent)] - Fido2Client(#[from] bitwarden_fido::Fido2ClientError), - - #[error("Internal error: {0}")] - Internal(Cow<'static, str>), -} - -impl From for Error { - fn from(s: String) -> Self { - Self::Internal(s.into()) - } -} - -impl From<&'static str> for Error { - fn from(s: &'static str) -> Self { - Self::Internal(s.into()) - } } // Ensure that the error messages implement Send and Sync diff --git a/crates/bitwarden/src/lib.rs b/crates/bitwarden/src/lib.rs index c87693ce..77a063f5 100644 --- a/crates/bitwarden/src/lib.rs +++ b/crates/bitwarden/src/lib.rs @@ -61,34 +61,7 @@ mod readme {} pub use bitwarden_core::*; pub mod error; -#[cfg(feature = "internal")] -pub mod internal { - pub mod generators { - pub use bitwarden_generators::*; - } - - pub mod exporters { - pub use bitwarden_exporters::*; - } - - pub mod send { - pub use bitwarden_send::*; - } - - pub mod vault { - pub use bitwarden_vault::*; - } - - #[cfg(feature = "uniffi")] - pub mod fido { - pub use bitwarden_fido::*; - } -} -#[cfg(feature = "internal")] -pub use internal::*; - -// Re-export generators used for secrets-manager, internal flag already exports all generators -#[cfg(all(feature = "secrets", not(feature = "internal")))] +#[cfg(feature = "secrets")] pub mod generators { pub use bitwarden_generators::{ClientGeneratorExt, PasswordError, PasswordGeneratorRequest}; } diff --git a/crates/bw/Cargo.toml b/crates/bw/Cargo.toml index cb8e02ba..a2ba807c 100644 --- a/crates/bw/Cargo.toml +++ b/crates/bw/Cargo.toml @@ -14,9 +14,11 @@ repository.workspace = true license-file.workspace = true [dependencies] -bitwarden = { workspace = true, features = ["internal"] } bitwarden-cli = { workspace = true } +bitwarden-core = { workspace = true } bitwarden-crypto = { workspace = true } +bitwarden-generators = { workspace = true } +bitwarden-vault = { workspace = true } clap = { version = "4.5.4", features = ["derive", "env"] } color-eyre = "0.6.3" env_logger = "0.11.1" diff --git a/crates/bw/src/auth/login.rs b/crates/bw/src/auth/login.rs index 51fe64a3..131d39f0 100644 --- a/crates/bw/src/auth/login.rs +++ b/crates/bw/src/auth/login.rs @@ -1,12 +1,12 @@ -use bitwarden::{ +use bitwarden_cli::text_prompt_when_none; +use bitwarden_core::{ auth::login::{ ApiKeyLoginRequest, PasswordLoginRequest, TwoFactorEmailRequest, TwoFactorProvider, TwoFactorRequest, }, - vault::{ClientVaultExt, SyncRequest}, Client, }; -use bitwarden_cli::text_prompt_when_none; +use bitwarden_vault::{ClientVaultExt, SyncRequest}; use color_eyre::eyre::{bail, Result}; use inquire::{Password, Text}; use log::{debug, error, info}; diff --git a/crates/bw/src/main.rs b/crates/bw/src/main.rs index a9a7eeea..06d5d0bd 100644 --- a/crates/bw/src/main.rs +++ b/crates/bw/src/main.rs @@ -1,9 +1,8 @@ -use bitwarden::{ - auth::RegisterRequest, - generators::{ClientGeneratorExt, PassphraseGeneratorRequest, PasswordGeneratorRequest}, - ClientSettings, -}; use bitwarden_cli::{install_color_eyre, text_prompt_when_none, Color}; +use bitwarden_core::{auth::RegisterRequest, ClientSettings}; +use bitwarden_generators::{ + ClientGeneratorExt, PassphraseGeneratorRequest, PasswordGeneratorRequest, +}; use clap::{command, Args, CommandFactory, Parser, Subcommand}; use color_eyre::eyre::Result; use inquire::Password; @@ -157,7 +156,7 @@ async fn process_commands() -> Result<()> { identity_url: format!("{}/identity", server), ..Default::default() }); - let client = bitwarden::Client::new(settings); + let client = bitwarden_core::Client::new(settings); match args.command { // FIXME: Rust CLI will not support password login! @@ -188,7 +187,7 @@ async fn process_commands() -> Result<()> { identity_url: format!("{}/identity", server), ..Default::default() }); - let client = bitwarden::Client::new(settings); + let client = bitwarden_core::Client::new(settings); let email = text_prompt_when_none("Email", email)?; let password = Password::new("Password").prompt()?; @@ -207,7 +206,7 @@ async fn process_commands() -> Result<()> { } // Not login, assuming we have a config - let client = bitwarden::Client::new(None); + let client = bitwarden_core::Client::new(None); // And finally we process all the commands which require authentication match command { diff --git a/crates/sdk-schemas/Cargo.toml b/crates/sdk-schemas/Cargo.toml index b4dd496a..13a66487 100644 --- a/crates/sdk-schemas/Cargo.toml +++ b/crates/sdk-schemas/Cargo.toml @@ -12,7 +12,6 @@ license-file.workspace = true keywords.workspace = true [features] -internal = ["bitwarden/internal", "bitwarden-json/internal"] [dependencies] anyhow = "1.0.82" diff --git a/crates/sdk-schemas/src/main.rs b/crates/sdk-schemas/src/main.rs index 66683256..2db3ce5f 100644 --- a/crates/sdk-schemas/src/main.rs +++ b/crates/sdk-schemas/src/main.rs @@ -109,13 +109,6 @@ struct SchemaTypes { projects: Response, projects_delete: Response, password: Response, - - #[cfg(feature = "internal")] - fingerprint: Response, - #[cfg(feature = "internal")] - sync: Response, - #[cfg(feature = "internal")] - user_api_key: Response, } fn main() -> Result<()> { diff --git a/support/scripts/schemas.ts b/support/scripts/schemas.ts index 3eaad190..873a9de7 100644 --- a/support/scripts/schemas.ts +++ b/support/scripts/schemas.ts @@ -7,18 +7,6 @@ import { } from "quicktype-core"; import fs from "fs"; -import path from "path"; - -async function* walk(dir: string): AsyncIterable { - for await (const d of await fs.promises.opendir(dir)) { - const entry = path.join(dir, d.name); - if (d.isDirectory()) { - yield* walk(entry); - } else if (d.isFile()) { - yield entry; - } - } -} async function main() { const schemaInput = new JSONSchemaInput(new FetchingJSONSchemaStore()); From 97116b1151a8942f640a264fa1c1c4a37512a482 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 11 Oct 2024 14:28:28 +0200 Subject: [PATCH 07/39] Pin WASM bindgen (#1129) Every time wasm-bindgen is updated we run into conflicts with the wasm-bindgen-cli version. Pin it to avoid this problem in the future. --- .github/workflows/build-wasm-internal.yml | 2 +- .github/workflows/build-wasm.yml | 2 +- Cargo.lock | 20 ++++++++++---------- crates/bitwarden-wasm-internal/Cargo.toml | 3 ++- crates/bitwarden-wasm/Cargo.toml | 3 ++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 99fe06c4..0be6b29c 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -46,7 +46,7 @@ jobs: key: wasm-cargo-cache - name: Install wasm-bindgen-cli - run: cargo install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli --version 0.2.95 - name: Build run: ./build.sh -r diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 35c0ca6b..117bbf2c 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -46,7 +46,7 @@ jobs: key: wasm-cargo-cache - name: Install wasm-bindgen-cli - run: cargo install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli --version 0.2.95 - name: Build run: ./build.sh -r diff --git a/Cargo.lock b/Cargo.lock index 024abbe0..e6ca566f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4503,9 +4503,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4516,9 +4516,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4543,9 +4543,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4553,9 +4553,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4566,9 +4566,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index 4f68c08d..b18e412c 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -21,7 +21,8 @@ console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" log = "0.4.20" serde_json = ">=1.0.96, <2.0" -wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } +# When upgrading wasm-bindgen, make sure to update the version in the workflows! +wasm-bindgen = { version = "=0.2.95", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4.41" [lints] diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml index fd3c278f..b57a0192 100644 --- a/crates/bitwarden-wasm/Cargo.toml +++ b/crates/bitwarden-wasm/Cargo.toml @@ -25,7 +25,8 @@ console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" log = "0.4.20" serde = { version = "1.0.196", features = ["derive"] } -wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } +# When upgrading wasm-bindgen, make sure to update the version in the workflows! +wasm-bindgen = { version = "=0.2.95", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4.41" [dev-dependencies] From c75f247f36551eae86a4df1c302542bff2b12dbe Mon Sep 17 00:00:00 2001 From: Hinton Date: Fri, 11 Oct 2024 14:38:09 +0200 Subject: [PATCH 08/39] Remove secrets manager language bindings and clients --- .github/CODEOWNERS | 6 - .github/ISSUE_TEMPLATE/cli.yml | 90 -- .github/ISSUE_TEMPLATE/config.yml | 14 - .github/ISSUE_TEMPLATE/sdk.yml | 78 -- .github/workflows/build-cli-docker.yml | 143 --- .github/workflows/build-cli.yml | 467 -------- .github/workflows/build-cpp.yml | 159 --- .github/workflows/build-dotnet.yml | 99 -- .github/workflows/build-go.yaml | 49 - .github/workflows/build-java.yml | 88 -- .github/workflows/build-napi.yml | 91 -- .github/workflows/build-python-wheels.yml | 122 -- .github/workflows/build-ruby.yml | 95 -- .../workflows/build-rust-cross-platform.yml | 95 -- .github/workflows/build-wasm.yml | 76 -- .github/workflows/publish-bws.yml | 215 ---- .github/workflows/publish-dotnet.yml | 113 -- .github/workflows/publish-java.yml | 128 -- .github/workflows/publish-napi.yml | 155 --- .github/workflows/publish-php.yml | 270 ----- .github/workflows/publish-python.yml | 132 --- .github/workflows/publish-ruby.yml | 126 -- .github/workflows/publish-wasm.yml | 138 --- .github/workflows/release-bws.yml | 77 -- .github/workflows/release-cpp.yml | 167 --- .github/workflows/release-dotnet.yml | 75 -- .github/workflows/release-go.yml | 283 ----- .github/workflows/release-java.yml | 61 - .github/workflows/release-napi.yml | 96 -- .github/workflows/release-python.yml | 80 -- .github/workflows/release-wasm.yml | 78 -- .github/workflows/rust-test.yml | 2 +- .github/workflows/version-bump.yml | 71 -- .gitignore | 21 - .prettierignore | 2 - .vscode/launch.json | 22 - .vscode/tasks.json | 62 - CHANGELOG.md | 6 - Cargo.lock | 784 +------------ README.md | 31 +- crates/bitwarden-c/Cargo.toml | 25 - crates/bitwarden-c/src/c.rs | 58 - crates/bitwarden-c/src/lib.rs | 9 - crates/bitwarden-c/src/macros/ffi.rs | 16 - crates/bitwarden-c/src/macros/mod.rs | 1 - crates/bitwarden-json/Cargo.toml | 29 - crates/bitwarden-json/src/client.rs | 102 -- crates/bitwarden-json/src/command.rs | 144 --- crates/bitwarden-json/src/lib.rs | 3 - crates/bitwarden-json/src/response.rs | 64 - crates/bitwarden-napi/.npmignore | 13 - crates/bitwarden-napi/Cargo.toml | 33 - crates/bitwarden-napi/README.md | 32 - crates/bitwarden-napi/binding.d.ts | 16 - crates/bitwarden-napi/binding.js | 290 ----- crates/bitwarden-napi/build.rs | 5 - .../bitwarden-napi/npm/darwin-arm64/LICENSE | 295 ----- .../bitwarden-napi/npm/darwin-arm64/README.md | 3 - .../npm/darwin-arm64/package.json | 31 - crates/bitwarden-napi/npm/darwin-x64/LICENSE | 295 ----- .../bitwarden-napi/npm/darwin-x64/README.md | 3 - .../npm/darwin-x64/package.json | 31 - .../bitwarden-napi/npm/linux-x64-gnu/LICENSE | 295 ----- .../npm/linux-x64-gnu/README.md | 3 - .../npm/linux-x64-gnu/package.json | 30 - .../bitwarden-napi/npm/win32-x64-msvc/LICENSE | 295 ----- .../npm/win32-x64-msvc/README.md | 3 - .../npm/win32-x64-msvc/package.json | 31 - crates/bitwarden-napi/package-lock.json | 51 - crates/bitwarden-napi/package.json | 50 - .../src-ts/bitwarden_client/index.ts | 245 ---- crates/bitwarden-napi/src-ts/index.ts | 3 - crates/bitwarden-napi/src/client.rs | 44 - crates/bitwarden-napi/src/lib.rs | 2 - crates/bitwarden-napi/tsconfig.json | 13 - crates/bitwarden-py/Cargo.toml | 30 - crates/bitwarden-py/MANIFEST.in | 2 - crates/bitwarden-py/build.rs | 3 - crates/bitwarden-py/pyproject.toml | 2 - crates/bitwarden-py/src/client.rs | 28 - crates/bitwarden-py/src/lib.rs | 5 - crates/bitwarden-py/src/python_module.rs | 9 - crates/bitwarden-wasm-internal/Cargo.toml | 2 +- crates/bitwarden-wasm-internal/src/client.rs | 2 +- crates/bitwarden-wasm/Cargo.toml | 43 - crates/bitwarden-wasm/README.md | 23 - crates/bitwarden-wasm/build.sh | 23 - crates/bitwarden-wasm/src/client.rs | 80 -- crates/bitwarden-wasm/src/lib.rs | 1 - crates/bitwarden/CHANGELOG.md | 83 -- crates/bitwarden/Cargo.toml | 39 - crates/bitwarden/README.md | 58 - crates/bitwarden/src/error.rs | 24 - crates/bitwarden/src/lib.rs | 72 -- crates/bws/CHANGELOG.md | 78 -- crates/bws/Cargo.toml | 60 - crates/bws/Dockerfile | 57 - crates/bws/Dockerfile.dockerignore | 4 - crates/bws/README.md | 94 -- crates/bws/build.rs | 14 - crates/bws/entitlements.plist | 8 - crates/bws/scripts/install.ps1 | 108 -- crates/bws/scripts/install.sh | 180 --- crates/bws/src/cli.rs | 169 --- crates/bws/src/command/mod.rs | 67 -- crates/bws/src/command/project.rs | 141 --- crates/bws/src/command/run.rs | 149 --- crates/bws/src/command/secret.rs | 221 ---- crates/bws/src/config.rs | 217 ---- crates/bws/src/main.rs | 195 ---- crates/bws/src/render.rs | 154 --- crates/bws/src/state.rs | 32 - crates/bws/src/util.rs | 93 -- crates/sdk-schemas/Cargo.toml | 23 - crates/sdk-schemas/src/main.rs | 118 -- languages/cpp/CMakeBuild.md | 61 - languages/cpp/CMakeLists.txt | 37 - languages/cpp/README.md | 112 -- languages/cpp/examples/ExampleUse.md | 108 -- languages/cpp/examples/Wrapper.cpp | 131 --- languages/cpp/include/BitwardenClient.h | 38 - languages/cpp/include/BitwardenLibrary.h | 27 - languages/cpp/include/BitwardenSettings.h | 19 - languages/cpp/include/CommandRunner.h | 45 - languages/cpp/include/Projects.h | 19 - languages/cpp/include/Secrets.h | 24 - languages/cpp/src/BitwardenClient.cpp | 160 --- languages/cpp/src/BitwardenLibrary.cpp | 107 -- languages/cpp/src/CommandRunner.cpp | 49 - languages/cpp/src/Projects.cpp | 132 --- languages/cpp/src/Secrets.cpp | 230 ---- languages/cpp/vcpkg.json | 11 - languages/csharp/.editorconfig | 125 -- .../Bitwarden.Sdk.Samples.csproj | 14 - .../csharp/Bitwarden.Sdk.Samples/Program.cs | 73 -- languages/csharp/Bitwarden.Sdk/AuthClient.cs | 21 - .../csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj | 77 -- .../Bitwarden.Sdk/BitwardenAuthException.cs | 13 - .../csharp/Bitwarden.Sdk/BitwardenClient.cs | 31 - .../Bitwarden.Sdk/BitwardenException.cs | 13 - .../csharp/Bitwarden.Sdk/BitwardenLibrary.cs | 21 - .../Bitwarden.Sdk/BitwardenSafeHandle.cs | 17 - .../csharp/Bitwarden.Sdk/BitwardenSettings.cs | 14 - .../csharp/Bitwarden.Sdk/CommandRunner.cs | 20 - .../csharp/Bitwarden.Sdk/ProjectsClient.cs | 94 -- .../csharp/Bitwarden.Sdk/SecretsClient.cs | 145 --- languages/csharp/Bitwarden.Sdk/bitwarden.png | Bin 790 -> 0 bytes languages/csharp/Bitwarden.sln | 22 - languages/csharp/LICENSE.txt | 295 ----- languages/csharp/README.md | 89 -- languages/csharp/global.json | 6 - languages/go/.version | 1 - languages/go/INSTRUCTIONS.md | 150 --- languages/go/README.md | 143 --- languages/go/bitwarden_client.go | 85 -- languages/go/command_runner.go | 37 - languages/go/example/example.go | 137 --- languages/go/example/go.mod | 10 - languages/go/example/go.sum | 2 - languages/go/generators.go | 35 - languages/go/go.mod | 3 - languages/go/go.sum | 0 .../internal/cinterface/bitwarden_library.go | 58 - languages/go/project.go | 107 -- languages/go/secrets.go | 151 --- languages/go/util.go | 33 - languages/java/.gitignore | 3 - languages/java/INSTALL.md | 52 - languages/java/README.md | 108 -- languages/java/build.gradle | 106 -- languages/java/example/Example.java | 73 -- languages/java/example/build.gradle | 23 - .../java/gradle/wrapper/gradle-wrapper.jar | Bin 63721 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 - languages/java/gradlew | 249 ---- languages/java/gradlew.bat | 92 -- languages/java/settings.gradle | 7 - .../java/com/bitwarden/sdk/AuthClient.java | 32 - .../com/bitwarden/sdk/BitwardenClient.java | 77 -- .../sdk/BitwardenClientException.java | 12 - .../com/bitwarden/sdk/BitwardenLibrary.java | 13 - .../com/bitwarden/sdk/BitwardenSettings.java | 32 - .../java/com/bitwarden/sdk/CommandRunner.java | 45 - .../com/bitwarden/sdk/ProjectsClient.java | 109 -- .../java/com/bitwarden/sdk/SecretsClient.java | 152 --- .../com/bitwarden/sdk/ThrowingFunction.java | 7 - languages/js/example/index.js | 32 - languages/js/example/package-lock.json | 34 - languages/js/example/package.json | 11 - languages/js/sdk-client/.gitignore | 2 - languages/js/sdk-client/package-lock.json | 574 --------- languages/js/sdk-client/package.json | 20 - languages/js/sdk-client/src/client.ts | 197 ---- languages/js/sdk-client/src/lib.ts | 2 - languages/js/sdk-client/tsconfig.json | 12 - languages/js/wasm/.gitignore | 6 - languages/js/wasm/index.js | 25 - languages/js/wasm/package.json | 25 - languages/php/.gitignore | 4 - languages/php/INSTALL.md | 56 - languages/php/README.md | 121 -- languages/php/composer.json | 23 - languages/php/composer.lock | 21 - languages/php/example.php | 103 -- languages/php/src/AuthClient.php | 35 - languages/php/src/BitwardenClient.php | 45 - languages/php/src/BitwardenLib.php | 112 -- languages/php/src/BitwardenSettings.php | 26 - languages/php/src/CommandRunner.php | 33 - languages/php/src/ProjectsClient.php | 94 -- languages/php/src/SecretsClient.php | 125 -- languages/python/.gitignore | 4 - languages/python/README.md | 59 - languages/python/bitwarden_sdk/__init__.py | 13 - .../python/bitwarden_sdk/bitwarden_client.py | 170 --- languages/python/example.py | 83 -- languages/python/openapitools.json | 7 - languages/python/pyproject.toml | 29 - languages/ruby/.gitignore | 4 - languages/ruby/CHANGELOG.md | 6 - languages/ruby/README.md | 140 --- languages/ruby/bitwarden_sdk_secrets/Gemfile | 10 - languages/ruby/bitwarden_sdk_secrets/Rakefile | 11 - .../bitwarden-sdk-secrets.gemspec | 47 - .../ruby/bitwarden_sdk_secrets/lib/auth.rb | 16 - .../lib/bitwarden-sdk-secrets.rb | 52 - .../lib/bitwarden_error.rb | 9 - .../lib/bitwarden_lib.rb | 35 - .../lib/command_runner.rb | 15 - .../lib/extended_schemas/schemas.rb | 78 -- .../bitwarden_sdk_secrets/lib/projects.rb | 116 -- .../ruby/bitwarden_sdk_secrets/lib/secrets.rb | 140 --- .../ruby/bitwarden_sdk_secrets/lib/version.rb | 5 - .../ruby/bitwarden_sdk_secrets/sig/auth.rbs | 9 - .../sig/bitwarden-sdk-secrets.rbs | 39 - .../sig/bitwarden_error.rbs | 5 - .../sig/bitwarden_lib.rbs | 7 - .../sig/command_runner.rbs | 12 - .../bitwarden_sdk_secrets/sig/projects.rbs | 25 - .../bitwarden_sdk_secrets/sig/secrets.rbs | 29 - .../bitwarden_sdk_secrets/sig/version.rbs | 3 - .../spec/settings_spec.rb | 15 - languages/ruby/examples/example.rb | 77 -- languages/ruby/gen_ruby_typedefs.sh | 26 - package-lock.json | 1031 +---------------- package.json | 15 +- sig/bitwarden_sdk/bitwarden_client.rbs | 5 - support/scripts/schemas.ts | 138 --- 248 files changed, 49 insertions(+), 18866 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/cli.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/sdk.yml delete mode 100644 .github/workflows/build-cli-docker.yml delete mode 100644 .github/workflows/build-cli.yml delete mode 100644 .github/workflows/build-cpp.yml delete mode 100644 .github/workflows/build-dotnet.yml delete mode 100644 .github/workflows/build-go.yaml delete mode 100644 .github/workflows/build-java.yml delete mode 100644 .github/workflows/build-napi.yml delete mode 100644 .github/workflows/build-python-wheels.yml delete mode 100644 .github/workflows/build-ruby.yml delete mode 100644 .github/workflows/build-rust-cross-platform.yml delete mode 100644 .github/workflows/build-wasm.yml delete mode 100644 .github/workflows/publish-bws.yml delete mode 100644 .github/workflows/publish-dotnet.yml delete mode 100644 .github/workflows/publish-java.yml delete mode 100644 .github/workflows/publish-napi.yml delete mode 100644 .github/workflows/publish-php.yml delete mode 100644 .github/workflows/publish-python.yml delete mode 100644 .github/workflows/publish-ruby.yml delete mode 100644 .github/workflows/publish-wasm.yml delete mode 100644 .github/workflows/release-bws.yml delete mode 100644 .github/workflows/release-cpp.yml delete mode 100644 .github/workflows/release-dotnet.yml delete mode 100644 .github/workflows/release-go.yml delete mode 100644 .github/workflows/release-java.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-python.yml delete mode 100644 .github/workflows/release-wasm.yml delete mode 100644 .vscode/tasks.json delete mode 100644 CHANGELOG.md delete mode 100644 crates/bitwarden-c/Cargo.toml delete mode 100644 crates/bitwarden-c/src/c.rs delete mode 100644 crates/bitwarden-c/src/lib.rs delete mode 100644 crates/bitwarden-c/src/macros/ffi.rs delete mode 100644 crates/bitwarden-c/src/macros/mod.rs delete mode 100644 crates/bitwarden-json/Cargo.toml delete mode 100644 crates/bitwarden-json/src/client.rs delete mode 100644 crates/bitwarden-json/src/command.rs delete mode 100644 crates/bitwarden-json/src/lib.rs delete mode 100644 crates/bitwarden-json/src/response.rs delete mode 100644 crates/bitwarden-napi/.npmignore delete mode 100644 crates/bitwarden-napi/Cargo.toml delete mode 100644 crates/bitwarden-napi/README.md delete mode 100644 crates/bitwarden-napi/binding.d.ts delete mode 100644 crates/bitwarden-napi/binding.js delete mode 100644 crates/bitwarden-napi/build.rs delete mode 100644 crates/bitwarden-napi/npm/darwin-arm64/LICENSE delete mode 100644 crates/bitwarden-napi/npm/darwin-arm64/README.md delete mode 100644 crates/bitwarden-napi/npm/darwin-arm64/package.json delete mode 100644 crates/bitwarden-napi/npm/darwin-x64/LICENSE delete mode 100644 crates/bitwarden-napi/npm/darwin-x64/README.md delete mode 100644 crates/bitwarden-napi/npm/darwin-x64/package.json delete mode 100644 crates/bitwarden-napi/npm/linux-x64-gnu/LICENSE delete mode 100644 crates/bitwarden-napi/npm/linux-x64-gnu/README.md delete mode 100644 crates/bitwarden-napi/npm/linux-x64-gnu/package.json delete mode 100644 crates/bitwarden-napi/npm/win32-x64-msvc/LICENSE delete mode 100644 crates/bitwarden-napi/npm/win32-x64-msvc/README.md delete mode 100644 crates/bitwarden-napi/npm/win32-x64-msvc/package.json delete mode 100644 crates/bitwarden-napi/package-lock.json delete mode 100644 crates/bitwarden-napi/package.json delete mode 100644 crates/bitwarden-napi/src-ts/bitwarden_client/index.ts delete mode 100644 crates/bitwarden-napi/src-ts/index.ts delete mode 100644 crates/bitwarden-napi/src/client.rs delete mode 100644 crates/bitwarden-napi/src/lib.rs delete mode 100644 crates/bitwarden-napi/tsconfig.json delete mode 100644 crates/bitwarden-py/Cargo.toml delete mode 100644 crates/bitwarden-py/MANIFEST.in delete mode 100644 crates/bitwarden-py/build.rs delete mode 100644 crates/bitwarden-py/pyproject.toml delete mode 100644 crates/bitwarden-py/src/client.rs delete mode 100644 crates/bitwarden-py/src/lib.rs delete mode 100644 crates/bitwarden-py/src/python_module.rs delete mode 100644 crates/bitwarden-wasm/Cargo.toml delete mode 100644 crates/bitwarden-wasm/README.md delete mode 100755 crates/bitwarden-wasm/build.sh delete mode 100644 crates/bitwarden-wasm/src/client.rs delete mode 100644 crates/bitwarden-wasm/src/lib.rs delete mode 100644 crates/bitwarden/CHANGELOG.md delete mode 100644 crates/bitwarden/Cargo.toml delete mode 100644 crates/bitwarden/README.md delete mode 100644 crates/bitwarden/src/error.rs delete mode 100644 crates/bitwarden/src/lib.rs delete mode 100644 crates/bws/CHANGELOG.md delete mode 100644 crates/bws/Cargo.toml delete mode 100644 crates/bws/Dockerfile delete mode 100644 crates/bws/Dockerfile.dockerignore delete mode 100644 crates/bws/README.md delete mode 100644 crates/bws/build.rs delete mode 100644 crates/bws/entitlements.plist delete mode 100755 crates/bws/scripts/install.ps1 delete mode 100755 crates/bws/scripts/install.sh delete mode 100644 crates/bws/src/cli.rs delete mode 100644 crates/bws/src/command/mod.rs delete mode 100644 crates/bws/src/command/project.rs delete mode 100644 crates/bws/src/command/run.rs delete mode 100644 crates/bws/src/command/secret.rs delete mode 100644 crates/bws/src/config.rs delete mode 100644 crates/bws/src/main.rs delete mode 100644 crates/bws/src/render.rs delete mode 100644 crates/bws/src/state.rs delete mode 100644 crates/bws/src/util.rs delete mode 100644 crates/sdk-schemas/Cargo.toml delete mode 100644 crates/sdk-schemas/src/main.rs delete mode 100644 languages/cpp/CMakeBuild.md delete mode 100644 languages/cpp/CMakeLists.txt delete mode 100644 languages/cpp/README.md delete mode 100644 languages/cpp/examples/ExampleUse.md delete mode 100644 languages/cpp/examples/Wrapper.cpp delete mode 100644 languages/cpp/include/BitwardenClient.h delete mode 100644 languages/cpp/include/BitwardenLibrary.h delete mode 100644 languages/cpp/include/BitwardenSettings.h delete mode 100644 languages/cpp/include/CommandRunner.h delete mode 100644 languages/cpp/include/Projects.h delete mode 100644 languages/cpp/include/Secrets.h delete mode 100644 languages/cpp/src/BitwardenClient.cpp delete mode 100644 languages/cpp/src/BitwardenLibrary.cpp delete mode 100644 languages/cpp/src/CommandRunner.cpp delete mode 100644 languages/cpp/src/Projects.cpp delete mode 100644 languages/cpp/src/Secrets.cpp delete mode 100644 languages/cpp/vcpkg.json delete mode 100644 languages/csharp/.editorconfig delete mode 100644 languages/csharp/Bitwarden.Sdk.Samples/Bitwarden.Sdk.Samples.csproj delete mode 100644 languages/csharp/Bitwarden.Sdk.Samples/Program.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/AuthClient.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenAuthException.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenClient.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenException.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenLibrary.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenSafeHandle.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/BitwardenSettings.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/CommandRunner.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/ProjectsClient.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/SecretsClient.cs delete mode 100644 languages/csharp/Bitwarden.Sdk/bitwarden.png delete mode 100644 languages/csharp/Bitwarden.sln delete mode 100644 languages/csharp/LICENSE.txt delete mode 100644 languages/csharp/README.md delete mode 100644 languages/csharp/global.json delete mode 100644 languages/go/.version delete mode 100644 languages/go/INSTRUCTIONS.md delete mode 100644 languages/go/README.md delete mode 100644 languages/go/bitwarden_client.go delete mode 100644 languages/go/command_runner.go delete mode 100644 languages/go/example/example.go delete mode 100644 languages/go/example/go.mod delete mode 100644 languages/go/example/go.sum delete mode 100644 languages/go/generators.go delete mode 100644 languages/go/go.mod delete mode 100644 languages/go/go.sum delete mode 100644 languages/go/internal/cinterface/bitwarden_library.go delete mode 100644 languages/go/project.go delete mode 100644 languages/go/secrets.go delete mode 100644 languages/go/util.go delete mode 100644 languages/java/.gitignore delete mode 100644 languages/java/INSTALL.md delete mode 100644 languages/java/README.md delete mode 100644 languages/java/build.gradle delete mode 100644 languages/java/example/Example.java delete mode 100644 languages/java/example/build.gradle delete mode 100644 languages/java/gradle/wrapper/gradle-wrapper.jar delete mode 100644 languages/java/gradle/wrapper/gradle-wrapper.properties delete mode 100755 languages/java/gradlew delete mode 100644 languages/java/gradlew.bat delete mode 100644 languages/java/settings.gradle delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/AuthClient.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/BitwardenClientException.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/BitwardenLibrary.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/BitwardenSettings.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/CommandRunner.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/ProjectsClient.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java delete mode 100644 languages/java/src/main/java/com/bitwarden/sdk/ThrowingFunction.java delete mode 100644 languages/js/example/index.js delete mode 100644 languages/js/example/package-lock.json delete mode 100644 languages/js/example/package.json delete mode 100644 languages/js/sdk-client/.gitignore delete mode 100644 languages/js/sdk-client/package-lock.json delete mode 100644 languages/js/sdk-client/package.json delete mode 100644 languages/js/sdk-client/src/client.ts delete mode 100644 languages/js/sdk-client/src/lib.ts delete mode 100644 languages/js/sdk-client/tsconfig.json delete mode 100644 languages/js/wasm/.gitignore delete mode 100644 languages/js/wasm/index.js delete mode 100644 languages/js/wasm/package.json delete mode 100644 languages/php/.gitignore delete mode 100644 languages/php/INSTALL.md delete mode 100644 languages/php/README.md delete mode 100644 languages/php/composer.json delete mode 100644 languages/php/composer.lock delete mode 100644 languages/php/example.php delete mode 100644 languages/php/src/AuthClient.php delete mode 100644 languages/php/src/BitwardenClient.php delete mode 100644 languages/php/src/BitwardenLib.php delete mode 100644 languages/php/src/BitwardenSettings.php delete mode 100644 languages/php/src/CommandRunner.php delete mode 100644 languages/php/src/ProjectsClient.php delete mode 100644 languages/php/src/SecretsClient.php delete mode 100644 languages/python/.gitignore delete mode 100644 languages/python/README.md delete mode 100644 languages/python/bitwarden_sdk/__init__.py delete mode 100644 languages/python/bitwarden_sdk/bitwarden_client.py delete mode 100755 languages/python/example.py delete mode 100644 languages/python/openapitools.json delete mode 100644 languages/python/pyproject.toml delete mode 100644 languages/ruby/.gitignore delete mode 100644 languages/ruby/CHANGELOG.md delete mode 100644 languages/ruby/README.md delete mode 100644 languages/ruby/bitwarden_sdk_secrets/Gemfile delete mode 100644 languages/ruby/bitwarden_sdk_secrets/Rakefile delete mode 100644 languages/ruby/bitwarden_sdk_secrets/bitwarden-sdk-secrets.gemspec delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/auth.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/bitwarden-sdk-secrets.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_error.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_lib.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/command_runner.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/extended_schemas/schemas.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/projects.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/secrets.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/lib/version.rb delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/auth.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/bitwarden-sdk-secrets.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_error.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_lib.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/command_runner.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/projects.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/secrets.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/sig/version.rbs delete mode 100644 languages/ruby/bitwarden_sdk_secrets/spec/settings_spec.rb delete mode 100644 languages/ruby/examples/example.rb delete mode 100755 languages/ruby/gen_ruby_typedefs.sh delete mode 100644 sig/bitwarden_sdk/bitwarden_client.rbs delete mode 100644 support/scripts/schemas.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e4fbb97b..b10ec1b4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,9 +10,3 @@ # Secrets Manager team crates/bitwarden-sm @bitwarden/team-secrets-manager-dev -crates/bws @bitwarden/team-secrets-manager-dev - -# BRE Automations -crates/bws/Cargo.toml -crates/bws/scripts/install.ps1 -crates/bws/scripts/install.sh diff --git a/.github/ISSUE_TEMPLATE/cli.yml b/.github/ISSUE_TEMPLATE/cli.yml deleted file mode 100644 index b747873b..00000000 --- a/.github/ISSUE_TEMPLATE/cli.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Secrets Manager CLI Bug Report -description: File a bug report for issues encountered using the Bitwarden Secrets Manager CLI (bws) -labels: [bug, bws] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - Please do not submit feature requests. The [Community Forums](https://community.bitwarden.com) has a section for submitting, voting for, and discussing product feature requests. - - type: textarea - id: reproduce - attributes: - label: Steps To Reproduce - description: How can we reproduce the behavior. - value: | - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. Click on '...' - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected Result - description: A clear and concise description of what you expected to happen. - validations: - required: true - - type: textarea - id: actual - attributes: - label: Actual Result - description: A clear and concise description of what is happening. - validations: - required: true - - type: textarea - id: screenshots - attributes: - label: Screenshots or Videos - description: If applicable, add screenshots and/or a short video to help explain your problem. - - type: textarea - id: additional-context - attributes: - label: Additional Context - description: Add any other context about the problem here. - - type: dropdown - id: os - attributes: - label: Operating System - description: What operating system are you seeing the problem on? - multiple: true - options: - - Windows - - macOS - - Linux - validations: - required: true - - type: input - id: os-version - attributes: - label: Operating System Version - description: What version of the operating system(s) are you seeing the problem on? - - type: dropdown - id: shell - attributes: - label: Shell - description: What shell(s) are you seeing the problem on? - multiple: true - options: - - Bash - - Zsh - - PowerShell - validations: - required: true - - type: input - id: version - attributes: - label: Build Version - description: What version of our software are you running? (run `bws --version`) - validations: - required: true - - type: checkboxes - id: issue-tracking-info - attributes: - label: Issue Tracking Info - description: | - Issue tracking information - options: - - label: I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 61d7e2b9..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,14 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Feature Requests - url: https://community.bitwarden.com/c/feature-requests/ - about: Request new features using the Community Forums. Please search existing feature requests before making a new one. - - name: Bitwarden Community Forums - url: https://community.bitwarden.com - about: Please visit the community forums for general community discussion, support and the development roadmap. - - name: Customer Support - url: https://bitwarden.com/contact/ - about: Please contact our customer support for account issues and general customer support. - - name: Security Issues - url: https://hackerone.com/bitwarden - about: We use HackerOne to manage security disclosures. diff --git a/.github/ISSUE_TEMPLATE/sdk.yml b/.github/ISSUE_TEMPLATE/sdk.yml deleted file mode 100644 index c5bb87a6..00000000 --- a/.github/ISSUE_TEMPLATE/sdk.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: SDK Bug Report -description: File a bug report for issues encountered using the Bitwarden SDK -labels: [bug, sdk] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - Please do not submit feature requests. The [Community Forums](https://community.bitwarden.com) has a section for submitting, voting for, and discussing product feature requests. - - type: textarea - id: reproduce - attributes: - label: Steps To Reproduce - description: How can we reproduce the behavior. - value: | - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. Click on '...' - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected Result - description: A clear and concise description of what you expected to happen. - validations: - required: true - - type: textarea - id: actual - attributes: - label: Actual Result - description: A clear and concise description of what is happening. - validations: - required: true - - type: textarea - id: screenshots - attributes: - label: Screenshots or Videos - description: If applicable, add screenshots and/or a short video to help explain your problem. - - type: textarea - id: additional-context - attributes: - label: Additional Context - description: Add any other context about the problem here. - - type: dropdown - id: os - attributes: - label: Operating System - description: What operating system are you seeing the problem on? - multiple: true - options: - - Windows - - macOS - - Linux - validations: - required: true - - type: input - id: os-version - attributes: - label: Operating System Version - description: What version of the operating system(s) are you seeing the problem on? - - type: input - id: version - attributes: - label: Build Version - description: What version of the SDK are you running? - validations: - required: true - - type: checkboxes - id: issue-tracking-info - attributes: - label: Issue Tracking Info - description: | - Issue tracking information - options: - - label: I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress. diff --git a/.github/workflows/build-cli-docker.yml b/.github/workflows/build-cli-docker.yml deleted file mode 100644 index 83daabf2..00000000 --- a/.github/workflows/build-cli-docker.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -name: Build bws Docker image - -on: - push: - branches: - - "main" - workflow_dispatch: - pull_request: - -env: - _AZ_REGISTRY: bitwardenprod.azurecr.io - -jobs: - build-docker: - name: Build Docker image - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Check Branch to Publish - id: publish-branch-check - run: | - if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then - echo "is_publish_branch=true" >> $GITHUB_ENV - else - echo "is_publish_branch=false" >> $GITHUB_ENV - fi - - ########## Set up Docker ########## - - name: Set up QEMU emulators - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - - ########## Login to Docker registries ########## - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} - - - name: Login to Azure ACR - run: az acr login -n ${_AZ_REGISTRY%.azurecr.io} - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve github PAT secrets - id: retrieve-secret-pat - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Setup Docker Trust - if: ${{ env.is_publish_branch == 'true' }} - uses: bitwarden/gh-actions/setup-docker-trust@main - with: - azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - azure-keyvault-name: "bitwarden-ci" - - ########## Generate image tag and build Docker image ########## - - name: Generate Docker image tag - id: tag - run: | - REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - IMAGE_TAG=$(echo "${REF}" | sed "s#/#-#g") # slash safe branch name - if [[ "${IMAGE_TAG}" == "main" ]]; then - IMAGE_TAG=dev - fi - - echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT - - - name: Generate tag list - id: tag-list - env: - IMAGE_TAG: ${{ steps.tag.outputs.image_tag }} - run: | - if [[ "${IMAGE_TAG}" == "dev" ]]; then - echo "tags=$_AZ_REGISTRY/bws:${IMAGE_TAG},bitwarden/bws:${IMAGE_TAG}" >> $GITHUB_OUTPUT - else - echo "tags=$_AZ_REGISTRY/bws:${IMAGE_TAG}" >> $GITHUB_OUTPUT - fi - - - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 - with: - context: . - file: crates/bws/Dockerfile - platforms: | - linux/amd64, - linux/arm64/v8 - push: true - tags: ${{ steps.tag-list.outputs.tags }} - secrets: | - "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" - - - name: Log out of Docker and disable Docker Notary - if: ${{ env.is_publish_branch == 'true' }} - run: | - docker logout - echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV - - check-failures: - name: Check for failures - if: always() - runs-on: ubuntu-22.04 - needs: build-docker - steps: - - name: Check if any job failed - if: github.ref == 'refs/heads/main' - env: - BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }} - run: | - if [ "$BUILD_DOCKER_STATUS" = "failure" ]; then - exit 1 - fi - - - name: Login to Azure - CI subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - if: failure() - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - if: failure() - with: - keyvault: "bitwarden-ci" - secrets: "devops-alerts-slack-webhook-url" - - - name: Notify Slack on failure - uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0 - if: failure() - env: - SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} - with: - status: ${{ job.status }} diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml deleted file mode 100644 index 9ffb3bde..00000000 --- a/.github/workflows/build-cli.yml +++ /dev/null @@ -1,467 +0,0 @@ ---- -name: Build CLI - -on: - pull_request: - push: - branches: - - "main" - workflow_dispatch: - -defaults: - run: - shell: bash - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - package_version: ${{ steps.retrieve-version.outputs.package_version }} - sign: ${{ steps.sign.outputs.sign }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Get Package Version - id: retrieve-version - run: | - VERSION=$(grep -o '^version = ".*"' crates/bws/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") - echo "package_version=$VERSION" >> $GITHUB_OUTPUT - - - name: Sign if repo is owned by Bitwarden - id: sign - env: - REPO_OWNER: ${{ github.repository_owner }} - run: | - if [[ $REPO_OWNER == bitwarden ]]; then - echo "sign=true" >> $GITHUB_OUTPUT - fi - echo "sign=false" >> $GITHUB_OUTPUT - - build-windows: - name: Building CLI for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} - needs: setup - env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - strategy: - fail-fast: false - matrix: - settings: - - os: windows-2022 - target: x86_64-pc-windows-msvc - - - os: windows-2022 - target: aarch64-pc-windows-msvc - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - - - name: Build - env: - TARGET: ${{ matrix.settings.target }} - run: cargo build -p bws --release --target=${{ matrix.settings.target }} - - - name: Login to Azure - if: ${{ needs.setup.outputs.sign == 'true' }} - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - if: ${{ needs.setup.outputs.sign == 'true' }} - id: retrieve-secrets-windows - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "code-signing-vault-url, - code-signing-client-id, - code-signing-tenant-id, - code-signing-client-secret, - code-signing-cert-name" - - - name: Install AST - if: ${{ needs.setup.outputs.sign == 'true' }} - run: dotnet tool install --global AzureSignTool --version 4.0.1 - - - name: Sign windows binary - if: ${{ needs.setup.outputs.sign == 'true' }} - env: - SIGNING_VAULT_URL: ${{ steps.retrieve-secrets-windows.outputs.code-signing-vault-url }} - SIGNING_CLIENT_ID: ${{ steps.retrieve-secrets-windows.outputs.code-signing-client-id }} - SIGNING_TENANT_ID: ${{ steps.retrieve-secrets-windows.outputs.code-signing-tenant-id }} - SIGNING_CLIENT_SECRET: ${{ steps.retrieve-secrets-windows.outputs.code-signing-client-secret }} - SIGNING_CERT_NAME: ${{ steps.retrieve-secrets-windows.outputs.code-signing-cert-name }} - run: | - azuresigntool sign -v \ - -kvu $SIGNING_VAULT_URL \ - -kvi $SIGNING_CLIENT_ID \ - -kvt $SIGNING_TENANT_ID \ - -kvs $SIGNING_CLIENT_SECRET \ - -kvc $SIGNING_CERT_NAME \ - -fd sha256 \ - -du https://bitwarden.com \ - -tr http://timestamp.digicert.com \ - ./target/${{ matrix.settings.target }}/release/bws.exe - - - name: Zip - shell: cmd - run: 7z a ./bws-${{ matrix.settings.target }}-%_PACKAGE_VERSION%.zip ./target/${{ matrix.settings.target }}/release/bws.exe - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - if-no-files-found: error - - build-macos: - name: Building CLI for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} - needs: setup - env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - strategy: - fail-fast: false - matrix: - settings: - - os: macos-13 - target: x86_64-apple-darwin - - - os: macos-13 - target: aarch64-apple-darwin - - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - - - name: Build - env: - TARGET: ${{ matrix.settings.target }} - run: cargo build -p bws --release --target=${{ matrix.settings.target }} - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets macos - id: retrieve-secrets-macos - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "macos-bws-notarization-apple-id, - macos-bws-notarization-team-id, - macos-bws-notarization-password, - macos-bws-certificate-name, - macos-bws-installer-certificate-name" - - - name: Decrypt secrets - env: - DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }} - run: | - mkdir -p $HOME/secrets - - gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ - --output "$HOME/secrets/devid-app-cert.p12" \ - "$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg" - - - name: Set up keychain - env: - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }} - run: | - security create-keychain -p $KEYCHAIN_PASSWORD build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain - security set-keychain-settings -lut 1200 build.keychain - - ls $HOME/secrets - - security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \ - -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild - - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain - - - name: Sign macos - env: - MACOS_CERTIFICATE_NAME: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-certificate-name }} - run: codesign --sign "$MACOS_CERTIFICATE_NAME" --verbose=3 --force --options=runtime --timestamp ./target/${{ matrix.settings.target }}/release/bws - - - name: Notarize app macos - env: - MACOS_NOTARIZATION_APPLE_ID: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-apple-id }} - MACOS_NOTARIZATION_TEAM_ID: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-team-id }} - MACOS_NOTARIZATION_PWD: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-password }} - MACOS_CERTIFICATE_NAME: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-certificate-name }} - run: | - echo "Create keychain profile" - xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" - - echo "Creating notarization archive" - zip -j ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip ./target/${{ matrix.settings.target }}/release/bws - - codesign --sign "$MACOS_CERTIFICATE_NAME" --verbose=3 --force --options=runtime --timestamp ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - - echo "Notarize app" - xcrun notarytool submit ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - if-no-files-found: error - - build-linux: - name: Building CLI for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} - needs: setup - env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - strategy: - fail-fast: false - matrix: - settings: - - os: ubuntu-20.04 - target: x86_64-unknown-linux-musl - - - os: ubuntu-20.04 - target: aarch64-unknown-linux-musl - - - os: ubuntu-20.04 - target: x86_64-unknown-linux-gnu - - - os: ubuntu-20.04 - target: aarch64-unknown-linux-gnu - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Set up Zig - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 - with: - version: 0.12.0 - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - - - name: Install Zigbuild - run: cargo install cargo-zigbuild --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 6f7e1336c9cd13cf1b3704f93c40fcf84caaed6b # 0.18.4 - - - name: Build - env: - TARGET: ${{ matrix.settings.target }} - run: cargo zigbuild -p bws --release --target=${{ matrix.settings.target }} - - - name: Zip linux - run: zip -j ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip ./target/${{ matrix.settings.target }}/release/bws - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip - if-no-files-found: error - - macos-universal-binary: - name: Generate universal macOS binary - runs-on: macos-13 - needs: - - setup - - build-macos - env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Download x86_64-apple-darwin artifact - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: bws-x86_64-apple-darwin-${{ env._PACKAGE_VERSION }}.zip - - - name: Download aarch64-apple-darwin artifact - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: bws-aarch64-apple-darwin-${{ env._PACKAGE_VERSION }}.zip - - - name: Unzip artifacts - run: | - unzip bws-x86_64-apple-darwin-${{ env._PACKAGE_VERSION }}.zip -d ./bws-x86_64-apple-darwin - unzip bws-aarch64-apple-darwin-${{ env._PACKAGE_VERSION }}.zip -d ./bws-aarch64-apple-darwin - - - name: Create universal package with lipo - run: | - mkdir ./bws-macos-universal - - lipo -create -output ./bws-macos-universal/bws ./bws-x86_64-apple-darwin/bws ./bws-aarch64-apple-darwin/bws - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets-macos - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "macos-bws-notarization-apple-id, - macos-bws-notarization-team-id, - macos-bws-notarization-password, - macos-bws-certificate-name, - macos-bws-installer-certificate-name" - - - name: Decrypt secrets - env: - DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }} - run: | - mkdir -p $HOME/secrets - - gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ - --output "$HOME/secrets/devid-app-cert.p12" \ - "$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg" - - - name: Set up keychain - env: - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }} - run: | - security create-keychain -p $KEYCHAIN_PASSWORD build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain - security set-keychain-settings -lut 1200 build.keychain - - security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \ - -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild - - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain - - - name: Sign binary - env: - MACOS_CERTIFICATE_NAME: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-certificate-name }} - run: codesign --sign "$MACOS_CERTIFICATE_NAME" --verbose=3 --force --options=runtime --timestamp ./bws-macos-universal/bws - - - name: Notarize app - env: - MACOS_NOTARIZATION_APPLE_ID: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-apple-id }} - MACOS_NOTARIZATION_TEAM_ID: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-team-id }} - MACOS_NOTARIZATION_PWD: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-notarization-password }} - MACOS_CERTIFICATE_NAME: ${{ steps.retrieve-secrets-macos.outputs.macos-bws-certificate-name }} - run: | - - echo "Create keychain profile" - xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" - - echo "Creating notarization archive" - zip -j ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip ./bws-macos-universal/bws - - codesign --sign "$MACOS_CERTIFICATE_NAME" --verbose=3 --force --options=runtime --timestamp ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip - - echo "Notarize app" - xcrun notarytool submit ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip - path: ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip - if-no-files-found: error - - third_party: - name: Generate THIRDPARTY.html - runs-on: ubuntu-22.04 - needs: - - setup - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: cargo-cli-about - - - name: Install cargo-about - run: cargo install cargo-about - - - name: Generate THIRDPARTY.html - working-directory: ./crates/bws - run: | - cargo about generate ../../about.hbs > THIRDPARTY.html - sed -i.bak 's/\$NAME\$/Bitwarden Secrets Manager CLI/g' THIRDPARTY.html - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: THIRDPARTY.html - path: ./crates/bws/THIRDPARTY.html - if-no-files-found: error - - manpages: - name: Generate manpages - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: cargo-cli-manpage - - - name: Generate manpages - run: | - cargo check -p bws --message-format json > build.json - OUT_DIR=$(jq -r --slurp '.[] | select (.reason == "build-script-executed") | select(.package_id|contains("crates/bws")) .out_dir' build.json) - mv $OUT_DIR/manpages . - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: manpages - path: ./manpages/* - if-no-files-found: error diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml deleted file mode 100644 index 68636936..00000000 --- a/.github/workflows/build-cpp.yml +++ /dev/null @@ -1,159 +0,0 @@ -name: Build C++ SDK - -on: - push: - branches: - - main - - rc - - hotfix-rc - - pull_request: - workflow_dispatch: - -jobs: - generate-schemas: - uses: ./.github/workflows/generate_schemas.yml - - build_rust: - uses: ./.github/workflows/build-rust-cross-platform.yml - - build: - name: Build for ${{ matrix.settings.os }} ${{ matrix.settings.target }} - needs: - - generate-schemas - - build_rust - runs-on: ${{ matrix.settings.os }} - strategy: - fail-fast: false - matrix: - settings: - - os: macos-13 - target: x86_64-apple-darwin - - - os: macos-13 - target: aarch64-apple-darwin - - - os: windows-2022 - target: x86_64-pc-windows-msvc - - - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: install dependencies linux - if: runner.os == 'Linux' - run: | - sudo apt-get install -y nlohmann-json3-dev - sudo apt-get install -y libboost-all-dev - - - name: install dependencies macos - if: runner.os == 'macOS' - run: | - brew install nlohmann-json - brew install boost - - - name: Export GitHub Actions cache environment variables - if: runner.os == 'Windows' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Download schemas - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: sdk-schemas-cpp - path: languages/cpp/include - - - name: Download ${{ matrix.settings.target }} files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-${{ matrix.settings.target }} - path: languages/cpp/include - - - name: Set permissions to include folder - if: runner.os == 'Windows' - shell: pwsh - run: | - Get-Acl languages/cpp/include/* | Format-List - - $path = "./languages/cpp/include" - $name = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name - $acl = Get-Acl languages/cpp/include - $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($name,"FullControl","Allow") - $acl.SetAccessRule($accessRule) - $acl | Set-Acl languages/cpp/include - Get-ChildItem -Path "$path" -Recurse -Force | Set-Acl -aclObject $acl -Verbose - - Get-Acl languages/cpp/include/* | Format-List - - - name: Ensure bitwarden-c is in include folder - working-directory: languages/cpp - shell: bash - run: | - if [[ '${{ runner.os }}' == 'macOS' || '${{ runner.os }}' == 'Linux' ]]; then - ls include/libbitwarden_c.* || { echo "Missing libbitwarden_c.*"; exit 1; } - fi - if [[ '${{ runner.os }}' == 'Windows' ]]; then - ls include/bitwarden_c.dll || { echo "Missing bitwarden_c.dll"; exit 1; } - ls include/bitwarden_c.dll.lib || { echo "Missing bitwarden_c.dll.lib"; exit 1; } - fi - - - name: Build unix - working-directory: languages/cpp - if: runner.os == 'macOS' || runner.os == 'Linux' - run: | - if [[ '${{ runner.os }}' == 'macOS' ]]; then - export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json - export DBOOST_PATH=/usr/local/opt/boost - export DTARGET=include/libbitwarden_c.dylib - fi - - if [[ '${{ runner.os }}' == 'Linux' ]]; then - export DNLOHMANN_PATH=/usr/share/doc/nlohmann-json3-dev - export DBOOST_PATH=/usr/share/doc/libboost-all-dev - export DTARGET=include/libbitwarden_c.so - fi - - mkdir build - cd build - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET - cmake --build . - - - name: Build windows - if: runner.os == 'Windows' - working-directory: languages/cpp - env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - run: | - mkdir build - cd build - $env:DTARGET="include\bitwarden_c.dll.lib" - cmake .. -DTARGET="$env:DTARGET" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" - cmake --build . --config Release - shell: pwsh - - - name: Copy artifacts - working-directory: languages/cpp/build - shell: bash - run: | - mkdir artifacts - if [[ '${{ runner.os }}' == 'macOS' || '${{ runner.os }}' == 'Linux' ]]; then - cp libbitwarden_c.* artifacts - cp libBitwardenClient.* artifacts - fi - if [[ '${{ runner.os }}' == 'Windows' ]]; then - cp */BitwardenClient.* artifacts - cp ../include/bitwarden_c.{lib,dll.lib,dll} artifacts - fi - - - name: Upload C++ package for ${{ matrix.settings.target }} - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: libbitwarden_cpp-${{ matrix.settings.target }} - path: languages/cpp/build/artifacts - if-no-files-found: error diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml deleted file mode 100644 index bb5d56b6..00000000 --- a/.github/workflows/build-dotnet.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Build .NET SDK - -on: - push: - branches: - - main - - rc - - hotfix-rc - pull_request: - workflow_dispatch: - -jobs: - generate_schemas: - uses: ./.github/workflows/generate_schemas.yml - - build_rust: - uses: ./.github/workflows/build-rust-cross-platform.yml - - version: - name: Get version - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install xmllint - run: sudo apt-get install -y libxml2-utils - - - name: Get version - id: version - run: | - VERSION=$(xmllint --xpath 'string(/Project/PropertyGroup/Version)' languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj) - echo "version=$VERSION" >> $GITHUB_OUTPUT - - build_dotnet: - name: Build .NET - runs-on: ubuntu-22.04 - needs: - - generate_schemas - - build_rust - - version - - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Download C# schemas artifact - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: schemas.cs - path: languages/csharp/Bitwarden.Sdk - - - name: Set up .NET Core - uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - with: - global-json-file: languages/csharp/global.json - - - name: Download x86_64-apple-darwin files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-apple-darwin - path: languages/csharp/Bitwarden.Sdk/macos-x64 - - - name: Download aarch64-apple-darwin files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-aarch64-apple-darwin - path: languages/csharp/Bitwarden.Sdk/macos-arm64 - - - name: Download x86_64-unknown-linux-gnu files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-unknown-linux-gnu - path: languages/csharp/Bitwarden.Sdk/linux-x64 - - - name: Download x86_64-pc-windows-msvc files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-pc-windows-msvc - path: languages/csharp/Bitwarden.Sdk/windows-x64 - - - name: Build .NET Project - working-directory: languages/csharp/Bitwarden.Sdk - run: | - dotnet restore - dotnet build --configuration Release - - - name: Pack NuGet Package - run: dotnet pack --configuration Release --output ./nuget-output /nologo /v:n - working-directory: languages/csharp/Bitwarden.Sdk - - - name: Upload NuGet package - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: Bitwarden.Sdk.${{ needs.version.outputs.version }}.nupkg - path: | - ./languages/csharp/Bitwarden.Sdk/nuget-output/*.nupkg diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml deleted file mode 100644 index ffb4d669..00000000 --- a/.github/workflows/build-go.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build Go SDK - -on: - push: - branches: - - main - - rc - - hotfix-rc - - pull_request: - -env: - GO111MODULE: on - GO_VERSION: "^1.21" - -jobs: - build: - name: Build - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup Go environment - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Cache dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: npm ci - run: npm ci - - - name: Generate schemas - run: npm run schemas - - - name: Build - working-directory: languages/go - run: go build -v ./... - - - name: Test - working-directory: languages/go - run: go test -v ./... diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml deleted file mode 100644 index 6994a5a6..00000000 --- a/.github/workflows/build-java.yml +++ /dev/null @@ -1,88 +0,0 @@ ---- -name: Build Java SDK - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - generate_schemas: - uses: ./.github/workflows/generate_schemas.yml - - build_rust: - uses: ./.github/workflows/build-rust-cross-platform.yml - - build_java: - name: Build Java - runs-on: ubuntu-22.04 - needs: - - generate_schemas - - build_rust - - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Download Java schemas artifact - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: sdk-schemas-java - path: languages/java/src/main/java/bit/sdk/schema/ - - - name: Setup Java - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 - with: - distribution: temurin - java-version: 17 - - - name: Download x86_64-apple-darwin files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-apple-darwin - path: languages/java/src/main/resources/darwin-x86-64 - - - name: Download aarch64-apple-darwin files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-aarch64-apple-darwin - path: languages/java/src/main/resources/darwin-aarch64 - - - name: Download x86_64-unknown-linux-gnu files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-unknown-linux-gnu - path: languages/java/src/main/resources/linux-x86-64 - - - name: Download x86_64-pc-windows-msvc files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: libbitwarden_c_files-x86_64-pc-windows-msvc - path: languages/java/src/main/resources/win32-x86-64 - - - name: Build Maven - run: ./gradlew build - working-directory: languages/java - - - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: build - path: ${{ github.workspace }}/languages/java/build - if-no-files-found: error - - - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: resources - path: ${{ github.workspace }}/languages/java/src/main/resources - if-no-files-found: error - - - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: schemas - path: languages/java/src/main/java/bit/sdk/schema - if-no-files-found: error diff --git a/.github/workflows/build-napi.yml b/.github/workflows/build-napi.yml deleted file mode 100644 index 41ed1d17..00000000 --- a/.github/workflows/build-napi.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -name: Build @bitwarden/sdk-napi - -on: - pull_request: - push: - branches: - - "main" - - "rc" - - "hotfix-rc" - workflow_dispatch: - -defaults: - run: - shell: bash - working-directory: crates/bitwarden-napi - -jobs: - generate_schemas: - uses: ./.github/workflows/generate_schemas.yml - - build: - name: Building @bitwarden/sdk-napi for - ${{ matrix.settings.os }} - runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} - needs: generate_schemas - strategy: - fail-fast: false - matrix: - settings: - - os: macos-13 - target: x86_64-apple-darwin - build: | - npm run build - strip -x *.node - - - os: macos-13 - target: aarch64-apple-darwin - build: | - npm run build-arm64 - strip -x *.node - - - os: windows-2022 - target: x86_64-pc-windows-msvc - build: npm run build - - - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - build: | - set -e && - npm run build && - strip *.node - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - with: - node-version: 18 - cache: "npm" - cache-dependency-path: crates/bitwarden-napi/package-lock.json - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - - - name: Retrieve schemas - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: schemas.ts - path: ${{ github.workspace }}/crates/bitwarden-napi/src-ts/bitwarden_client/ - - - name: Install dependencies - run: npm ci - - - name: Build - run: ${{ matrix.settings.build }} - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: sdk-bitwarden-napi-${{ matrix.settings.target }} - path: ${{ github.workspace }}/crates/bitwarden-napi/sdk-napi.*.node - if-no-files-found: error diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml deleted file mode 100644 index b3919567..00000000 --- a/.github/workflows/build-python-wheels.yml +++ /dev/null @@ -1,122 +0,0 @@ ---- -name: Build Python Wheels - -on: - pull_request: - push: - branches: - - "main" - - "rc" - - "hotfix-rc" - workflow_dispatch: - -defaults: - run: - shell: bash - working-directory: languages/python - -jobs: - generate_schemas: - uses: ./.github/workflows/generate_schemas.yml - - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - package_version: ${{ steps.retrieve-version.outputs.package_version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Get Package Version - id: retrieve-version - run: | - VERSION="$(grep -o '^version = ".*"' ../../crates/bitwarden-py/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")" - echo "package_version=$VERSION" >> $GITHUB_OUTPUT - - build: - name: Building Python wheel for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} - needs: - - generate_schemas - - setup - env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - strategy: - fail-fast: false - matrix: - settings: - - os: macos-13 - target: x86_64-apple-darwin - - - os: macos-13 - target: aarch64-apple-darwin - - - os: windows-2022 - target: x86_64-pc-windows-msvc - - - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - - - os: ubuntu-22.04 - target: aarch64-unknown-linux-gnu - - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - with: - node-version: 18 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - - - name: Retrieve schemas - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: schemas.py - path: ${{ github.workspace }}/languages/python/bitwarden_sdk - - - name: Build wheels - if: ${{ matrix.settings.target != 'x86_64-unknown-linux-gnu' }} - uses: PyO3/maturin-action@2c5c1560848aaa364c3545136054932db5fa27b7 # v1.44.0 - with: - target: ${{ matrix.settings.target }} - args: --release --find-interpreter --sdist - sccache: "true" - manylinux: "2_28" # https://github.com/pola-rs/polars/pull/12211 - working-directory: ${{ github.workspace }}/languages/python - - - name: Build wheels (Linux - x86_64) - if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} - uses: PyO3/maturin-action@2c5c1560848aaa364c3545136054932db5fa27b7 # v1.44.0 - with: - target: ${{ matrix.settings.target }} - args: --release --find-interpreter --sdist - container: quay.io/pypa/manylinux_2_28_x86_64:2023-11-20-745eb52 - sccache: "true" - manylinux: "2_28" # https://github.com/pola-rs/polars/pull/12211 - working-directory: ${{ github.workspace }}/languages/python - - - name: Upload wheels - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-${{ matrix.settings.target }} - path: ${{ github.workspace }}/target/wheels/bitwarden_sdk*.whl - - - name: Upload sdists - if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} # we only need one sdist - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-sdist - path: ${{ github.workspace }}/target/wheels/bitwarden_sdk-*.tar.gz diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml deleted file mode 100644 index 5a3f1a01..00000000 --- a/.github/workflows/build-ruby.yml +++ /dev/null @@ -1,95 +0,0 @@ ---- -name: Build Ruby - -on: - pull_request: - push: - branches: - - "main" - workflow_dispatch: - -jobs: - build: - name: Build Ruby - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Set up Ruby - uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0 - with: - ruby-version: 3.2 - - - name: Download artifacts - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: generate_schemas.yml - path: languages/ruby/bitwarden_sdk_secrets/lib - workflow_conclusion: success - branch: ${{ github.ref_name }} - artifacts: schemas.rb - - - name: Download x86_64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - path: temp/macos-x64 - workflow_conclusion: success - branch: ${{ github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-apple-darwin - - - name: Download aarch64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-apple-darwin - path: temp/macos-arm64 - - - name: Download x86_64-unknown-linux-gnu artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu - path: temp/linux-x64 - - - name: Download x86_64-pc-windows-msvc artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc - path: temp/windows-x64 - - - name: Copy lib files - run: | - mkdir -p languages/ruby/bitwarden_sdk_secrets/lib/macos-arm64 - mkdir -p languages/ruby/bitwarden_sdk_secrets/lib/linux-x64 - mkdir -p languages/ruby/bitwarden_sdk_secrets/lib/macos-x64 - mkdir -p languages/ruby/bitwarden_sdk_secrets/lib/windows-x64 - - platforms=("macos-arm64" "linux-x64" "macos-x64" "windows-x64") - files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll") - - for ((i=0; i<${#platforms[@]}; i++)); do - cp "temp/${platforms[$i]}/${files[$i]}" "languages/ruby/bitwarden_sdk_secrets/lib/${platforms[$i]}/${files[$i]}" - done - - - name: bundle install - run: bundle install - working-directory: languages/ruby/bitwarden_sdk_secrets - - - name: Build gem - run: gem build bitwarden-sdk-secrets.gemspec - working-directory: languages/ruby/bitwarden_sdk_secrets - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - path: bitwarden-sdk-secrets-*.gem - name: bitwarden-sdk-secrets diff --git a/.github/workflows/build-rust-cross-platform.yml b/.github/workflows/build-rust-cross-platform.yml deleted file mode 100644 index 1748661b..00000000 --- a/.github/workflows/build-rust-cross-platform.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Build Rust Cross Platform - -on: - workflow_call: - workflow_dispatch: - push: - branches: - - main - - rc - - hotfix-rc - pull_request: - -jobs: - build_rust: - name: Build for ${{ matrix.settings.os }} ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.os }} - strategy: - fail-fast: false - matrix: - settings: - - os: macos-13 - target: x86_64-apple-darwin - - os: macos-13 - target: aarch64-apple-darwin - - os: windows-2022 - target: x86_64-pc-windows-msvc - - os: windows-2022 - target: x86_64-pc-windows-gnu - # caution: updating the linux runner OS version for GNU - # targets will likely break libbitwarden_c for older OS versions. - # prefer using oldest supported runner for for these targets - - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - - os: ubuntu-22.04 - target: x86_64-unknown-linux-musl - - os: ubuntu-22.04 - target: aarch64-unknown-linux-musl - - steps: - - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - - - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 - if: ${{ contains(matrix.settings.target, 'musl') }} - with: - version: 0.12.0 - - - name: Install Zigbuild - if: ${{ contains(matrix.settings.target, 'musl') }} - run: cargo install cargo-zigbuild --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 6f7e1336c9cd13cf1b3704f93c40fcf84caaed6b # 0.18.4 - - - name: Add build architecture - run: rustup target add ${{ matrix.settings.target }} - - # Build Rust for musl - - name: Build Rust for - ${{ matrix.settings.target }} - if: ${{ contains(matrix.settings.target, 'musl') }} - env: - RUSTFLAGS: "-D warnings" - run: cargo zigbuild -p bitwarden-c --target ${{ matrix.settings.target }} --release - - # Build Rust for windows-gnu - - name: Build Rust for - ${{ matrix.settings.target }} - if: ${{ matrix.settings.target == 'x86_64-pc-windows-gnu' }} - env: - RUSTFLAGS: "-D warnings" - run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --profile=release-windows - - # Build Rust for !musl && !windows-gnu - - name: Build Rust for - ${{ matrix.settings.target }} - if: ${{ !contains(matrix.settings.target, 'musl') && matrix.settings.target != 'x86_64-pc-windows-gnu' }} - env: - RUSTFLAGS: "-D warnings" - MACOSX_DEPLOYMENT_TARGET: "10.14" # allows using new macos runner versions while still supporting older systems - run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release - - - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: libbitwarden_c_files-${{ matrix.settings.target }} - path: target/${{ matrix.settings.target }}/release/*bitwarden_c* - - - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: libbitwarden_c_files-${{ matrix.settings.target }} - path: target/${{ matrix.settings.target }}/release-windows/*bitwarden_c* diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml deleted file mode 100644 index 35c0ca6b..00000000 --- a/.github/workflows/build-wasm.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -name: Build @bitwarden/sdk-wasm - -on: - pull_request: - push: - branches: - - "main" - - "rc" - - "hotfix-rc" - workflow_dispatch: - -defaults: - run: - shell: bash - working-directory: crates/bitwarden-wasm - -jobs: - build: - name: Building @bitwarden/sdk-wasm - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - with: - node-version: 18 - registry-url: "https://npm.pkg.github.com" - cache: "npm" - - - name: Install dependencies - run: npm i -g binaryen - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: wasm32-unknown-unknown - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - key: wasm-cargo-cache - - - name: Install wasm-bindgen-cli - run: cargo install wasm-bindgen-cli - - - name: Build - run: ./build.sh -r - - - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: sdk-bitwarden-wasm - path: ${{ github.workspace }}/languages/js/wasm/* - if-no-files-found: error - - - name: Set version - if: ${{ github.ref == 'refs/heads/main' }} - # Fetches current version from registry and uses prerelease to bump it - run: | - npm version --no-git-tag-version $(npm view @bitwarden/sdk-wasm@latest version) - npm version --no-git-tag-version prerelease - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - working-directory: languages/js/wasm - - - name: Publish NPM - if: ${{ github.ref == 'refs/heads/main' }} - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - working-directory: languages/js/wasm diff --git a/.github/workflows/publish-bws.yml b/.github/workflows/publish-bws.yml deleted file mode 100644 index dc939a5d..00000000 --- a/.github/workflows/publish-bws.yml +++ /dev/null @@ -1,215 +0,0 @@ ---- -name: Publish bws CLI -run-name: Publish bws CLI ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Version to publish (default: latest bws cli release)" - required: true - type: string - default: latest - -env: - _AZ_REGISTRY: bitwardenprod.azurecr.io - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version-output.outputs.version }} - release-tag: ${{ steps.version-output.outputs.tag_name }} - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("bws")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - - name: Create GitHub deployment - if: ${{ inputs.release_type != 'Dry Run' }} - uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7 - id: deployment - with: - token: "${{ secrets.GITHUB_TOKEN }}" - initial-status: "in_progress" - environment: "bws CLI - Production" - description: "Deployment ${{ steps.version-output.outputs.version }} from branch ${{ github.ref_name }}" - task: release - - publish: - name: Publish bws to crates.io - runs-on: ubuntu-22.04 - needs: setup - env: - _VERSION: ${{ needs.setup.outputs.release-version }} - _TAG_NAME: ${{ needs.setup.outputs.release-tag }} - steps: - - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - ref: ${{ env._TAG_NAME }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "cratesio-api-token" - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - - - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - - - name: Install cargo-release - run: cargo install cargo-release - - - name: Cargo release - if: ${{ inputs.release_type != 'Dry Run' }} - env: - PUBLISH_GRACE_SLEEP: 10 - CARGO_REGISTRY_TOKEN: ${{ steps.retrieve-secrets.outputs.cratesio-api-token }} - run: cargo-release release publish -p bws --execute --no-confirm - - publish-docker: - name: Publish docker versioned and latest image - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - ref: ${{ env._TAG_NAME }} - - - name: Generate tag list - id: tag-list - env: - VERSION: ${{ needs.setup.outputs.release-version }} - DRY_RUN: ${{ inputs.release_type == 'Dry Run' }} - run: | - if [[ "${DRY_RUN}" == "true" ]]; then - REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - IMAGE_TAG=$(echo "${REF}" | sed "s#/#-#g") # slash safe branch name - echo "tags=$_AZ_REGISTRY/bws:${IMAGE_TAG},bitwarden/bws:${IMAGE_TAG}" >> $GITHUB_OUTPUT - else - echo "tags=$_AZ_REGISTRY/bws:${VERSION},bitwarden/bws:${VERSION},$_AZ_REGISTRY/bws:latest,bitwarden/bws:latest" >> $GITHUB_OUTPUT - fi - - ########## Set up Docker ########## - - name: Set up QEMU emulators - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - - ########## Login to Docker registries ########## - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} - - - name: Login to Azure ACR - run: az acr login -n ${_AZ_REGISTRY%.azurecr.io} - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve github PAT secrets - id: retrieve-secret-pat - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Setup Docker Trust - uses: bitwarden/gh-actions/setup-docker-trust@main - with: - azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - azure-keyvault-name: "bitwarden-ci" - - - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 - with: - context: . - file: crates/bws/Dockerfile - platforms: | - linux/amd64, - linux/arm64/v8 - push: ${{ inputs.release_type != 'Dry Run' }} - tags: ${{ steps.tag-list.outputs.tags }} - secrets: | - "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" - - - name: Log out of Docker and disable Docker Notary - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - docker logout - echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV - - update_release_status: - name: Update GitHub deployment status - runs-on: ubuntu-22.04 - needs: setup - if: ${{ inputs.release_type != 'Dry Run' }} - env: - _DEPLOYMENT_ID: ${{ needs.setup.outputs.deployment-id }} - steps: - - name: Update deployment status to Success - if: ${{ inputs.release_type != 'Dry Run' && success() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "success" - deployment-id: ${{ env._DEPLOYMENT_ID }} - - - name: Update deployment status to Failure - if: ${{ inputs.release_type != 'Dry Run' && failure() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "failure" - deployment-id: ${{ env._DEPLOYMENT_ID }} diff --git a/.github/workflows/publish-dotnet.yml b/.github/workflows/publish-dotnet.yml deleted file mode 100644 index 1e2fc06f..00000000 --- a/.github/workflows/publish-dotnet.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Publish .NET NuGet -run-name: Publish .NET NuGet Package ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -env: - _KEY_VAULT: "bitwarden-ci" - -jobs: - validate: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version-output.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("dotnet")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - deploy: - name: Deploy - runs-on: ubuntu-22.04 - needs: validate - steps: - - name: Create GitHub deployment - if: ${{ inputs.release_type != 'Dry Run' }} - uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7 - id: deployment - with: - token: "${{ secrets.GITHUB_TOKEN }}" - initial-status: "in_progress" - environment: "dotnet - Production" - description: "Deployment ${{ needs.validate.outputs.version }} from branch ${{ github.ref_name }}" - task: release - - - name: Download artifact - run: | - mkdir -p nuget-output - cd nuget-output - wget https://github.com/bitwarden/sdk/releases/download/dotnet-v${{ needs.validate.outputs.version }}/Bitwarden.Sdk.${{ needs.validate.outputs.version }}.nupkg - - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "nuget-api-key" - - - name: Publish NuGet Package - if: ${{ inputs.release_type != 'Dry Run' }} - env: - NUGET_API_KEY: ${{ steps.retrieve-secrets.outputs.nuget-api-key }} - run: dotnet nuget push ./nuget-output/*.nupkg -k ${{ env.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json - - - name: Update deployment status to Success - if: ${{ inputs.release_type != 'Dry Run' && success() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "success" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status to Failure - if: ${{ inputs.release_type != 'Dry Run' && failure() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "failure" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml deleted file mode 100644 index 002a61ee..00000000 --- a/.github/workflows/publish-java.yml +++ /dev/null @@ -1,128 +0,0 @@ ---- -name: Publish Java SDK -run-name: Publish Java SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -defaults: - run: - shell: bash - working-directory: languages/java - -env: - _KEY_VAULT: "bitwarden-ci" - -jobs: - validate: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version-output.outputs.version }} - tag_name: ${{ steps.version-output.outputs.tag_name }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - publish: - name: Publish - runs-on: ubuntu-22.04 - needs: validate - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - ref: ${{ needs.validate.outputs.tag_name }} - - - name: Azure login - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "maven-sonartype-ssrh-username, - maven-sonartype-ossrh-password" - - - name: Setup java - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 - with: - distribution: temurin - java-version: 17 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0 - - - name: Download Java SDK Build - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-java.yml - workflow_conclusion: success - artifacts: build - path: languages/java/build - - - name: Download Java Resources - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-java.yml - workflow_conclusion: success - artifacts: resources - path: languages/java/src/main/resources - - - name: Download Java Resources - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-java.yml - workflow_conclusion: success - artifacts: schemas - path: languages/java/src/main/java/bit/sdk/schema - - - name: Publish package to GitHub Packages - if: ${{ inputs.release_type != 'Dry Run' }} - run: ./gradlew publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MAVEN_USERNAME: ${{ steps.retrieve-secrets.outputs.maven-sonartype-ssrh-username }} - MAVEN_PASSWORD: ${{ steps.retrieve-secrets.outputs.maven-sonartype-ossrh-password }} diff --git a/.github/workflows/publish-napi.yml b/.github/workflows/publish-napi.yml deleted file mode 100644 index 6a284d4a..00000000 --- a/.github/workflows/publish-napi.yml +++ /dev/null @@ -1,155 +0,0 @@ ---- -name: Publish @bitwarden/sdk-napi -run-name: Publish @bitwarden/sdk-napi ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -defaults: - run: - working-directory: crates/bitwarden-napi - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version-output.outputs.version }} - tag-name: ${{ steps.version-output.outputs.tag_name }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("napi")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - npm: - name: Publish NPM - runs-on: ubuntu-22.04 - needs: setup - env: - _PKG_VERSION: ${{ needs.setup.outputs.release-version }} - _TAG_NAME: ${{ needs.setup.outputs.tag-name }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: ${{ env._TAG_NAME }} - - - name: Create GitHub deployment - if: ${{ inputs.release_type != 'Dry Run' }} - uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7 - id: deployment - with: - token: "${{ secrets.GITHUB_TOKEN }}" - initial-status: "in_progress" - environment: "Bitwarden SDK NAPI - Production" - description: "Deployment ${{ env._PKG_VERSION }} from branch ${{ github.ref_name }}" - task: release - - - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: 18 - cache: "npm" - cache-dependency-path: crates/bitwarden-napi/package-lock.json - - - name: Download schemas.ts artifact - run: | - wget https://github.com/bitwarden/sdk/releases/download/napi-v${{ env._PKG_VERSION }}/schemas.ts - mv schemas.ts ${{ github.workspace }}/crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts - - - name: Install dependencies - run: npm ci - - - name: Run tsc - run: npm run tsc - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "npm-api-key" - - - name: Download sdk-napi artifacts - run: | - wget https://github.com/bitwarden/sdk/releases/download/napi-v${{ env._PKG_VERSION }}/sdk-napi.darwin-arm64.node - wget https://github.com/bitwarden/sdk/releases/download/napi-v${{ env._PKG_VERSION }}/sdk-napi.darwin-x64.node - wget https://github.com/bitwarden/sdk/releases/download/napi-v${{ env._PKG_VERSION }}/sdk-napi.win32-x64-msvc.node - wget https://github.com/bitwarden/sdk/releases/download/napi-v${{ env._PKG_VERSION }}/sdk-napi.linux-x64-gnu.node - mv sdk-napi.*.node ${{ github.workspace }}/crates/bitwarden-napi/artifacts - - - name: Move artifacts - run: npm run artifacts - - - name: Setup NPM - run: | - echo 'registry="https://registry.npmjs.org/"' > ./.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc - - echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - env: - NPM_TOKEN: ${{ steps.retrieve-secrets.outputs.npm-api-key }} - - - name: Publish NPM - if: ${{ inputs.release_type != 'Dry Run' }} - run: npm publish --access public --registry=https://registry.npmjs.org/ --userconfig=./.npmrc - - - name: Update deployment status to Success - if: ${{ inputs.release_type != 'Dry Run' && success() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "success" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status to Failure - if: ${{ inputs.release_type != 'Dry Run' && failure() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "failure" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/publish-php.yml b/.github/workflows/publish-php.yml deleted file mode 100644 index 986923ab..00000000 --- a/.github/workflows/publish-php.yml +++ /dev/null @@ -1,270 +0,0 @@ ---- -name: Publish PHP SDK -run-name: Publish PHP SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -env: - _KEY_VAULT: "bitwarden-ci" - -jobs: - validate: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Get version - id: version - run: | - VERSION=$(cat languages/php/composer.json | grep -Eo '"version": "[0-9]+\.[0-9]+\.[0-9]+"' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - echo "version=$VERSION" >> $GITHUB_OUTPUT - - setup-php: - name: Setup PHP - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup PHP with PECL extension - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1 - with: - php-version: "8.0" - tools: composer - extensions: ext-ffi - - - name: Composer check - run: | - composer update - composer install - composer validate - working-directory: languages/php/ - - repo-sync: - name: Push changed files to SDK PHP repo - runs-on: ubuntu-22.04 - needs: - - validate - - setup-php - env: - _BOT_EMAIL: 106330231+bitwarden-devops-bot@users.noreply.github.com - _BOT_NAME: bitwarden-devops-bot - _PKG_VERSION: ${{ needs.validate.outputs.version }} - steps: - - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - path: sdk - - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - repository: bitwarden/sm-sdk-php - path: sm-sdk-php - ref: main - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - - - name: Setup Git - working-directory: sm-sdk-php - run: | - git config --local user.email "${{ env._BOT_EMAIL }}" - git config --local user.name "${{ env._BOT_NAME }}" - - - name: Update files - run: | - # Copy files to local sm-sdk-php repo path - cp --verbose -rf sdk/languages/php/. sm-sdk-php - - - name: Replace repo name - working-directory: sm-sdk-php - run: | - find . -name '*' -exec \ - sed -i -e 's/github.com\/bitwarden\/sdk\/languages\/php/github.com\/bitwarden\/sm-sdk-php/g' {} \; - - find . -name '*' -exec \ - sed -i -e 's/github.com\/bitwarden\/sdk/github.com\/bitwarden\/sm-sdk-php/g' {} \; - - - name: Push changes - working-directory: sm-sdk-php - run: | - git add . - git commit -m "Update PHP SDK to ${{ github.sha }}" - - if [[ "${{ inputs.release_type }}" == "Dry Run" ]]; then - echo "===================================" - echo "[!] Dry Run - Skipping push" - echo "===================================" - git ls-files -m - exit 0 - else - git push origin main - fi - - - name: Create release tag on PHP SDK repo - if: ${{ inputs.release_type != 'Dry Run' }} - working-directory: sm-sdk-php - run: | - # Check if tag exists, set output then exit 0 if true. - if git log v${{ env._PKG_VERSION }} >/dev/null 2>&1; then - echo "===================================" - echo "[!] Tag v${{ env._PKG_VERSION }} already exists" - echo "===================================" - exit 1 - fi - - git tag v${{ env._PKG_VERSION }} - git push origin v${{ env._PKG_VERSION }} - - github-release: - name: GitHub Release - runs-on: ubuntu-22.04 - needs: - - setup-php - - repo-sync - - validate - env: - _PKG_VERSION: ${{ needs.validate.outputs.version }} - steps: - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Download x86_64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: main - artifacts: libbitwarden_c_files-x86_64-apple-darwin - skip_unpack: true - - - name: Download aarch64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: main - artifacts: libbitwarden_c_files-aarch64-apple-darwin - skip_unpack: true - - - name: Download x86_64-unknown-linux-gnu artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: main - artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu - skip_unpack: true - - - name: Download x86_64-pc-windows-msvc artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: main - artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc - skip_unpack: true - - - name: Rename build artifacts - run: | - mv libbitwarden_c_files-x86_64-apple-darwin.zip libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION.zip - mv libbitwarden_c_files-aarch64-apple-darwin.zip libbitwarden_c_files-aarch64-apple-darwin-$_PKG_VERSION.zip - mv libbitwarden_c_files-x86_64-unknown-linux-gnu.zip libbitwarden_c_files-x86_64-unknown-linux-gnu-$_PKG_VERSION.zip - mv libbitwarden_c_files-x86_64-pc-windows-msvc.zip libbitwarden_c_files-x86_64-pc-windows-msvc-$_PKG_VERSION.zip - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - with: - tag: v${{ env._PKG_VERSION }} - name: v${{ env._PKG_VERSION }} - body: "" - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - draft: true - repo: sm-sdk-php - owner: bitwarden - artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-pc-windows-msvc-${{ env._PKG_VERSION }}.zip" - - packagist-publish: - name: Publish to Packagist - runs-on: ubuntu-22.04 - needs: - - validate - - setup-php - - repo-sync - - github-release - steps: - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope, - packagist-key" - - - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - repository: bitwarden/sm-sdk-php - path: sm-sdk-php - ref: main - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - - - name: Publish version - if: ${{ inputs.release_type != 'Dry Run' }} - env: - PACKAGIST_KEY: ${{ steps.retrieve-secrets.outputs.packagist-key }} - run: curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=bitwarden&apiToken=${{ env.PACKAGIST_KEY }}' -d'{"repository":{"url":"https://packagist.org/packages/bitwarden/sdk-secrets"}}' - working-directory: sm-sdk-php diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml deleted file mode 100644 index 7e339509..00000000 --- a/.github/workflows/publish-python.yml +++ /dev/null @@ -1,132 +0,0 @@ ---- -name: Publish Python SDK -run-name: Publish Python SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -defaults: - run: - shell: bash - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version-output.outputs.version }} - tag_name: ${{ steps.version-output.outputs.tag_name }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("python")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - publish: - name: Publish - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: ${{ needs.setup.outputs.tag_name }} - - - name: Install Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: "3.9" - - - name: Install twine - run: pip install twine - - - name: Get release assets - working-directory: ${{ github.workspace }}/target/wheels/dist - run: | - ARTIFACT_URLS=$(curl -sSL https://api.github.com/repos/bitwarden/sdk/releases/tags/${{ needs.setup.outputs.tag_name }} | jq -r '.assets[].browser_download_url') - for url in $ARTIFACT_URLS; do - wget $url - done - - - name: Unpack release assets - working-directory: ${{ github.workspace }}/target/wheels/dist - run: | - for file in *.zip; do - unzip $file - done - - - name: Move files - working-directory: ${{ github.workspace }}/target/wheels/dist - run: | - find . -maxdepth 2 -type f -print0 | xargs -0 mv -t . - rm -rf */ - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve pypi api token - id: retrieve-secret - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "pypi-api-token, - pypi-test-api-token" - - - name: Check - working-directory: ${{ github.workspace }}/target/wheels - run: twine check dist/* - - - name: Publish - if: ${{ inputs.release_type != 'Dry Run' }} - working-directory: ${{ github.workspace }}/target/wheels - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ steps.retrieve-secret.outputs.pypi-api-token }} - run: twine upload --repository pypi dist/* - - - name: Dry Run - Publish - if: ${{ inputs.release_type == 'Dry Run' }} - working-directory: ${{ github.workspace }}/target/wheels - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ steps.retrieve-secret.outputs.pypi-test-api-token }} - run: twine upload --repository testpypi dist/* diff --git a/.github/workflows/publish-ruby.yml b/.github/workflows/publish-ruby.yml deleted file mode 100644 index 875def06..00000000 --- a/.github/workflows/publish-ruby.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Publish Ruby SDK -run-name: Publish Ruby SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -permissions: - contents: read - id-token: write - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version-output.outputs.version }} - tag-name: ${{ steps.version-output.outputs.tag_name }} - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("ruby")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - publish: - name: Publish - runs-on: ubuntu-22.04 - needs: setup - env: - _VERSION: ${{ needs.setup.outputs.release-version }} - _TAG_NAME: ${{ needs.setup.outputs.tag-name }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: ${{ env._TAG_NAME }} - - - name: Create GitHub deployment - if: ${{ inputs.release_type != 'Dry Run' }} - uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7 - id: deployment - with: - token: "${{ secrets.GITHUB_TOKEN }}" - initial-status: "in_progress" - environment: "Bitwarden Ruby SDK - Production" - description: "Deployment ${{ env._VERSION }} from branch ${{ github.ref_name }}" - task: release - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "rubygem-api-key" - - - name: Download ruby artifact - run: wget https://github.com/bitwarden/sdk/releases/download/ruby-v${{ env._VERSION }}/bitwarden-sdk-secrets-${{ env._VERSION }}.gem - - - name: Push gem to Rubygems - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem push *.gem - env: - GEM_HOST_API_KEY: ${{ steps.retrieve-secrets.outputs.rubygem-api-key }} - working-directory: languages/ruby/bitwarden_sdk_secrets - - - name: Update deployment status to Success - if: ${{ inputs.release_type != 'Dry Run' && success() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "success" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status to Failure - if: ${{ inputs.release_type != 'Dry Run' && failure() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "failure" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml deleted file mode 100644 index 95a86a0c..00000000 --- a/.github/workflows/publish-wasm.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -name: Publish @bitwarden/sdk-wasm -run-name: Publish @bitwarden/sdk-wasm ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - version: - description: "Release Version" - required: false - default: "latest" - -defaults: - run: - working-directory: languages/js/wasm - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version-output.outputs.version }} - tag_name: ${{ steps.version-output.outputs.tag_name }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Version output - id: version-output - run: | - if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("napi")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') - echo "Latest Released Version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - - echo "Latest Released Tag name: $TAG_NAME" - echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT - else - echo "Release Version: ${{ inputs.version }}" - echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT - fi - - npm: - name: Publish NPM - runs-on: ubuntu-22.04 - needs: setup - env: - _VERSION: ${{ needs.setup.outputs.release-version }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: ${{ needs.setup.outputs.tag_name }} - - - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: 18 - cache: "npm" - - - name: Login to Azure - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "npm-api-key" - - - name: Download artifact - run: | - cd ${{ github.workspace }}/languages/js/wasm - wget https://github.com/bitwarden/sdk/releases/download/wasm-v${{ env._VERSION }}/sdk-bitwarden-wasm.zip - unzip sdk-bitwarden-wasm.zip - rm sdk-bitwarden-wasm.zip - - - name: Create GitHub deployment - if: ${{ inputs.release_type != 'Dry Run' }} - uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7 - id: deployment - with: - token: "${{ secrets.GITHUB_TOKEN }}" - initial-status: "in_progress" - environment: "Bitwarden SDK WASM - Production" - description: "Deployment ${{ env._VERSION }} from branch ${{ github.ref_name }}" - task: release - - - name: Setup NPM - run: | - echo 'registry="https://registry.npmjs.org/"' > ./.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc - - echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - env: - NPM_TOKEN: ${{ steps.retrieve-secrets.outputs.npm-api-key }} - - - name: Publish NPM - if: ${{ inputs.release_type != 'Dry Run' }} - run: npm publish --access public --registry=https://registry.npmjs.org/ --userconfig=./.npmrc - - - name: Update deployment status to Success - if: ${{ inputs.release_type != 'Dry Run' && success() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "success" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status to Failure - if: ${{ inputs.release_type != 'Dry Run' && failure() }} - uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3 - with: - token: "${{ secrets.GITHUB_TOKEN }}" - state: "failure" - deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/release-bws.yml b/.github/workflows/release-bws.yml deleted file mode 100644 index 92a8544b..00000000 --- a/.github/workflows/release-bws.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -name: Release bws CLI -run-name: Release bws CLI ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Check Release Version - id: version - run: | - VERSION=$(grep -o '^version = ".*"' crates/bws/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Download all Release artifacts - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-cli.yml - path: packages - workflow_conclusion: success - branch: ${{ github.ref_name }} - - - name: Get checksum files - uses: bitwarden/gh-actions/get-checksum@main - with: - packages_dir: "packages" - file_path: "packages/bws-sha256-checksums-${{ steps.version.outputs.version }}.txt" - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - PKG_VERSION: ${{ steps.version.outputs.version }} - with: - artifacts: "packages/bws-x86_64-apple-darwin-${{ env.PKG_VERSION }}.zip, - packages/bws-aarch64-apple-darwin-${{ env.PKG_VERSION }}.zip, - packages/bws-macos-universal-${{ env.PKG_VERSION }}.zip, - packages/bws-x86_64-pc-windows-msvc-${{ env.PKG_VERSION }}.zip, - packages/bws-aarch64-pc-windows-msvc-${{ env.PKG_VERSION }}.zip, - packages/bws-x86_64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip, - packages/bws-aarch64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip, - packages/THIRDPARTY.html, - packages/bws-sha256-checksums-${{ env.PKG_VERSION }}.txt" - commit: ${{ github.sha }} - tag: bws-v${{ env.PKG_VERSION }} - name: bws CLI v${{ env.PKG_VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml deleted file mode 100644 index 47199a99..00000000 --- a/.github/workflows/release-cpp.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: Release C++ SDK -run-name: Release C++ SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -env: - _KEY_VAULT: "bitwarden-ci" - -jobs: - validate: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]] ; then - echo "===================================" - echo "[!] Can only release from the 'main' branches" - echo "===================================" - exit 1 - fi - - - name: Get version - id: version - run: | - VERSION=$(cat languages/cpp/vcpkg.json | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") - echo "version=$VERSION" >> $GITHUB_OUTPUT - - github-release: - name: GitHub Release - runs-on: ubuntu-22.04 - needs: validate - env: - _PKG_VERSION: ${{ needs.validate.outputs.version }} - steps: - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Download x86_64-apple-darwin C artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-apple-darwin - skip_unpack: true - - - name: Download aarch64-apple-darwin C artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-apple-darwin - skip_unpack: true - - - name: Download x86_64-unknown-linux-gnu C artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu - skip_unpack: true - - - name: Download x86_64-pc-windows-msvc C artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc - skip_unpack: true - - - name: Rename C build artifacts - run: | - artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc") # aarch64-unknown-linux-gnu) - for value in "${artifacts[@]}" - do - unzip libbitwarden_c_files-$value.zip -d libbitwarden_c_files-$value - cd libbitwarden_c_files-$value - zip -Rj ../libbitwarden_c_files-$value-$_PKG_VERSION.zip 'libbitwarden_c.*' - cd .. - done - - - name: Download schemas - uses: bitwarden/gh-actions/download-artifacts@main - with: - name: sdk-schemas-cpp - workflow: generate_schemas.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: sdk-schemas-cpp - skip_unpack: true - - - name: Rename schemas artifacts - run: mv sdk-schemas-cpp.zip sdk-schemas-cpp-$_PKG_VERSION.zip - - - name: Download x86_64-apple-darwin C++ artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-cpp.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_cpp-x86_64-apple-darwin - skip_unpack: true - - - name: Download x86_64-unknown-linux-gnu C++ artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-cpp.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_cpp-x86_64-unknown-linux-gnu - skip_unpack: true - - - name: Rename C++ build artifacts - run: | - artifacts=("x86_64-apple-darwin" "x86_64-unknown-linux-gnu") # "x86_64-pc-windows-msvc" "aarch64-apple-darwin" "aarch64-unknown-linux-gnu") - for value in "${artifacts[@]}" - do - mv libbitwarden_cpp-$value.zip libbitwarden_cpp_files-$value-$_PKG_VERSION.zip - done - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - with: - tag: cpp-sdk-v${{ env._PKG_VERSION }} - name: "C++ SDK v${{ env._PKG_VERSION }}" - body: "" - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - draft: true - repo: sdk - owner: bitwarden - artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-pc-windows-msvc-${{ env._PKG_VERSION }}.zip, - libbitwarden_cpp_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, - libbitwarden_cpp_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, - sdk-schemas-cpp-${{ env._PKG_VERSION }}.zip" diff --git a/.github/workflows/release-dotnet.yml b/.github/workflows/release-dotnet.yml deleted file mode 100644 index dc853927..00000000 --- a/.github/workflows/release-dotnet.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Release .NET NuGet -run-name: Release .NET NuGet Package ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Install xmllint - run: sudo apt-get install -y libxml2-utils - - - name: Get version - id: version - run: | - VERSION=$(xmllint --xpath 'string(/Project/PropertyGroup/Version)' languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj) - echo "version=$VERSION" >> $GITHUB_OUTPUT - - release: - name: Create GitHub release - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Download NuGet package - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-dotnet.yml - workflow_conclusion: success - branch: main - artifacts: Bitwarden.Sdk.${{ needs.setup.outputs.version }}.nupkg - path: ./nuget-output - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - PKG_VERSION: ${{ needs.setup.outputs.version }} - with: - commit: ${{ github.sha }} - tag: dotnet-v${{ env.PKG_VERSION }} - name: .NET NuGet v${{ env.PKG_VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - artifacts: | - ./nuget-output/Bitwarden.Sdk.${{ needs.setup.outputs.version }}.nupkg diff --git a/.github/workflows/release-go.yml b/.github/workflows/release-go.yml deleted file mode 100644 index f88e52af..00000000 --- a/.github/workflows/release-go.yml +++ /dev/null @@ -1,283 +0,0 @@ -name: Release Go SDK -run-name: Release Go SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -env: - GO111MODULE: on - GO_VERSION: "^1.21" - _KEY_VAULT: "bitwarden-ci" - -jobs: - validate: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then - echo "===================================" - echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" - echo "===================================" - exit 1 - fi - - - name: Get version - id: version - run: | - VERSION=$(cat languages/go/.version | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") - echo "version=$VERSION" >> $GITHUB_OUTPUT - - repo-sync: - name: Push changed files to SDK Go repo - runs-on: ubuntu-22.04 - needs: validate - env: - _BOT_EMAIL: 106330231+bitwarden-devops-bot@users.noreply.github.com - _BOT_NAME: bitwarden-devops-bot - _PKG_VERSION: ${{ needs.validate.outputs.version }} - - steps: - - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - path: sdk - - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Checkout SDK-Go repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - repository: bitwarden/sdk-go - path: sdk-go - ref: main - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - - - name: Setup Git - working-directory: sdk-go - run: | - git config --local user.email "${{ env._BOT_EMAIL }}" - git config --local user.name "${{ env._BOT_NAME }}" - - - name: Download x86_64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-apple-darwin - skip_unpack: true - - - name: Download aarch64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-apple-darwin - skip_unpack: true - - - name: Download x86_64-unknown-linux-musl artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-unknown-linux-musl - skip_unpack: true - - - name: Download aarch64-unknown-linux-musl artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-unknown-linux-musl - skip_unpack: true - - - name: Download x86_64-pc-windows-gnu artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-pc-windows-gnu - skip_unpack: true - - - name: Update files - run: | - # Copy files to local sdk-go repo path - cp --verbose -rf sdk/languages/go/. sdk-go - # Remove the old cinterface lib files - rm -rf sdk-go/internal/cinterface/lib/* - mkdir -p sdk-go/internal/cinterface/lib/{darwin-{x64,arm64},linux-{x64,arm64},windows-x64} - - - name: Extract static libs to their respective directories - run: | - unzip 'libbitwarden_c_files-x86_64-apple-darwin.zip' '*.a' -d sdk-go/internal/cinterface/lib/darwin-x64 - unzip 'libbitwarden_c_files-aarch64-apple-darwin.zip' '*.a' -d sdk-go/internal/cinterface/lib/darwin-arm64 - unzip 'libbitwarden_c_files-x86_64-unknown-linux-musl.zip' '*.a' -d sdk-go/internal/cinterface/lib/linux-x64 - unzip 'libbitwarden_c_files-aarch64-unknown-linux-musl.zip' '*.a' -d sdk-go/internal/cinterface/lib/linux-arm64 - unzip 'libbitwarden_c_files-x86_64-pc-windows-gnu.zip' '*.a' -d sdk-go/internal/cinterface/lib/windows-x64 - - - name: Download artifacts - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: generate_schemas.yml - path: sdk-go - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: schemas.go - - - name: Push changes - working-directory: sdk-go - run: | - git add . - git commit -m "Update Go SDK to ${{ github.sha }}" - - if [[ "${{ inputs.release_type }}" == "Dry Run" ]]; then - echo "===================================" - echo "[!] Dry Run - Skipping push" - echo "===================================" - git ls-files -m - exit 0 - else - git push origin main - fi - - - name: Create release tag on SDK Go repo - if: ${{ inputs.release_type != 'Dry Run' }} - working-directory: sdk-go - run: | - # Check if tag exists, set output then exit 0 if true. - if git log v${{ env._PKG_VERSION }} >/dev/null 2>&1; then - echo "===================================" - echo "[!] Tag v${{ env._PKG_VERSION }} already exists" - echo "===================================" - exit 1 - fi - - git tag v${{ env._PKG_VERSION }} - git push origin v${{ env._PKG_VERSION }} - - github-release: - name: GitHub Release - runs-on: ubuntu-22.04 - needs: - - repo-sync - - validate - env: - _PKG_VERSION: ${{ needs.validate.outputs.version }} - steps: - - name: Login to Azure - Prod Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: ${{ env._KEY_VAULT }} - secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - - name: Download x86_64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-apple-darwin - skip_unpack: true - - - name: Download aarch64-apple-darwin artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-apple-darwin - skip_unpack: true - - - name: Download x86_64-unknown-linux-musl artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-unknown-linux-musl - skip_unpack: true - - - name: Download aarch64-unknown-linux-musl artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-aarch64-unknown-linux-musl - skip_unpack: true - - - name: Download x86_64-pc-windows-gnu artifact - uses: bitwarden/gh-actions/download-artifacts@main - with: - workflow: build-rust-cross-platform.yml - workflow_conclusion: success - branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} - artifacts: libbitwarden_c_files-x86_64-pc-windows-gnu - skip_unpack: true - - - name: Rename build artifacts - run: | - artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-musl" "aarch64-unknown-linux-musl" "x86_64-pc-windows-gnu") - for value in "${artifacts[@]}" - do - unzip libbitwarden_c_files-$value.zip -d libbitwarden_c_files-$value - cd libbitwarden_c_files-$value - zip -Rj ../libbitwarden_c_files-$value-$_PKG_VERSION.zip 'libbitwarden_c.*' - cd .. - done - - ls ./libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION.zip -lRa - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - with: - tag: v${{ env._PKG_VERSION }} - name: v${{ env._PKG_VERSION }} - body: "" - token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - draft: true - repo: sdk-go - owner: bitwarden - artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-unknown-linux-musl-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-aarch64-unknown-linux-musl-${{ env._PKG_VERSION }}.zip, - libbitwarden_c_files-x86_64-pc-windows-gnu-${{ env._PKG_VERSION }}.zip" diff --git a/.github/workflows/release-java.yml b/.github/workflows/release-java.yml deleted file mode 100644 index 6898932d..00000000 --- a/.github/workflows/release-java.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Release Java SDK -run-name: Release Java SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Get version - id: version - run: | - VERSION=$(cat languages/java/build.gradle | grep -Eo 'version = "[0-9]+\.[0-9]+\.[0-9]+"' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - echo "version=$VERSION" >> $GITHUB_OUTPUT - - release: - name: Release - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - PKG_VERSION: ${{ needs.setup.outputs.version }} - with: - commit: ${{ github.sha }} - tag: java-v${{ env.PKG_VERSION }} - name: Java SDK v${{ env.PKG_VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 761515c7..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -name: Release @bitwarden/sdk-napi -run-name: Release @bitwarden/sdk-napi ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Initial Release" - type: choice - options: - - Initial Release - - Redeploy - - Dry Run - -defaults: - run: - shell: bash - working-directory: crates/bitwarden-napi - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Check Release Version - id: version - uses: bitwarden/gh-actions/release-version-check@main - with: - release-type: ${{ inputs.release_type }} - project-type: ts - file: crates/bitwarden-napi/package.json - monorepo: false - - release: - name: Create GitHub release - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Download artifacts - uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 - with: - workflow: build-napi.yml - workflow_conclusion: success - branch: main - name: sdk-bitwarden-napi-(.*)|schemas.ts - name_is_regexp: true - path: dist - - - name: Move artifact files to single directory - run: | - ls -alhR - shopt -s globstar - mv **/*.node . - mv schemas.ts/ schemas/ - mv schemas/schemas.ts . - working-directory: dist - - - name: Create release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - _VERSION: ${{ needs.setup.outputs.version }} - with: - commit: ${{ github.sha }} - tag: napi-v${{ env._VERSION }} - name: napi v${{ env._VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - artifacts: | - dist/sdk-napi.darwin-arm64.node - dist/sdk-napi.darwin-x64.node - dist/sdk-napi.win32-x64-msvc.node - dist/sdk-napi.linux-x64-gnu.node - dist/schemas.ts diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml deleted file mode 100644 index 5be1a12f..00000000 --- a/.github/workflows/release-python.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -name: Release Python SDK -run-name: Release Python SDK ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Get version - id: version - run: | - VERSION=$(cat languages/python/pyproject.toml | grep -Eo 'version = "[0-9]+\.[0-9]+\.[0-9]+"' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - echo "version=$VERSION" >> $GITHUB_OUTPUT - - release: - name: Release - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Download artifacts - uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 - with: - workflow: build-python-wheels.yml - path: ${{ github.workspace }}/target/wheels/dist - workflow_conclusion: success - branch: main - name: bitwarden_sdk(.*) - name_is_regexp: true - - - name: Move all whl files to single directory - run: | - shopt -s globstar - mv **/*.whl . - working-directory: ${{ github.workspace }}/target/wheels/dist - - - name: Create GitHub release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - PKG_VERSION: ${{ needs.setup.outputs.version }} - with: - commit: ${{ github.sha }} - tag: python-v${{ env.PKG_VERSION }} - name: Python v${{ env.PKG_VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - artifacts: | - ${{ github.workspace }}/target/wheels/dist/bitwarden_sdk-*.whl diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml deleted file mode 100644 index 97b2c34d..00000000 --- a/.github/workflows/release-wasm.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -name: Release @bitwarden/sdk-wasm -run-name: Release @bitwarden/sdk-wasm ${{ inputs.release_type }} - -on: - workflow_dispatch: - inputs: - release_type: - description: "Release Options" - required: true - default: "Release" - type: choice - options: - - Release - - Dry Run - -defaults: - run: - working-directory: languages/js/wasm - -jobs: - setup: - name: Setup - runs-on: ubuntu-22.04 - outputs: - release-version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi - - - name: Check Release Version - id: version - uses: bitwarden/gh-actions/release-version-check@main - with: - release-type: ${{ inputs.release_type }} - project-type: ts - file: languages/js/wasm/package.json - monorepo: false - - release: - name: Release - runs-on: ubuntu-22.04 - needs: setup - steps: - - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Download artifacts - uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 - with: - workflow: build-wasm.yml - skip_unpack: true - workflow_conclusion: success - branch: main - - - name: Create GitHub release - if: ${{ inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - env: - PKG_VERSION: ${{ needs.setup.outputs.release-version }} - with: - commit: ${{ github.sha }} - tag: wasm-v${{ env.PKG_VERSION }} - name: WASM v${{ env.PKG_VERSION }} - body: "" - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - artifacts: sdk-bitwarden-wasm.zip diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 5e7703e8..2ddb853c 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -46,7 +46,7 @@ jobs: - name: Test # Termporarily exclude NAPI due to a test error on windows - run: cargo test --workspace --exclude bitwarden-napi --all-features + run: cargo test --workspace --all-features coverage: name: Coverage diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 7053181e..960febd4 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -11,15 +11,6 @@ on: type: choice options: - bitwarden - - bws - - napi - - python-sdk - - ruby-sdk - - go-sdk - - dotnet-sdk - - php-sdk - - java-sdk - - cpp-sdk version_number: description: "New version (example: '2024.1.0')" required: true @@ -90,73 +81,11 @@ jobs: # VERSION BUMP SECTION # ######################## - ### napi - - name: Bump @bitwarden/sdk-napi Version - if: ${{ inputs.project == 'napi' }} - working-directory: "crates/bitwarden-napi" - run: | - npm ci - npm version ${{ inputs.version_number }} - - - name: Bump napi crate Version - if: ${{ inputs.project == 'napi' }} - run: cargo set-version -p bitwarden-napi ${{ inputs.version_number }} - ### bitwarden - name: Bump bitwarden crate Version if: ${{ inputs.project == 'bitwarden' }} run: cargo set-version -p bitwarden ${{ inputs.version_number }} - ### bws - - name: Bump bws Version - if: ${{ inputs.project == 'bws' }} - run: | - cargo set-version -p bws ${{ inputs.version_number }} - # bump the version in install.sh - sed -i 's/DEFAULT_BWS_VERSION="[0-9]\+\.[0-9]\+\.[0-9]\+"/DEFAULT_BWS_VERSION="${{ inputs.version_number }}"/' ./crates/bws/scripts/install.sh - # bump the version in install.ps1 - sed -i 's/\$defaultBwsVersion = "[0-9]\+\.[0-9]\+\.[0-9]\+"/\$defaultBwsVersion = "${{ inputs.version_number }}"/' ./crates/bws/scripts/install.ps1 - - ### python - - name: Bump python-sdk Version - if: ${{ inputs.project == 'python-sdk' }} - run: | - sed -i 's/version = "[0-9]\.[0-9]\.[0-9]"/version = "${{ inputs.version_number }}"/' ./languages/python/pyproject.toml - sed -i 's/__version__ = "[0-9]\.[0-9]\.[0-9]"/__version__ = "${{ inputs.version_number }}"/' ./languages/python/bitwarden_sdk/__init__.py - - ### ruby sdk - - name: Bump ruby-sdk Version - if: ${{ inputs.project == 'ruby-sdk' }} - run: sed -i "s/VERSION = '[0-9]\.[0-9]\.[0-9]'/VERSION = '${{ inputs.version_number }}'/" ./languages/ruby/bitwarden_sdk_secrets/lib/version.rb - - ### go sdk - - name: Bump go-sdk Version - if: ${{ inputs.project == 'go-sdk' }} - run: sed -i 's/[0-9]\.[0-9]\.[0-9]/${{ inputs.version_number }}/' ./languages/go/.version - - ### dotnet sdk - - name: Bump dotnet-sdk Version - if: ${{ inputs.project == 'dotnet-sdk' }} - run: sed -i 's/[0-9]\.[0-9]\.[0-9]<\/Version>/${{ inputs.version_number }}<\/Version>/' languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj - - ### php sdk - - name: Bump php-sdk Version - if: ${{ inputs.project == 'php-sdk' }} - run: | - sed -i 's/"version": "[0-9]\.[0-9]\.[0-9]"/"version": "${{ inputs.version_number }}"/' ./languages/php/composer.json - - ### java sdk - - name: Bump java-sdk Version - if: ${{ inputs.project == 'java-sdk' }} - run: | - sed -i 's/version = "[0-9]\.[0-9]\.[0-9]"/version = "${{ inputs.version_number }}"/' ./languages/java/build.gradle - - ### cpp sdk - - name: Bump C++ SDK Version - if: ${{ inputs.project == 'cpp-sdk' }} - run: | - sed -i 's/"version": "[0-9]\.[0-9]\.[0-9]"/"version": "${{ inputs.version_number }}"/' ./languages/cpp/vcpkg.json - ############################ # VERSION BUMP SECTION END # ############################ diff --git a/.gitignore b/.gitignore index 4a1d79fc..cea87ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -32,34 +32,13 @@ xcuserdata/ #/target node_modules/ -clients/python/env/ # Third party license THIRDPARTY.html -# Node.js addon binary file, for the current running operating system. -crates/bitwarden-napi/sdk-napi.*.node - -# Complied TypeScript client -crates/bitwarden-napi/dist -languages/js/sdk-client/dist/ - # Uniffi languages/swift/BitwardenFFI.xcframework languages/swift/tmp languages/swift/.build languages/swift/.swiftpm languages/kotlin/sdk/src/main/java/com/bitwarden/**/*.kt - -# Schemas -crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts -languages/cpp/include/schemas.hpp -languages/csharp/Bitwarden.Sdk/schemas.cs -languages/go/schema.go -languages/java/src/main/java/com/bitwarden/sdk/schema -languages/js/sdk-client/src/schemas.ts -languages/python/bitwarden_sdk/schemas.py -support/schemas - -# Cmake build files -languages/cpp/cmake-build-debug diff --git a/.prettierignore b/.prettierignore index 16243942..13f89e9c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,9 +5,7 @@ languages/js/* !languages/js/sdk-internal languages/js/sdk-internal/bitwarden_wasm_internal_bg.wasm.js schemas -/crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts about.hbs -support/docs/template.hbs # Test fixtures crates/bitwarden-exporters/resources/* diff --git a/.vscode/launch.json b/.vscode/launch.json index 7da474a2..3bbf9af5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,28 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "buildCsharp", - "program": "${workspaceFolder}/languages/csharp/Bitwarden.Sdk/bin/Debug/net6.0/BitwardenSdk.dll", - "args": [], - "env": { - "RUST_LOG": "debug" - }, - "cwd": "${workspaceFolder}", - "stopAtEntry": false, - "console": "internalConsole" - }, - { - "name": "Python: Current File", - "type": "python", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "preLaunchTask": "build python" - }, { "type": "lldb", "request": "launch", diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 71400c06..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "cargo", - "command": "build", - "problemMatcher": ["$rustc"], - "options": { - "cwd": "${workspaceFolder}/crates/bitwarden-c/" - }, - "group": { - "kind": "build", - "isDefault": true - }, - "label": "rust: bitwarden-c build" - }, - { - "type": "cargo", - "command": "build", - "args": ["--release"], - "options": { - "cwd": "${workspaceFolder}/crates/bitwarden-c/" - }, - "problemMatcher": ["$rustc"], - "label": "rust: bitwarden-c release build" - }, - { - "label": "buildCsharp", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile", - "dependsOrder": "sequence", - "dependsOn": ["rust: bitwarden-c build"] - }, - { - "label": "build python", - "command": "python3", - "type": "shell", - "args": ["setup.py", "develop"], - "options": { - "cwd": "${workspaceFolder}/languages/python" - } - }, - { - "label": "buildJava", - "type": "shell", - "command": "gradle", - "args": ["build"], - "dependsOrder": "sequence", - "dependsOn": ["rust: bitwarden-c build"], - "options": { - "cwd": "${workspaceFolder}/languages/java" - } - } - ] -} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 10edbfba..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -# Changelog - -The changelog for the crates are located in the individual crates. - -- [`bitwarden`](./crates/bitwarden/CHANGELOG.md) -- [`bws`](./crates/bws/CHANGELOG.md) diff --git a/Cargo.lock b/Cargo.lock index 024abbe0..a73f7c68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,12 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "aes" version = "0.8.4" @@ -82,15 +76,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "ansi_colours" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14eec43e0298190790f41679fe69ef7a829d2a2ddd78c8c00339e84710e435fe" -dependencies = [ - "rgb", -] - [[package]] name = "anstream" version = "0.6.15" @@ -146,12 +131,6 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "argon2" version = "0.5.3" @@ -262,7 +241,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -294,34 +273,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bat" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc9e5637c2330d8eb7b920f2aa5d9e184446c258466f825ea1412c7614cc86" -dependencies = [ - "ansi_colours", - "bincode", - "bytesize", - "clircle", - "console", - "content_inspector", - "encoding_rs", - "flate2", - "globset", - "home", - "nu-ansi-term", - "once_cell", - "path_abs", - "plist", - "semver", - "serde", - "serde_yaml", - "syntect", - "thiserror", - "unicode-width", -] - [[package]] name = "bincode" version = "1.3.3" @@ -358,17 +309,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bitwarden" -version = "1.0.0" -dependencies = [ - "bitwarden-core", - "bitwarden-generators", - "bitwarden-sm", - "thiserror", - "uuid", -] - [[package]] name = "bitwarden-api-api" version = "1.0.0" @@ -395,15 +335,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "bitwarden-c" -version = "0.1.0" -dependencies = [ - "bitwarden-json", - "env_logger", - "tokio", -] - [[package]] name = "bitwarden-cli" version = "1.0.0" @@ -541,40 +472,6 @@ dependencies = [ "wiremock", ] -[[package]] -name = "bitwarden-json" -version = "0.3.0" -dependencies = [ - "bitwarden", - "log", - "schemars", - "serde", - "serde_json", -] - -[[package]] -name = "bitwarden-napi" -version = "1.0.0" -dependencies = [ - "bitwarden-json", - "env_logger", - "log", - "napi", - "napi-build", - "napi-derive", -] - -[[package]] -name = "bitwarden-py" -version = "0.1.0" -dependencies = [ - "bitwarden-json", - "pyo3", - "pyo3-build-config", - "pyo3-log", - "tokio", -] - [[package]] name = "bitwarden-send" version = "1.0.0" @@ -660,28 +557,11 @@ dependencies = [ "uuid", ] -[[package]] -name = "bitwarden-wasm" -version = "0.1.0" -dependencies = [ - "argon2", - "bitwarden-json", - "chrono", - "console_error_panic_hook", - "console_log", - "js-sys", - "log", - "serde", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test", -] - [[package]] name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ - "bitwarden", + "bitwarden-core", "console_error_panic_hook", "console_log", "js-sys", @@ -718,16 +598,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bstr" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -752,42 +622,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "bws" -version = "1.0.0" -dependencies = [ - "bat", - "bitwarden", - "bitwarden-cli", - "chrono", - "clap", - "clap_complete", - "clap_mangen", - "color-eyre", - "comfy-table", - "directories", - "env_logger", - "itertools 0.13.0", - "log", - "regex", - "serde", - "serde_json", - "serde_yaml", - "supports-color", - "tempfile", - "thiserror", - "tokio", - "toml 0.8.19", - "uuid", - "which", -] - -[[package]] -name = "bytemuck" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" - [[package]] name = "byteorder" version = "1.5.0" @@ -800,12 +634,6 @@ version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" -[[package]] -name = "bytesize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" - [[package]] name = "camino" version = "1.1.9" @@ -949,15 +777,6 @@ dependencies = [ "strsim", ] -[[package]] -name = "clap_complete" -version = "4.5.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" -dependencies = [ - "clap", -] - [[package]] name = "clap_derive" version = "4.5.18" @@ -976,28 +795,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "clap_mangen" -version = "0.2.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbae9cbfdc5d4fa8711c09bd7b83f644cb48281ac35bf97af3e47b0675864bdf" -dependencies = [ - "clap", - "roff", -] - -[[package]] -name = "clircle" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e87cbed5354f17bd8ca8821a097fb62599787fe8f611743fad7ee156a0a600" -dependencies = [ - "cfg-if", - "libc", - "serde", - "winapi", -] - [[package]] name = "color-eyre" version = "0.6.3" @@ -1053,19 +850,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.52.0", -] - [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -1093,24 +877,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "content_inspector" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" -dependencies = [ - "memchr", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1146,15 +912,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "criterion" version = "0.5.1" @@ -1303,16 +1060,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn 2.0.79", -] - [[package]] name = "darling" version = "0.20.10" @@ -1449,27 +1196,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "dyn-clone" version = "1.0.17" @@ -1519,21 +1245,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_filter" version = "0.1.2" @@ -1610,16 +1321,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "flate2" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" -dependencies = [ - "crc32fast", - "miniz_oxide 0.8.0", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1787,19 +1488,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "globset" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] - [[package]] name = "goblin" version = "0.8.2" @@ -1917,15 +1605,6 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "http" version = "1.1.0" @@ -2102,12 +1781,6 @@ dependencies = [ "serde", ] -[[package]] -name = "indoc" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" - [[package]] name = "inout" version = "0.1.3" @@ -2248,16 +1921,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -2286,15 +1949,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-testing" version = "0.1.0" @@ -2323,16 +1977,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "minicov" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" -dependencies = [ - "cc", - "walkdir", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2348,15 +1992,6 @@ dependencies = [ "adler", ] -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - [[package]] name = "mio" version = "0.8.11" @@ -2381,64 +2016,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "napi" -version = "2.16.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53575dfa17f208dd1ce3a2da2da4659aae393b256a472f2738a8586a6c4107fd" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17435f7a00bfdab20b0c27d9c56f58f6499e418252253081bfff448099da31d1" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn 2.0.79", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "967c485e00f0bf3b1bdbe510a38a4606919cf1d34d9a37ad41f25a81aa077abe" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn 2.0.79", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - [[package]] name = "newline-converter" version = "0.3.0" @@ -2458,15 +2035,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nu-ansi-term" -version = "0.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c073d3c1930d0751774acf49e66653acecb416c3a54c6ec095a9b11caddb5a68" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2555,28 +2123,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "onig" -version = "6.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" -dependencies = [ - "bitflags 1.3.2", - "libc", - "once_cell", - "onig_sys", -] - -[[package]] -name = "onig_sys" -version = "69.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "oorandom" version = "11.1.4" @@ -2589,12 +2135,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "oslog" version = "0.2.0" @@ -2728,15 +2268,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "path_abs" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ef02f6342ac01d8a93b65f96db53fe68a92a15f41144f97fb00a9e669633c3" -dependencies = [ - "std_prelude", -] - [[package]] name = "pbkdf2" version = "0.12.2" @@ -2794,31 +2325,12 @@ dependencies = [ "spki", ] -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "plain" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -[[package]] -name = "plist" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" -dependencies = [ - "base64", - "indexmap 2.6.0", - "quick-xml", - "serde", - "time", -] - [[package]] name = "plotters" version = "0.3.7" @@ -2847,12 +2359,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -2915,89 +2421,6 @@ name = "public-suffix" version = "0.1.1" source = "git+https://github.com/bitwarden/passkey-rs?rev=ff757604cd7b4e8f321ed1616fef7e40e21ac5df#ff757604cd7b4e8f321ed1616fef7e40e21ac5df" -[[package]] -name = "pyo3" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" -dependencies = [ - "cfg-if", - "indoc", - "libc", - "memoffset", - "once_cell", - "portable-atomic", - "pyo3-build-config", - "pyo3-ffi", - "pyo3-macros", - "unindent", -] - -[[package]] -name = "pyo3-build-config" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" -dependencies = [ - "once_cell", - "target-lexicon", -] - -[[package]] -name = "pyo3-ffi" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" -dependencies = [ - "libc", - "pyo3-build-config", -] - -[[package]] -name = "pyo3-log" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac84e6eec1159bc2a575c9ae6723baa6ee9d45873e9bebad1e3ad7e8d28a443" -dependencies = [ - "arc-swap", - "log", - "pyo3", -] - -[[package]] -name = "pyo3-macros" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" -dependencies = [ - "proc-macro2", - "pyo3-macros-backend", - "quote", - "syn 2.0.79", -] - -[[package]] -name = "pyo3-macros-backend" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "pyo3-build-config", - "quote", - "syn 2.0.79", -] - -[[package]] -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", -] - [[package]] name = "quinn" version = "0.11.5" @@ -3114,17 +2537,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - [[package]] name = "regex" version = "1.11.0" @@ -3207,15 +2619,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "rgb" -version = "0.8.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" -dependencies = [ - "bytemuck", -] - [[package]] name = "ring" version = "0.17.8" @@ -3231,12 +2634,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "roff" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" - [[package]] name = "rsa" version = "0.9.6" @@ -3400,7 +2797,6 @@ checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "chrono", "dyn-clone", - "indexmap 1.9.3", "schemars_derive", "serde", "serde_json", @@ -3419,12 +2815,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -3451,19 +2841,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "sdk-schemas" -version = "0.1.0" -dependencies = [ - "anyhow", - "bitwarden", - "bitwarden-json", - "bitwarden-uniffi", - "itertools 0.13.0", - "schemars", - "serde_json", -] - [[package]] name = "sec1" version = "0.7.3" @@ -3589,15 +2966,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3640,19 +3008,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap 2.6.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "serdect" version = "0.2.0" @@ -3799,12 +3154,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "std_prelude" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe" - [[package]] name = "strsim" version = "0.11.1" @@ -3897,32 +3246,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "syntect" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" -dependencies = [ - "bincode", - "bitflags 1.3.2", - "flate2", - "fnv", - "once_cell", - "onig", - "regex-syntax", - "serde", - "serde_derive", - "serde_json", - "thiserror", - "walkdir", -] - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "tempfile" version = "3.13.0" @@ -4091,40 +3414,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" -dependencies = [ - "indexmap 2.6.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -4291,7 +3580,7 @@ dependencies = [ "paste", "serde", "textwrap", - "toml 0.5.11", + "toml", "uniffi_meta", "uniffi_udl", ] @@ -4347,7 +3636,7 @@ dependencies = [ "quote", "serde", "syn 2.0.79", - "toml 0.5.11", + "toml", "uniffi_meta", ] @@ -4389,18 +3678,6 @@ dependencies = [ "weedle2", ] -[[package]] -name = "unindent" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" - -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -4570,32 +3847,6 @@ version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" -[[package]] -name = "wasm-bindgen-test" -version = "0.3.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93d2a9ae98f1af8953f6415397299d808cce0a24f6d7c613d27bd83edf98da8" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "minicov", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8b294691f640bad8f2bb35a11bb28272701b1d687bd5fd661a27684e894d4d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "web-sys" version = "0.3.71" @@ -4624,18 +3875,6 @@ dependencies = [ "nom", ] -[[package]] -name = "which" -version = "6.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" -dependencies = [ - "either", - "home", - "rustix", - "winsafe", -] - [[package]] name = "winapi" version = "0.3.9" @@ -4854,21 +4093,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" -dependencies = [ - "memchr", -] - -[[package]] -name = "winsafe" -version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" - [[package]] name = "wiremock" version = "0.6.2" diff --git a/README.md b/README.md index 14ca1f66..b972a674 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# Bitwarden SDK +# Bitwarden Internal SDK -This repository houses the Bitwarden SDKs. We currently provide a public Secrets Manager SDK and an -internal SDK for the Bitwarden Password Manager which is used for the native mobile applications. -The SDK is written in Rust and provides a Rust API, CLI and various language bindings. +This repository houses the internal Bitwarden SDKs. We also provide a public +[Secrets Manager SDK](https://github.com/bitwarden/sdk-sm). ### Disclaimer @@ -58,27 +57,6 @@ are: server. - [`bitwarden-api-identity`](./crates/bitwarden-api-identity/): Auto-generated API bindings for the Identity server. -- [`bitwarden-c`](./crates/bitwarden-c/): C bindings for FFI interop. -- [`bitwarden-json`](./crates/bitwarden-json/): JSON wrapper around the `bitwarden` crate. Powers - the other language bindings. -- [`bitwarden-napi`](./crates/bitwarden-napi/): Node-API bindings. -- [`bws`](./crates/bws/): CLI for interacting with the [Bitwarden Secrets Manager][secrets-manager]. - Review the [CLI documentation][bws-help]. -- [`sdk-schemas`](./crates/sdk-schemas/): Generator for the _json schemas_. - -## Schemas - -To minimize the amount of work required to support additional bindings the project is structured -around a `json` based API. With every binding only needing to implement one method, namely -`run_command`. - -To ensure type safety in the API, _json schemas_ are generated from the rust structs in `bitwarden` -using [schemars](https://crates.io/crates/schemars). The _json schemas_ are later used to generate -the API bindings for each language using [QuickType](https://github.com/quicktype/quicktype). - -```bash -npm run schemas -``` ## API Bindings @@ -132,9 +110,6 @@ The list of developer tools is: `cargo install cargo-nextest --locked`. It can be manually run using `cargo nextest run --all-features` -[secrets-manager]: https://bitwarden.com/products/secrets-manager/ -[bws-help]: https://bitwarden.com/help/secrets-manager-cli/ - ## Cargo fmt We use certain unstable features for formatting which require the nightly version of cargo-fmt. diff --git a/crates/bitwarden-c/Cargo.toml b/crates/bitwarden-c/Cargo.toml deleted file mode 100644 index 9e09641f..00000000 --- a/crates/bitwarden-c/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "bitwarden-c" -version = "0.1.0" -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true - -[lib] -crate-type = ["staticlib", "cdylib"] -bench = false - -[target.'cfg(not(target_arch="wasm32"))'.dependencies] -tokio = { version = ">=1.28.2, <2.0", features = ["rt-multi-thread", "macros"] } -bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] } - -[dependencies] -env_logger = ">=0.10.0, <0.12" - -[lints] -workspace = true diff --git a/crates/bitwarden-c/src/c.rs b/crates/bitwarden-c/src/c.rs deleted file mode 100644 index 158c3802..00000000 --- a/crates/bitwarden-c/src/c.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::{ffi::CStr, os::raw::c_char, str}; - -use bitwarden_json::client::Client; - -use crate::{box_ptr, ffi_ref}; - -#[repr(C)] -pub struct CClient { - /// Associates the tokio runtime to the `Client`, ensuring the runtime has the same lifecycle - /// as the `Client`. - runtime: tokio::runtime::Runtime, - client: Client, -} - -#[no_mangle] -pub extern "C" fn run_command(c_str_ptr: *const c_char, client_ptr: *const CClient) -> *mut c_char { - let client = unsafe { ffi_ref!(client_ptr) }; - let input_str = str::from_utf8(unsafe { CStr::from_ptr(c_str_ptr) }.to_bytes()) - .expect("Input should be a valid string"); - - let result = client - .runtime - .block_on(client.client.run_command(input_str)); - - match std::ffi::CString::new(result) { - Ok(cstr) => cstr.into_raw(), - Err(_) => panic!("failed to return command result: null encountered"), - } -} - -// Init client, potential leak! You need to call free_mem after this! -#[no_mangle] -pub extern "C" fn init(c_str_ptr: *const c_char) -> *mut CClient { - // This will only fail if another logger was already initialized, so we can ignore the result - let _ = env_logger::try_init(); - - let runtime = tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .expect("Failed to build tokio runtime"); - - let client = if c_str_ptr.is_null() { - Client::new(None) - } else { - let input_string = str::from_utf8(unsafe { CStr::from_ptr(c_str_ptr) }.to_bytes()) - .expect("Input should be a valid string") - .to_owned(); - Client::new(Some(input_string)) - }; - - box_ptr!(CClient { runtime, client }) -} - -// Free mem -#[no_mangle] -pub extern "C" fn free_mem(client_ptr: *mut CClient) { - std::mem::drop(unsafe { Box::from_raw(client_ptr) }); -} diff --git a/crates/bitwarden-c/src/lib.rs b/crates/bitwarden-c/src/lib.rs deleted file mode 100644 index 2d6961b8..00000000 --- a/crates/bitwarden-c/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -// These are the C bindings, we're going to have to use unsafe raw pointers -#![allow(clippy::not_unsafe_ptr_arg_deref)] - -#[cfg(not(target_arch = "wasm32"))] -pub use c::*; - -#[cfg(not(target_arch = "wasm32"))] -mod c; -mod macros; diff --git a/crates/bitwarden-c/src/macros/ffi.rs b/crates/bitwarden-c/src/macros/ffi.rs deleted file mode 100644 index d7384cd4..00000000 --- a/crates/bitwarden-c/src/macros/ffi.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Get a reference to an object from a pointer -#[macro_export] -macro_rules! ffi_ref { - ($name:ident) => {{ - assert!(!$name.is_null()); - &*$name - }}; -} - -// Returns a raw pointer from an object -#[macro_export] -macro_rules! box_ptr { - ($x:expr) => { - Box::into_raw(Box::new($x)) - }; -} diff --git a/crates/bitwarden-c/src/macros/mod.rs b/crates/bitwarden-c/src/macros/mod.rs deleted file mode 100644 index 57ae9b9e..00000000 --- a/crates/bitwarden-c/src/macros/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod ffi; diff --git a/crates/bitwarden-json/Cargo.toml b/crates/bitwarden-json/Cargo.toml deleted file mode 100644 index b5b8052b..00000000 --- a/crates/bitwarden-json/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "bitwarden-json" -version = "0.3.0" -description = """ -JSON bindings for the Bitwarden Secret Manager SDK -""" -keywords = ["bitwarden", "secrets-manager"] -categories = ["api-bindings"] -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true - -[features] -secrets = ["bitwarden/secrets"] # Secrets manager API - -[dependencies] -bitwarden = { workspace = true } -log = ">=0.4.18, <0.5" -schemars = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } - -[lints] -workspace = true diff --git a/crates/bitwarden-json/src/client.rs b/crates/bitwarden-json/src/client.rs deleted file mode 100644 index 8da635a2..00000000 --- a/crates/bitwarden-json/src/client.rs +++ /dev/null @@ -1,102 +0,0 @@ -use bitwarden::ClientSettings; -#[cfg(feature = "secrets")] -use bitwarden::{ - generators::ClientGeneratorExt, - secrets_manager::{ClientProjectsExt, ClientSecretsExt}, -}; - -#[cfg(feature = "secrets")] -use crate::command::{GeneratorsCommand, ProjectsCommand, SecretsCommand}; -use crate::{ - command::Command, - response::{Response, ResponseIntoString}, -}; - -pub struct Client(bitwarden::Client); - -impl Client { - pub fn new(settings_input: Option) -> Self { - let settings = Self::parse_settings(settings_input); - Self(bitwarden::Client::new(settings)) - } - - pub async fn run_command(&self, input_str: &str) -> String { - const SUBCOMMANDS_TO_CLEAN: &[&str] = &["Secrets"]; - let mut cmd_value: serde_json::Value = match serde_json::from_str(input_str) { - Ok(cmd) => cmd, - Err(e) => { - return Response::error(format!("Invalid command string: {}", e)).into_string() - } - }; - - if let Some(cmd_value_map) = cmd_value.as_object_mut() { - cmd_value_map.retain(|_, v| !v.is_null()); - - for &subcommand in SUBCOMMANDS_TO_CLEAN { - if let Some(cmd_value_secrets) = cmd_value_map - .get_mut(subcommand) - .and_then(|v| v.as_object_mut()) - { - cmd_value_secrets.retain(|_, v| !v.is_null()); - } - } - } - - let cmd: Command = match serde_json::from_value(cmd_value) { - Ok(cmd) => cmd, - Err(e) => { - return Response::error(format!("Invalid command value: {}", e)).into_string() - } - }; - - let client = &self.0; - - match cmd { - #[cfg(feature = "secrets")] - Command::LoginAccessToken(req) => { - client.auth().login_access_token(&req).await.into_string() - } - - #[cfg(feature = "secrets")] - Command::Secrets(cmd) => match cmd { - SecretsCommand::Get(req) => client.secrets().get(&req).await.into_string(), - SecretsCommand::GetByIds(req) => { - client.secrets().get_by_ids(req).await.into_string() - } - SecretsCommand::Create(req) => client.secrets().create(&req).await.into_string(), - SecretsCommand::List(req) => client.secrets().list(&req).await.into_string(), - SecretsCommand::Update(req) => client.secrets().update(&req).await.into_string(), - SecretsCommand::Delete(req) => client.secrets().delete(req).await.into_string(), - SecretsCommand::Sync(req) => client.secrets().sync(&req).await.into_string(), - }, - - #[cfg(feature = "secrets")] - Command::Projects(cmd) => match cmd { - ProjectsCommand::Get(req) => client.projects().get(&req).await.into_string(), - ProjectsCommand::Create(req) => client.projects().create(&req).await.into_string(), - ProjectsCommand::List(req) => client.projects().list(&req).await.into_string(), - ProjectsCommand::Update(req) => client.projects().update(&req).await.into_string(), - ProjectsCommand::Delete(req) => client.projects().delete(req).await.into_string(), - }, - - #[cfg(feature = "secrets")] - Command::Generators(cmd) => match cmd { - GeneratorsCommand::GeneratePassword(req) => { - client.generator().password(req).into_string() - } - }, - } - } - - fn parse_settings(settings_input: Option) -> Option { - if let Some(input) = settings_input.as_ref() { - match serde_json::from_str(input) { - Ok(settings) => return Some(settings), - Err(e) => { - log::error!("Failed to parse settings: {}", e); - } - } - } - None - } -} diff --git a/crates/bitwarden-json/src/command.rs b/crates/bitwarden-json/src/command.rs deleted file mode 100644 index faaa8177..00000000 --- a/crates/bitwarden-json/src/command.rs +++ /dev/null @@ -1,144 +0,0 @@ -#[cfg(feature = "secrets")] -use bitwarden::{ - auth::login::AccessTokenLoginRequest, - generators::PasswordGeneratorRequest, - secrets_manager::{ - projects::{ - ProjectCreateRequest, ProjectGetRequest, ProjectPutRequest, ProjectsDeleteRequest, - ProjectsListRequest, - }, - secrets::{ - SecretCreateRequest, SecretGetRequest, SecretIdentifiersRequest, SecretPutRequest, - SecretsDeleteRequest, SecretsGetRequest, SecretsSyncRequest, - }, - }, -}; -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, JsonSchema, Debug)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub enum Command { - #[cfg(feature = "secrets")] - /// Login with Secrets Manager Access Token - /// - /// This command is for initiating an authentication handshake with Bitwarden. - /// - /// Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse) - LoginAccessToken(AccessTokenLoginRequest), - - #[cfg(feature = "secrets")] - Secrets(SecretsCommand), - #[cfg(feature = "secrets")] - Projects(ProjectsCommand), - #[cfg(feature = "secrets")] - Generators(GeneratorsCommand), -} - -#[cfg(feature = "secrets")] -#[derive(Serialize, Deserialize, JsonSchema, Debug)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub enum SecretsCommand { - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Retrieve a secret by the provided identifier - /// - /// Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) - Get(SecretGetRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Retrieve secrets by the provided identifiers - /// - /// Returns: [SecretsResponse](bitwarden::secrets_manager::secrets::SecretsResponse) - GetByIds(SecretsGetRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Creates a new secret in the provided organization using the given data - /// - /// Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) - Create(SecretCreateRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Lists all secret identifiers of the given organization, to then retrieve each secret, use - /// `CreateSecret` - /// - /// Returns: [SecretIdentifiersResponse](bitwarden::secrets_manager::secrets::SecretIdentifiersResponse) - List(SecretIdentifiersRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Updates an existing secret with the provided ID using the given data - /// - /// Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) - Update(SecretPutRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Deletes all the secrets whose IDs match the provided ones - /// - /// Returns: [SecretsDeleteResponse](bitwarden::secrets_manager::secrets::SecretsDeleteResponse) - Delete(SecretsDeleteRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login - /// Retrieve the secrets accessible by the authenticated machine account - /// Optionally, provide the last synced date to assess whether any changes have occurred - /// If changes are detected, retrieves all the secrets accessible by the authenticated machine - /// account - /// - /// Returns: [SecretsSyncResponse](bitwarden::secrets_manager::secrets::SecretsSyncResponse) - Sync(SecretsSyncRequest), -} - -#[cfg(feature = "secrets")] -#[derive(Serialize, Deserialize, JsonSchema, Debug)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub enum ProjectsCommand { - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Retrieve a project by the provided identifier - /// - /// Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) - Get(ProjectGetRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Creates a new project in the provided organization using the given data - /// - /// Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) - Create(ProjectCreateRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Lists all projects of the given organization - /// - /// Returns: [ProjectsResponse](bitwarden::secrets_manager::projects::ProjectsResponse) - List(ProjectsListRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Updates an existing project with the provided ID using the given data - /// - /// Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) - Update(ProjectPutRequest), - - /// > Requires Authentication - /// > Requires using an Access Token for login or calling Sync at least once - /// Deletes all the projects whose IDs match the provided ones - /// - /// Returns: [ProjectsDeleteResponse](bitwarden::secrets_manager::projects::ProjectsDeleteResponse) - Delete(ProjectsDeleteRequest), -} - -#[cfg(feature = "secrets")] -#[derive(Serialize, Deserialize, JsonSchema, Debug)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub enum GeneratorsCommand { - /// Generate a password - /// - /// Returns: [String] - GeneratePassword(PasswordGeneratorRequest), -} diff --git a/crates/bitwarden-json/src/lib.rs b/crates/bitwarden-json/src/lib.rs deleted file mode 100644 index 832fa316..00000000 --- a/crates/bitwarden-json/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod client; -pub mod command; -pub mod response; diff --git a/crates/bitwarden-json/src/response.rs b/crates/bitwarden-json/src/response.rs deleted file mode 100644 index b76d97aa..00000000 --- a/crates/bitwarden-json/src/response.rs +++ /dev/null @@ -1,64 +0,0 @@ -use std::error::Error; - -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Debug, JsonSchema)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct Response { - /// Whether or not the SDK request succeeded. - pub success: bool, - /// A message for any error that may occur. Populated if `success` is false. - pub error_message: Option, - /// The response data. Populated if `success` is true. - pub data: Option, -} - -impl Response { - pub fn new(response: Result) -> Self { - match response { - Ok(data) => Self { - success: true, - error_message: None, - data: Some(data), - }, - Err(err) => Self { - success: false, - error_message: Some(err.to_string()), - data: None, - }, - } - } -} - -impl Response<()> { - pub fn error(message: String) -> Self { - Self { - success: false, - error_message: Some(message), - data: None, - } - } -} - -pub(crate) trait ResponseIntoString { - fn into_string(self) -> String; -} - -impl ResponseIntoString for Result { - fn into_string(self) -> String { - Response::new(self).into_string() - } -} - -impl ResponseIntoString for Response { - fn into_string(self) -> String { - match serde_json::to_string(&self) { - Ok(ser) => ser, - Err(e) => { - let error = Response::error(format!("Failed to serialize Response: {}", e)); - serde_json::to_string(&error).expect("Serialize should be infallible") - } - } - } -} diff --git a/crates/bitwarden-napi/.npmignore b/crates/bitwarden-napi/.npmignore deleted file mode 100644 index ec144db2..00000000 --- a/crates/bitwarden-napi/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -target -Cargo.lock -.cargo -.github -npm -.eslintrc -.prettierignore -rustfmt.toml -yarn.lock -*.node -.yarn -__test__ -renovate.json diff --git a/crates/bitwarden-napi/Cargo.toml b/crates/bitwarden-napi/Cargo.toml deleted file mode 100644 index 7a9deeb8..00000000 --- a/crates/bitwarden-napi/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "bitwarden-napi" -version = "1.0.0" -description = """ -N-API bindings for the Bitwarden Secrets Manager SDK -""" -keywords = ["bitwarden", "secrets-manager"] -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true - -[lib] -crate-type = ["cdylib", "rlib"] - -[dependencies] -bitwarden-json = { path = "../bitwarden-json", version = "0.3.0", features = [ - "secrets", -] } -env_logger = "0.11.1" -log = { workspace = true } -napi = { version = "2", features = ["async"] } -napi-derive = "2" - -[build-dependencies] -napi-build = "2.1.0" - -[lints] -workspace = true diff --git a/crates/bitwarden-napi/README.md b/crates/bitwarden-napi/README.md deleted file mode 100644 index 6fce8d06..00000000 --- a/crates/bitwarden-napi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Bitwarden Secrets Manager SDK - -Node-API bindings for interacting with the Bitwarden Secrets Manager. This is a beta release and -might be missing some functionality. - -## Getting started - -```ts -import { BitwardenClient, ClientSettings, DeviceType, LogLevel } from "@bitwarden/sdk-napi"; - -// Optional settings -const settings: ClientSettings = { - apiUrl: "https://api.bitwarden.com", - identityUrl: "https://identity.bitwarden.com", - userAgent: "Bitwarden SDK", - deviceType: DeviceType.SDK, -}; - -const accessToken = "-- REDACTED --"; -const stateFile = "some/path/to/state/file"; - -const client = new BitwardenClient(settings, LogLevel.Info); - -// Authenticating using a machine account access token -await client.auth().loginAccessToken(accessToken, stateFile); - -// List secrets -const secrets = await client.secrets().list(); - -// Get a specific secret -const secret = await client.secrets().get("secret-id"); -``` diff --git a/crates/bitwarden-napi/binding.d.ts b/crates/bitwarden-napi/binding.d.ts deleted file mode 100644 index 174d33d9..00000000 --- a/crates/bitwarden-napi/binding.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ - -/* auto-generated by NAPI-RS */ - -export const enum LogLevel { - Trace = 0, - Debug = 1, - Info = 2, - Warn = 3, - Error = 4, -} -export declare class BitwardenClient { - constructor(settingsInput?: string | undefined | null, logLevel?: LogLevel | undefined | null); - runCommand(commandInput: string): Promise; -} diff --git a/crates/bitwarden-napi/binding.js b/crates/bitwarden-napi/binding.js deleted file mode 100644 index 3da97e8f..00000000 --- a/crates/bitwarden-napi/binding.js +++ /dev/null @@ -1,290 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/* prettier-ignore */ - -/* auto-generated by NAPI-RS */ - -const { existsSync, readFileSync } = require('fs') -const { join } = require("path"); - -const { platform, arch } = process; - -let nativeBinding = null; -let localFileExisted = false; -let loadError = null; - -function isMusl() { - // For Node 10 - if (!process.report || typeof process.report.getReport !== "function") { - try { - const lddPath = require("child_process").execSync("which ldd").toString().trim(); - return readFileSync(lddPath, "utf8").includes("musl"); - } catch (e) { - return true; - } - } else { - const { glibcVersionRuntime } = process.report.getReport().header; - return !glibcVersionRuntime; - } -} - -switch (platform) { - case "android": - switch (arch) { - case "arm64": - localFileExisted = existsSync(join(__dirname, "sdk-napi.android-arm64.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.android-arm64.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-android-arm64"); - } - } catch (e) { - loadError = e; - } - break; - case "arm": - localFileExisted = existsSync(join(__dirname, "sdk-napi.android-arm-eabi.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.android-arm-eabi.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-android-arm-eabi"); - } - } catch (e) { - loadError = e; - } - break; - default: - throw new Error(`Unsupported architecture on Android ${arch}`); - } - break; - case "win32": - switch (arch) { - case "x64": - localFileExisted = existsSync(join(__dirname, "sdk-napi.win32-x64-msvc.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.win32-x64-msvc.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-win32-x64-msvc"); - } - } catch (e) { - loadError = e; - } - break; - case "ia32": - localFileExisted = existsSync(join(__dirname, "sdk-napi.win32-ia32-msvc.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.win32-ia32-msvc.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-win32-ia32-msvc"); - } - } catch (e) { - loadError = e; - } - break; - case "arm64": - localFileExisted = existsSync(join(__dirname, "sdk-napi.win32-arm64-msvc.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.win32-arm64-msvc.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-win32-arm64-msvc"); - } - } catch (e) { - loadError = e; - } - break; - default: - throw new Error(`Unsupported architecture on Windows: ${arch}`); - } - break; - case "darwin": - localFileExisted = existsSync(join(__dirname, "sdk-napi.darwin-universal.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.darwin-universal.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-darwin-universal"); - } - break; - } catch {} - switch (arch) { - case "x64": - localFileExisted = existsSync(join(__dirname, "sdk-napi.darwin-x64.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.darwin-x64.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-darwin-x64"); - } - } catch (e) { - loadError = e; - } - break; - case "arm64": - localFileExisted = existsSync(join(__dirname, "sdk-napi.darwin-arm64.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.darwin-arm64.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-darwin-arm64"); - } - } catch (e) { - loadError = e; - } - break; - default: - throw new Error(`Unsupported architecture on macOS: ${arch}`); - } - break; - case "freebsd": - if (arch !== "x64") { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`); - } - localFileExisted = existsSync(join(__dirname, "sdk-napi.freebsd-x64.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.freebsd-x64.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-freebsd-x64"); - } - } catch (e) { - loadError = e; - } - break; - case "linux": - switch (arch) { - case "x64": - if (isMusl()) { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-x64-musl.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-x64-musl.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-x64-musl"); - } - } catch (e) { - loadError = e; - } - } else { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-x64-gnu.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-x64-gnu.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-x64-gnu"); - } - } catch (e) { - loadError = e; - } - } - break; - case "arm64": - if (isMusl()) { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm64-musl.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-arm64-musl.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-arm64-musl"); - } - } catch (e) { - loadError = e; - } - } else { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm64-gnu.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-arm64-gnu.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-arm64-gnu"); - } - } catch (e) { - loadError = e; - } - } - break; - case "arm": - if (isMusl()) { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm-musleabihf.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-arm-musleabihf.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-arm-musleabihf"); - } - } catch (e) { - loadError = e; - } - } else { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm-gnueabihf.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-arm-gnueabihf.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-arm-gnueabihf"); - } - } catch (e) { - loadError = e; - } - } - break; - case "riscv64": - if (isMusl()) { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-riscv64-musl.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-riscv64-musl.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-riscv64-musl"); - } - } catch (e) { - loadError = e; - } - } else { - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-riscv64-gnu.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-riscv64-gnu.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-riscv64-gnu"); - } - } catch (e) { - loadError = e; - } - } - break; - case "s390x": - localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-s390x-gnu.node")); - try { - if (localFileExisted) { - nativeBinding = require("./sdk-napi.linux-s390x-gnu.node"); - } else { - nativeBinding = require("@bitwarden/sdk-napi-linux-s390x-gnu"); - } - } catch (e) { - loadError = e; - } - break; - default: - throw new Error(`Unsupported architecture on Linux: ${arch}`); - } - break; - default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`); -} - -if (!nativeBinding) { - if (loadError) { - throw loadError; - } - throw new Error(`Failed to load native binding`); -} - -const { LogLevel, BitwardenClient } = nativeBinding; - -module.exports.LogLevel = LogLevel; -module.exports.BitwardenClient = BitwardenClient; diff --git a/crates/bitwarden-napi/build.rs b/crates/bitwarden-napi/build.rs deleted file mode 100644 index 9fc23678..00000000 --- a/crates/bitwarden-napi/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate napi_build; - -fn main() { - napi_build::setup(); -} diff --git a/crates/bitwarden-napi/npm/darwin-arm64/LICENSE b/crates/bitwarden-napi/npm/darwin-arm64/LICENSE deleted file mode 100644 index e9d496ff..00000000 --- a/crates/bitwarden-napi/npm/darwin-arm64/LICENSE +++ /dev/null @@ -1,295 +0,0 @@ -BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT -Version 1, 17 March 2023 - -1. Introduction - -1.1 The Bitwarden Software Development Kit (referred to in the License Agreement -as the "SDK" and available for download at the following URL -https://github.com/bitwarden/sdk) is licensed to you subject to the terms of -this License Agreement. The License Agreement forms a legally binding contract -between you and the Company in relation to your use of the SDK. - -1.2 "Bitwarden" means the Bitwarden software made available by the Company, -available for download at the following URL, as updated from time to time. - -1.3 A "Compatible Application" means any software program or service that (i) -connects to and interoperates with a current version of the Bitwarden server -products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: -https://bitwarden.com/terms/#acceptable_use. - -1.4 "Company" means Bitwarden Inc., organized under the laws of the State of -Delaware. - -2. Accepting this License Agreement - -2.1 In order to access or use the SDK, you must first agree to the License -Agreement. You may not access or use the SDK if you do not accept the License -Agreement. - -2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to -the terms of the License Agreement. - -2.3 You may not access or use the SDK and may not accept the License Agreement -if you are a person barred from receiving the SDK under the laws of the United -States or other countries, including the country in which you are resident or -from which you access or use the SDK. - -2.4 If you are agreeing to be bound by the License Agreement on behalf of your -employer or any other entity, you represent and warrant that you have full legal -authority to bind your employer or such other entity to the License Agreement. -If you do not have the requisite authority, you may not accept the License -Agreement or you may not access or use the SDK on behalf of your employer or -other entity. - -3. SDK License from Bitwarden - -3.1 Subject to the terms of this License Agreement, Bitwarden grants you a -limited, worldwide, royalty-free, non-assignable, non-exclusive, and -non-sublicensable license to use the SDK solely (a) to develop, test, and -demonstrate a Compatible Application; (b) to develop, test, and run a Compatible -Application for personal use by your family; or (c) to to develop, test, and run -a Compatible Application for the internal business operations of your -organization in connection with a paid license for a Bitwarden server product, -provided that in no case above may the Compatible Application be offered, -licensed, or sold to a third party. - -3.2 You agree that Bitwarden or third parties own all legal right, title and -interest in and to the SDK, including any Intellectual Property Rights that -subsist in the SDK. "Intellectual Property Rights" means any and all rights -under patent law, copyright law, trade secret law, trademark law, and any and -all other proprietary rights. Bitwarden reserves all rights not expressly -granted to you. - -3.3 You may not use this SDK to develop applications for use with software other -than Bitwarden (including non-compatible implementations of Bitwarden) or to -develop another SDK. - -3.4 You may not use the SDK for any purpose not expressly permitted by the -License Agreement. Except for contributions to Bitwarden pursuant to the -Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by -applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK -or any part of the SDK. - -3.5 Use, reproduction, and distribution of a component of the SDK licensed under -an open source software license are governed solely by the terms of that open -source software license and not the License Agreement. - -3.6 You agree that the form and nature of the SDK that the Company provides may -change without prior notice to you and that future versions of the SDK may be -incompatible with applications developed on previous versions of the SDK. You -agree that the Company may stop (permanently or temporarily) providing the SDK -or any features within the SDK to you or to users generally at the Company’s -sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of the -Company’s trade names, trademarks, service marks, logos, domain names, or other -distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights -notices (including copyright and trademark notices) that may be affixed to or -contained within the SDK. - -4. Use of the SDK by You - -4.1 The Company agrees that it obtains no right, title, or interest from you (or -your licensors) under the License Agreement in or to any software applications -that you develop using the SDK, including any Intellectual Property Rights that -subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are -permitted by (a) the License Agreement and (b) any applicable law, regulation or -generally accepted practices or guidelines in the relevant jurisdictions -(including any laws regarding the export of data or software to and from the -United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for other users, -you will protect the privacy and legal rights of those users. If the users -provide you with user names, passwords, or other login information or personal -information, you must make the users aware that the information will be -available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or -sensitive information provided by users, it must do so securely. If the user -provides your application with Bitwarden Account information, your application -may only use that information to access the user's Bitwarden Account when, and -for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including -the development or distribution of an application, that interferes with, -disrupts, damages, or accesses in an unauthorized manner the servers, networks, -or other properties or services of any third party including, but not limited -to, the Company, or any mobile communications carrier or public cloud service. - -4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge -and agree that you shall retrieve data only with the user's explicit consent and -only when, and for the limited purposes for which, the user has given you -permission to do so. - -4.6 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any data, content, or resources -that you create, transmit or display through Bitwarden and/or applications for -Bitwarden, and for the consequences of your actions (including any loss or -damage which Bitwarden may suffer) by doing so. - -4.7 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any breach of your obligations -under the License Agreement, any applicable third party contract or Terms of -Service, or any applicable law or regulation, and for the consequences -(including any loss or damage which the Company or any third party may suffer) -of any such breach. - -5. Third Party Applications - -5.1 If you use the SDK to integrate or run applications developed by a third -party or that access data, content or resources provided by a third party, you -agree that the Company is not responsible for those applications, data, content, -or resources. You understand that all data, content or resources which you may -access through such third party applications are the sole responsibility of the -person from which they originated and that the Company is not liable for any -loss or damage that you may experience as a result of the use or access of any -of those third party applications, data, content, or resources. - -5.2 You should be aware that the data, content, and resources presented to you -through such a third party application may be protected by intellectual property -rights which are owned by the providers (or by other persons or companies on -their behalf). You acknowledge that your use of such third party applications, -data, content, or resources may be subject to separate terms between you and the -relevant third party. In that case, the License Agreement does not affect your -legal relationship with these third parties. - -6. Use of Bitwarden Server - -You acknowledge and agree that the Bitwarden server products to which any -Compatible Application must connect is protected by intellectual property rights -which are owned by the Company and your use of the Bitwarden server products is -subject to additional terms not set forth in this License Agreement. - -7. Terminating this License Agreement - -7.1 The License Agreement will continue to apply until terminated by either you -or the Company as set out below. - -7.2 If you want to terminate the License Agreement, you may do so by ceasing -your use of the SDK and any relevant developer credentials. - -7.3 The Company may at any time, terminate the License Agreement with you if: - -(a) you have breached any provision of the License Agreement; or - -(b) the Company is required to do so by law; or - -(c) a third party with whom the Company offered certain parts of the SDK to you -has terminated its relationship with the Company or ceased to offer certain -parts of the SDK to either the Company or to you; or - -(d) the Company decides to no longer provide the SDK or certain parts of the SDK -to users in the country in which you are resident or from which you use the -service, or the provision of the SDK or certain SDK services to you by the -Company is, in the Company’'s sole discretion, no longer commercially viable or -technically practicable. - -7.4 When the License Agreement comes to an end, all of the legal rights, -obligations and liabilities that you and the Company have benefited from, been -subject to (or which have accrued over time whilst the License Agreement has -been in force) or which are expressed to continue indefinitely, shall be -unaffected by this cessation, and the provisions of paragraph 12.8 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -8. NO SUPPORT - -The Company is not obligated under this License Agreement to provide you any -support services for the SDK. Any support provided is at the Company’s sole -discretion and provided on an "as is" basis and without warranty of any kind. - -9. DISCLAIMER OF WARRANTIES - -9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE -RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF -ANY KIND FROM Bitwarden. - -9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED -THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY -RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF -DATA THAT RESULTS FROM SUCH USE. - -9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY -KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED -WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NON-INFRINGEMENT. - -10. LIMITATION OF LIABILITY - -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND -AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF -LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, -STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS -OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF -OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -11. Indemnification - -To the maximum extent permitted by law, you agree to defend, indemnify and hold -harmless the Company, its affiliates and their respective directors, officers, -employees and agents from and against any and all claims, actions, suits or -proceedings, as well as any and all losses, liabilities, damages, costs and -expenses (including reasonable attorneys fees) arising out of or accruing from -(a) your use of the SDK, (b) any application you develop on the SDK that -infringes any copyright, trademark, trade secret, trade dress, patent or other -intellectual property right of any person or defames any person or violates -their rights of publicity or privacy, and (c) any non-compliance by you with the -License Agreement. - -12. General Legal Terms - -12.1 The Company may make changes to the License Agreement as it distributes new -versions of the SDK. When these changes are made, the Company will make a new -version of the License Agreement available on the website where the SDK is made -available. - -12.2 The License Agreement constitutes the whole legal agreement between you and -the Company and governs your use of the SDK (excluding any services or software -which the Company may provide to you under a separate written agreement), and -completely replaces any prior agreements between you and the Company in relation -to the SDK. - -12.3 You agree that if the Company does not exercise or enforce any legal right -or remedy which is contained in the License Agreement (or which the Company has -the benefit of under any applicable law), this will not be taken to be a formal -waiver of the Company's rights and that those rights or remedies will still be -available to the Company. - -12.4 If any court of law, having the jurisdiction to decide on this matter, -rules that any provision of the License Agreement is invalid, then that -provision will be removed from the License Agreement without affecting the rest -of the License Agreement. The remaining provisions of the License Agreement will -continue to be valid and enforceable. - -12.5 You acknowledge and agree that each member of the group of companies of -which the Company is the parent shall be third party beneficiaries to the -License Agreement and that such other companies shall be entitled to directly -enforce, and rely upon, any provision of the License Agreement that confers a -benefit on them or rights in favor of them. Other than this, no other person or -company shall be third party beneficiaries to the License Agreement. - -12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND -REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND -REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON -DESTINATIONS, END USERS, AND END USE. - -12.7 The rights granted in the License Agreement may not be assigned or -transferred by either you or the Company without the prior written approval of -the other party, provided that the Company may assign this License Agreement -upon notice to you in connection with an acquisition, merger, sale of assets, or -similar corporate change in control for the Company or the Intellectual Property -Rights in the SDK. - -12.8 The License Agreement, and any dispute relating to or arising out of this -License Agreement, shall be governed by the laws of the State of California -without regard to its conflict of laws provisions. You and the Company agree to -submit to the exclusive jurisdiction of the courts located within the county of -Los Angeles, California to resolve any dispute or legal matter arising from the -License Agreement. Notwithstanding this, you agree that the Company shall be -allowed to apply for injunctive remedies, or any equivalent type of urgent legal -relief, in any forum or jurisdiction. diff --git a/crates/bitwarden-napi/npm/darwin-arm64/README.md b/crates/bitwarden-napi/npm/darwin-arm64/README.md deleted file mode 100644 index 57bb349c..00000000 --- a/crates/bitwarden-napi/npm/darwin-arm64/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@bitwarden/sdk-napi-darwin-arm64` - -This is the **aarch64-apple-darwin** binary for `@bitwarden/sdk-napi` diff --git a/crates/bitwarden-napi/npm/darwin-arm64/package.json b/crates/bitwarden-napi/npm/darwin-arm64/package.json deleted file mode 100644 index 88e3122c..00000000 --- a/crates/bitwarden-napi/npm/darwin-arm64/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi-darwin-arm64", - "version": "1.0.0", - "homepage": "https://github.com/bitwarden/sdk#readme", - "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" - }, - "license": "SEE LICENSE IN LICENSE", - "author": "Bitwarden Inc. (https://bitwarden.com)", - "main": "sdk-napi.darwin-arm64.node", - "files": [ - "sdk-napi.darwin-arm64.node" - ], - "engines": { - "node": ">= 10" - }, - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ], - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - } -} diff --git a/crates/bitwarden-napi/npm/darwin-x64/LICENSE b/crates/bitwarden-napi/npm/darwin-x64/LICENSE deleted file mode 100644 index e9d496ff..00000000 --- a/crates/bitwarden-napi/npm/darwin-x64/LICENSE +++ /dev/null @@ -1,295 +0,0 @@ -BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT -Version 1, 17 March 2023 - -1. Introduction - -1.1 The Bitwarden Software Development Kit (referred to in the License Agreement -as the "SDK" and available for download at the following URL -https://github.com/bitwarden/sdk) is licensed to you subject to the terms of -this License Agreement. The License Agreement forms a legally binding contract -between you and the Company in relation to your use of the SDK. - -1.2 "Bitwarden" means the Bitwarden software made available by the Company, -available for download at the following URL, as updated from time to time. - -1.3 A "Compatible Application" means any software program or service that (i) -connects to and interoperates with a current version of the Bitwarden server -products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: -https://bitwarden.com/terms/#acceptable_use. - -1.4 "Company" means Bitwarden Inc., organized under the laws of the State of -Delaware. - -2. Accepting this License Agreement - -2.1 In order to access or use the SDK, you must first agree to the License -Agreement. You may not access or use the SDK if you do not accept the License -Agreement. - -2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to -the terms of the License Agreement. - -2.3 You may not access or use the SDK and may not accept the License Agreement -if you are a person barred from receiving the SDK under the laws of the United -States or other countries, including the country in which you are resident or -from which you access or use the SDK. - -2.4 If you are agreeing to be bound by the License Agreement on behalf of your -employer or any other entity, you represent and warrant that you have full legal -authority to bind your employer or such other entity to the License Agreement. -If you do not have the requisite authority, you may not accept the License -Agreement or you may not access or use the SDK on behalf of your employer or -other entity. - -3. SDK License from Bitwarden - -3.1 Subject to the terms of this License Agreement, Bitwarden grants you a -limited, worldwide, royalty-free, non-assignable, non-exclusive, and -non-sublicensable license to use the SDK solely (a) to develop, test, and -demonstrate a Compatible Application; (b) to develop, test, and run a Compatible -Application for personal use by your family; or (c) to to develop, test, and run -a Compatible Application for the internal business operations of your -organization in connection with a paid license for a Bitwarden server product, -provided that in no case above may the Compatible Application be offered, -licensed, or sold to a third party. - -3.2 You agree that Bitwarden or third parties own all legal right, title and -interest in and to the SDK, including any Intellectual Property Rights that -subsist in the SDK. "Intellectual Property Rights" means any and all rights -under patent law, copyright law, trade secret law, trademark law, and any and -all other proprietary rights. Bitwarden reserves all rights not expressly -granted to you. - -3.3 You may not use this SDK to develop applications for use with software other -than Bitwarden (including non-compatible implementations of Bitwarden) or to -develop another SDK. - -3.4 You may not use the SDK for any purpose not expressly permitted by the -License Agreement. Except for contributions to Bitwarden pursuant to the -Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by -applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK -or any part of the SDK. - -3.5 Use, reproduction, and distribution of a component of the SDK licensed under -an open source software license are governed solely by the terms of that open -source software license and not the License Agreement. - -3.6 You agree that the form and nature of the SDK that the Company provides may -change without prior notice to you and that future versions of the SDK may be -incompatible with applications developed on previous versions of the SDK. You -agree that the Company may stop (permanently or temporarily) providing the SDK -or any features within the SDK to you or to users generally at the Company’s -sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of the -Company’s trade names, trademarks, service marks, logos, domain names, or other -distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights -notices (including copyright and trademark notices) that may be affixed to or -contained within the SDK. - -4. Use of the SDK by You - -4.1 The Company agrees that it obtains no right, title, or interest from you (or -your licensors) under the License Agreement in or to any software applications -that you develop using the SDK, including any Intellectual Property Rights that -subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are -permitted by (a) the License Agreement and (b) any applicable law, regulation or -generally accepted practices or guidelines in the relevant jurisdictions -(including any laws regarding the export of data or software to and from the -United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for other users, -you will protect the privacy and legal rights of those users. If the users -provide you with user names, passwords, or other login information or personal -information, you must make the users aware that the information will be -available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or -sensitive information provided by users, it must do so securely. If the user -provides your application with Bitwarden Account information, your application -may only use that information to access the user's Bitwarden Account when, and -for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including -the development or distribution of an application, that interferes with, -disrupts, damages, or accesses in an unauthorized manner the servers, networks, -or other properties or services of any third party including, but not limited -to, the Company, or any mobile communications carrier or public cloud service. - -4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge -and agree that you shall retrieve data only with the user's explicit consent and -only when, and for the limited purposes for which, the user has given you -permission to do so. - -4.6 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any data, content, or resources -that you create, transmit or display through Bitwarden and/or applications for -Bitwarden, and for the consequences of your actions (including any loss or -damage which Bitwarden may suffer) by doing so. - -4.7 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any breach of your obligations -under the License Agreement, any applicable third party contract or Terms of -Service, or any applicable law or regulation, and for the consequences -(including any loss or damage which the Company or any third party may suffer) -of any such breach. - -5. Third Party Applications - -5.1 If you use the SDK to integrate or run applications developed by a third -party or that access data, content or resources provided by a third party, you -agree that the Company is not responsible for those applications, data, content, -or resources. You understand that all data, content or resources which you may -access through such third party applications are the sole responsibility of the -person from which they originated and that the Company is not liable for any -loss or damage that you may experience as a result of the use or access of any -of those third party applications, data, content, or resources. - -5.2 You should be aware that the data, content, and resources presented to you -through such a third party application may be protected by intellectual property -rights which are owned by the providers (or by other persons or companies on -their behalf). You acknowledge that your use of such third party applications, -data, content, or resources may be subject to separate terms between you and the -relevant third party. In that case, the License Agreement does not affect your -legal relationship with these third parties. - -6. Use of Bitwarden Server - -You acknowledge and agree that the Bitwarden server products to which any -Compatible Application must connect is protected by intellectual property rights -which are owned by the Company and your use of the Bitwarden server products is -subject to additional terms not set forth in this License Agreement. - -7. Terminating this License Agreement - -7.1 The License Agreement will continue to apply until terminated by either you -or the Company as set out below. - -7.2 If you want to terminate the License Agreement, you may do so by ceasing -your use of the SDK and any relevant developer credentials. - -7.3 The Company may at any time, terminate the License Agreement with you if: - -(a) you have breached any provision of the License Agreement; or - -(b) the Company is required to do so by law; or - -(c) a third party with whom the Company offered certain parts of the SDK to you -has terminated its relationship with the Company or ceased to offer certain -parts of the SDK to either the Company or to you; or - -(d) the Company decides to no longer provide the SDK or certain parts of the SDK -to users in the country in which you are resident or from which you use the -service, or the provision of the SDK or certain SDK services to you by the -Company is, in the Company’'s sole discretion, no longer commercially viable or -technically practicable. - -7.4 When the License Agreement comes to an end, all of the legal rights, -obligations and liabilities that you and the Company have benefited from, been -subject to (or which have accrued over time whilst the License Agreement has -been in force) or which are expressed to continue indefinitely, shall be -unaffected by this cessation, and the provisions of paragraph 12.8 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -8. NO SUPPORT - -The Company is not obligated under this License Agreement to provide you any -support services for the SDK. Any support provided is at the Company’s sole -discretion and provided on an "as is" basis and without warranty of any kind. - -9. DISCLAIMER OF WARRANTIES - -9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE -RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF -ANY KIND FROM Bitwarden. - -9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED -THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY -RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF -DATA THAT RESULTS FROM SUCH USE. - -9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY -KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED -WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NON-INFRINGEMENT. - -10. LIMITATION OF LIABILITY - -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND -AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF -LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, -STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS -OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF -OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -11. Indemnification - -To the maximum extent permitted by law, you agree to defend, indemnify and hold -harmless the Company, its affiliates and their respective directors, officers, -employees and agents from and against any and all claims, actions, suits or -proceedings, as well as any and all losses, liabilities, damages, costs and -expenses (including reasonable attorneys fees) arising out of or accruing from -(a) your use of the SDK, (b) any application you develop on the SDK that -infringes any copyright, trademark, trade secret, trade dress, patent or other -intellectual property right of any person or defames any person or violates -their rights of publicity or privacy, and (c) any non-compliance by you with the -License Agreement. - -12. General Legal Terms - -12.1 The Company may make changes to the License Agreement as it distributes new -versions of the SDK. When these changes are made, the Company will make a new -version of the License Agreement available on the website where the SDK is made -available. - -12.2 The License Agreement constitutes the whole legal agreement between you and -the Company and governs your use of the SDK (excluding any services or software -which the Company may provide to you under a separate written agreement), and -completely replaces any prior agreements between you and the Company in relation -to the SDK. - -12.3 You agree that if the Company does not exercise or enforce any legal right -or remedy which is contained in the License Agreement (or which the Company has -the benefit of under any applicable law), this will not be taken to be a formal -waiver of the Company's rights and that those rights or remedies will still be -available to the Company. - -12.4 If any court of law, having the jurisdiction to decide on this matter, -rules that any provision of the License Agreement is invalid, then that -provision will be removed from the License Agreement without affecting the rest -of the License Agreement. The remaining provisions of the License Agreement will -continue to be valid and enforceable. - -12.5 You acknowledge and agree that each member of the group of companies of -which the Company is the parent shall be third party beneficiaries to the -License Agreement and that such other companies shall be entitled to directly -enforce, and rely upon, any provision of the License Agreement that confers a -benefit on them or rights in favor of them. Other than this, no other person or -company shall be third party beneficiaries to the License Agreement. - -12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND -REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND -REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON -DESTINATIONS, END USERS, AND END USE. - -12.7 The rights granted in the License Agreement may not be assigned or -transferred by either you or the Company without the prior written approval of -the other party, provided that the Company may assign this License Agreement -upon notice to you in connection with an acquisition, merger, sale of assets, or -similar corporate change in control for the Company or the Intellectual Property -Rights in the SDK. - -12.8 The License Agreement, and any dispute relating to or arising out of this -License Agreement, shall be governed by the laws of the State of California -without regard to its conflict of laws provisions. You and the Company agree to -submit to the exclusive jurisdiction of the courts located within the county of -Los Angeles, California to resolve any dispute or legal matter arising from the -License Agreement. Notwithstanding this, you agree that the Company shall be -allowed to apply for injunctive remedies, or any equivalent type of urgent legal -relief, in any forum or jurisdiction. diff --git a/crates/bitwarden-napi/npm/darwin-x64/README.md b/crates/bitwarden-napi/npm/darwin-x64/README.md deleted file mode 100644 index 86843f8e..00000000 --- a/crates/bitwarden-napi/npm/darwin-x64/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@bitwarden/sdk-napi-darwin-x64` - -This is the **x86_64-apple-darwin** binary for `@bitwarden/sdk-napi` diff --git a/crates/bitwarden-napi/npm/darwin-x64/package.json b/crates/bitwarden-napi/npm/darwin-x64/package.json deleted file mode 100644 index 4650654c..00000000 --- a/crates/bitwarden-napi/npm/darwin-x64/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi-darwin-x64", - "version": "1.0.0", - "homepage": "https://github.com/bitwarden/sdk#readme", - "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" - }, - "license": "SEE LICENSE IN LICENSE", - "author": "Bitwarden Inc. (https://bitwarden.com)", - "main": "sdk-napi.darwin-x64.node", - "files": [ - "sdk-napi.darwin-x64.node" - ], - "engines": { - "node": ">= 10" - }, - "os": [ - "darwin" - ], - "cpu": [ - "x64" - ], - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - } -} diff --git a/crates/bitwarden-napi/npm/linux-x64-gnu/LICENSE b/crates/bitwarden-napi/npm/linux-x64-gnu/LICENSE deleted file mode 100644 index e9d496ff..00000000 --- a/crates/bitwarden-napi/npm/linux-x64-gnu/LICENSE +++ /dev/null @@ -1,295 +0,0 @@ -BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT -Version 1, 17 March 2023 - -1. Introduction - -1.1 The Bitwarden Software Development Kit (referred to in the License Agreement -as the "SDK" and available for download at the following URL -https://github.com/bitwarden/sdk) is licensed to you subject to the terms of -this License Agreement. The License Agreement forms a legally binding contract -between you and the Company in relation to your use of the SDK. - -1.2 "Bitwarden" means the Bitwarden software made available by the Company, -available for download at the following URL, as updated from time to time. - -1.3 A "Compatible Application" means any software program or service that (i) -connects to and interoperates with a current version of the Bitwarden server -products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: -https://bitwarden.com/terms/#acceptable_use. - -1.4 "Company" means Bitwarden Inc., organized under the laws of the State of -Delaware. - -2. Accepting this License Agreement - -2.1 In order to access or use the SDK, you must first agree to the License -Agreement. You may not access or use the SDK if you do not accept the License -Agreement. - -2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to -the terms of the License Agreement. - -2.3 You may not access or use the SDK and may not accept the License Agreement -if you are a person barred from receiving the SDK under the laws of the United -States or other countries, including the country in which you are resident or -from which you access or use the SDK. - -2.4 If you are agreeing to be bound by the License Agreement on behalf of your -employer or any other entity, you represent and warrant that you have full legal -authority to bind your employer or such other entity to the License Agreement. -If you do not have the requisite authority, you may not accept the License -Agreement or you may not access or use the SDK on behalf of your employer or -other entity. - -3. SDK License from Bitwarden - -3.1 Subject to the terms of this License Agreement, Bitwarden grants you a -limited, worldwide, royalty-free, non-assignable, non-exclusive, and -non-sublicensable license to use the SDK solely (a) to develop, test, and -demonstrate a Compatible Application; (b) to develop, test, and run a Compatible -Application for personal use by your family; or (c) to to develop, test, and run -a Compatible Application for the internal business operations of your -organization in connection with a paid license for a Bitwarden server product, -provided that in no case above may the Compatible Application be offered, -licensed, or sold to a third party. - -3.2 You agree that Bitwarden or third parties own all legal right, title and -interest in and to the SDK, including any Intellectual Property Rights that -subsist in the SDK. "Intellectual Property Rights" means any and all rights -under patent law, copyright law, trade secret law, trademark law, and any and -all other proprietary rights. Bitwarden reserves all rights not expressly -granted to you. - -3.3 You may not use this SDK to develop applications for use with software other -than Bitwarden (including non-compatible implementations of Bitwarden) or to -develop another SDK. - -3.4 You may not use the SDK for any purpose not expressly permitted by the -License Agreement. Except for contributions to Bitwarden pursuant to the -Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by -applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK -or any part of the SDK. - -3.5 Use, reproduction, and distribution of a component of the SDK licensed under -an open source software license are governed solely by the terms of that open -source software license and not the License Agreement. - -3.6 You agree that the form and nature of the SDK that the Company provides may -change without prior notice to you and that future versions of the SDK may be -incompatible with applications developed on previous versions of the SDK. You -agree that the Company may stop (permanently or temporarily) providing the SDK -or any features within the SDK to you or to users generally at the Company’s -sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of the -Company’s trade names, trademarks, service marks, logos, domain names, or other -distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights -notices (including copyright and trademark notices) that may be affixed to or -contained within the SDK. - -4. Use of the SDK by You - -4.1 The Company agrees that it obtains no right, title, or interest from you (or -your licensors) under the License Agreement in or to any software applications -that you develop using the SDK, including any Intellectual Property Rights that -subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are -permitted by (a) the License Agreement and (b) any applicable law, regulation or -generally accepted practices or guidelines in the relevant jurisdictions -(including any laws regarding the export of data or software to and from the -United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for other users, -you will protect the privacy and legal rights of those users. If the users -provide you with user names, passwords, or other login information or personal -information, you must make the users aware that the information will be -available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or -sensitive information provided by users, it must do so securely. If the user -provides your application with Bitwarden Account information, your application -may only use that information to access the user's Bitwarden Account when, and -for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including -the development or distribution of an application, that interferes with, -disrupts, damages, or accesses in an unauthorized manner the servers, networks, -or other properties or services of any third party including, but not limited -to, the Company, or any mobile communications carrier or public cloud service. - -4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge -and agree that you shall retrieve data only with the user's explicit consent and -only when, and for the limited purposes for which, the user has given you -permission to do so. - -4.6 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any data, content, or resources -that you create, transmit or display through Bitwarden and/or applications for -Bitwarden, and for the consequences of your actions (including any loss or -damage which Bitwarden may suffer) by doing so. - -4.7 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any breach of your obligations -under the License Agreement, any applicable third party contract or Terms of -Service, or any applicable law or regulation, and for the consequences -(including any loss or damage which the Company or any third party may suffer) -of any such breach. - -5. Third Party Applications - -5.1 If you use the SDK to integrate or run applications developed by a third -party or that access data, content or resources provided by a third party, you -agree that the Company is not responsible for those applications, data, content, -or resources. You understand that all data, content or resources which you may -access through such third party applications are the sole responsibility of the -person from which they originated and that the Company is not liable for any -loss or damage that you may experience as a result of the use or access of any -of those third party applications, data, content, or resources. - -5.2 You should be aware that the data, content, and resources presented to you -through such a third party application may be protected by intellectual property -rights which are owned by the providers (or by other persons or companies on -their behalf). You acknowledge that your use of such third party applications, -data, content, or resources may be subject to separate terms between you and the -relevant third party. In that case, the License Agreement does not affect your -legal relationship with these third parties. - -6. Use of Bitwarden Server - -You acknowledge and agree that the Bitwarden server products to which any -Compatible Application must connect is protected by intellectual property rights -which are owned by the Company and your use of the Bitwarden server products is -subject to additional terms not set forth in this License Agreement. - -7. Terminating this License Agreement - -7.1 The License Agreement will continue to apply until terminated by either you -or the Company as set out below. - -7.2 If you want to terminate the License Agreement, you may do so by ceasing -your use of the SDK and any relevant developer credentials. - -7.3 The Company may at any time, terminate the License Agreement with you if: - -(a) you have breached any provision of the License Agreement; or - -(b) the Company is required to do so by law; or - -(c) a third party with whom the Company offered certain parts of the SDK to you -has terminated its relationship with the Company or ceased to offer certain -parts of the SDK to either the Company or to you; or - -(d) the Company decides to no longer provide the SDK or certain parts of the SDK -to users in the country in which you are resident or from which you use the -service, or the provision of the SDK or certain SDK services to you by the -Company is, in the Company’'s sole discretion, no longer commercially viable or -technically practicable. - -7.4 When the License Agreement comes to an end, all of the legal rights, -obligations and liabilities that you and the Company have benefited from, been -subject to (or which have accrued over time whilst the License Agreement has -been in force) or which are expressed to continue indefinitely, shall be -unaffected by this cessation, and the provisions of paragraph 12.8 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -8. NO SUPPORT - -The Company is not obligated under this License Agreement to provide you any -support services for the SDK. Any support provided is at the Company’s sole -discretion and provided on an "as is" basis and without warranty of any kind. - -9. DISCLAIMER OF WARRANTIES - -9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE -RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF -ANY KIND FROM Bitwarden. - -9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED -THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY -RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF -DATA THAT RESULTS FROM SUCH USE. - -9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY -KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED -WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NON-INFRINGEMENT. - -10. LIMITATION OF LIABILITY - -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND -AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF -LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, -STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS -OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF -OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -11. Indemnification - -To the maximum extent permitted by law, you agree to defend, indemnify and hold -harmless the Company, its affiliates and their respective directors, officers, -employees and agents from and against any and all claims, actions, suits or -proceedings, as well as any and all losses, liabilities, damages, costs and -expenses (including reasonable attorneys fees) arising out of or accruing from -(a) your use of the SDK, (b) any application you develop on the SDK that -infringes any copyright, trademark, trade secret, trade dress, patent or other -intellectual property right of any person or defames any person or violates -their rights of publicity or privacy, and (c) any non-compliance by you with the -License Agreement. - -12. General Legal Terms - -12.1 The Company may make changes to the License Agreement as it distributes new -versions of the SDK. When these changes are made, the Company will make a new -version of the License Agreement available on the website where the SDK is made -available. - -12.2 The License Agreement constitutes the whole legal agreement between you and -the Company and governs your use of the SDK (excluding any services or software -which the Company may provide to you under a separate written agreement), and -completely replaces any prior agreements between you and the Company in relation -to the SDK. - -12.3 You agree that if the Company does not exercise or enforce any legal right -or remedy which is contained in the License Agreement (or which the Company has -the benefit of under any applicable law), this will not be taken to be a formal -waiver of the Company's rights and that those rights or remedies will still be -available to the Company. - -12.4 If any court of law, having the jurisdiction to decide on this matter, -rules that any provision of the License Agreement is invalid, then that -provision will be removed from the License Agreement without affecting the rest -of the License Agreement. The remaining provisions of the License Agreement will -continue to be valid and enforceable. - -12.5 You acknowledge and agree that each member of the group of companies of -which the Company is the parent shall be third party beneficiaries to the -License Agreement and that such other companies shall be entitled to directly -enforce, and rely upon, any provision of the License Agreement that confers a -benefit on them or rights in favor of them. Other than this, no other person or -company shall be third party beneficiaries to the License Agreement. - -12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND -REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND -REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON -DESTINATIONS, END USERS, AND END USE. - -12.7 The rights granted in the License Agreement may not be assigned or -transferred by either you or the Company without the prior written approval of -the other party, provided that the Company may assign this License Agreement -upon notice to you in connection with an acquisition, merger, sale of assets, or -similar corporate change in control for the Company or the Intellectual Property -Rights in the SDK. - -12.8 The License Agreement, and any dispute relating to or arising out of this -License Agreement, shall be governed by the laws of the State of California -without regard to its conflict of laws provisions. You and the Company agree to -submit to the exclusive jurisdiction of the courts located within the county of -Los Angeles, California to resolve any dispute or legal matter arising from the -License Agreement. Notwithstanding this, you agree that the Company shall be -allowed to apply for injunctive remedies, or any equivalent type of urgent legal -relief, in any forum or jurisdiction. diff --git a/crates/bitwarden-napi/npm/linux-x64-gnu/README.md b/crates/bitwarden-napi/npm/linux-x64-gnu/README.md deleted file mode 100644 index 2963e9bc..00000000 --- a/crates/bitwarden-napi/npm/linux-x64-gnu/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@bitwarden/sdk-napi-linux-x64-gnu` - -This is the **x86_64-unknown-linux-gnu** binary for `@bitwarden/sdk-napi` diff --git a/crates/bitwarden-napi/npm/linux-x64-gnu/package.json b/crates/bitwarden-napi/npm/linux-x64-gnu/package.json deleted file mode 100644 index ed3b62f8..00000000 --- a/crates/bitwarden-napi/npm/linux-x64-gnu/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi-linux-x64-gnu", - "version": "1.0.0", - "homepage": "https://github.com/bitwarden/sdk#readme", - "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" - }, - "license": "SEE LICENSE IN LICENSE", - "author": "Bitwarden Inc. (https://bitwarden.com)", - "main": "sdk-napi.linux-x64-gnu.node", - "files": [ - "sdk-napi.linux-x64-gnu.node" - ], - "engines": { - "node": ">= 10" - }, - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "libc": [ - "glibc" - ] -} diff --git a/crates/bitwarden-napi/npm/win32-x64-msvc/LICENSE b/crates/bitwarden-napi/npm/win32-x64-msvc/LICENSE deleted file mode 100644 index e9d496ff..00000000 --- a/crates/bitwarden-napi/npm/win32-x64-msvc/LICENSE +++ /dev/null @@ -1,295 +0,0 @@ -BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT -Version 1, 17 March 2023 - -1. Introduction - -1.1 The Bitwarden Software Development Kit (referred to in the License Agreement -as the "SDK" and available for download at the following URL -https://github.com/bitwarden/sdk) is licensed to you subject to the terms of -this License Agreement. The License Agreement forms a legally binding contract -between you and the Company in relation to your use of the SDK. - -1.2 "Bitwarden" means the Bitwarden software made available by the Company, -available for download at the following URL, as updated from time to time. - -1.3 A "Compatible Application" means any software program or service that (i) -connects to and interoperates with a current version of the Bitwarden server -products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: -https://bitwarden.com/terms/#acceptable_use. - -1.4 "Company" means Bitwarden Inc., organized under the laws of the State of -Delaware. - -2. Accepting this License Agreement - -2.1 In order to access or use the SDK, you must first agree to the License -Agreement. You may not access or use the SDK if you do not accept the License -Agreement. - -2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to -the terms of the License Agreement. - -2.3 You may not access or use the SDK and may not accept the License Agreement -if you are a person barred from receiving the SDK under the laws of the United -States or other countries, including the country in which you are resident or -from which you access or use the SDK. - -2.4 If you are agreeing to be bound by the License Agreement on behalf of your -employer or any other entity, you represent and warrant that you have full legal -authority to bind your employer or such other entity to the License Agreement. -If you do not have the requisite authority, you may not accept the License -Agreement or you may not access or use the SDK on behalf of your employer or -other entity. - -3. SDK License from Bitwarden - -3.1 Subject to the terms of this License Agreement, Bitwarden grants you a -limited, worldwide, royalty-free, non-assignable, non-exclusive, and -non-sublicensable license to use the SDK solely (a) to develop, test, and -demonstrate a Compatible Application; (b) to develop, test, and run a Compatible -Application for personal use by your family; or (c) to to develop, test, and run -a Compatible Application for the internal business operations of your -organization in connection with a paid license for a Bitwarden server product, -provided that in no case above may the Compatible Application be offered, -licensed, or sold to a third party. - -3.2 You agree that Bitwarden or third parties own all legal right, title and -interest in and to the SDK, including any Intellectual Property Rights that -subsist in the SDK. "Intellectual Property Rights" means any and all rights -under patent law, copyright law, trade secret law, trademark law, and any and -all other proprietary rights. Bitwarden reserves all rights not expressly -granted to you. - -3.3 You may not use this SDK to develop applications for use with software other -than Bitwarden (including non-compatible implementations of Bitwarden) or to -develop another SDK. - -3.4 You may not use the SDK for any purpose not expressly permitted by the -License Agreement. Except for contributions to Bitwarden pursuant to the -Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by -applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK -or any part of the SDK. - -3.5 Use, reproduction, and distribution of a component of the SDK licensed under -an open source software license are governed solely by the terms of that open -source software license and not the License Agreement. - -3.6 You agree that the form and nature of the SDK that the Company provides may -change without prior notice to you and that future versions of the SDK may be -incompatible with applications developed on previous versions of the SDK. You -agree that the Company may stop (permanently or temporarily) providing the SDK -or any features within the SDK to you or to users generally at the Company’s -sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of the -Company’s trade names, trademarks, service marks, logos, domain names, or other -distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights -notices (including copyright and trademark notices) that may be affixed to or -contained within the SDK. - -4. Use of the SDK by You - -4.1 The Company agrees that it obtains no right, title, or interest from you (or -your licensors) under the License Agreement in or to any software applications -that you develop using the SDK, including any Intellectual Property Rights that -subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are -permitted by (a) the License Agreement and (b) any applicable law, regulation or -generally accepted practices or guidelines in the relevant jurisdictions -(including any laws regarding the export of data or software to and from the -United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for other users, -you will protect the privacy and legal rights of those users. If the users -provide you with user names, passwords, or other login information or personal -information, you must make the users aware that the information will be -available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or -sensitive information provided by users, it must do so securely. If the user -provides your application with Bitwarden Account information, your application -may only use that information to access the user's Bitwarden Account when, and -for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including -the development or distribution of an application, that interferes with, -disrupts, damages, or accesses in an unauthorized manner the servers, networks, -or other properties or services of any third party including, but not limited -to, the Company, or any mobile communications carrier or public cloud service. - -4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge -and agree that you shall retrieve data only with the user's explicit consent and -only when, and for the limited purposes for which, the user has given you -permission to do so. - -4.6 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any data, content, or resources -that you create, transmit or display through Bitwarden and/or applications for -Bitwarden, and for the consequences of your actions (including any loss or -damage which Bitwarden may suffer) by doing so. - -4.7 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any breach of your obligations -under the License Agreement, any applicable third party contract or Terms of -Service, or any applicable law or regulation, and for the consequences -(including any loss or damage which the Company or any third party may suffer) -of any such breach. - -5. Third Party Applications - -5.1 If you use the SDK to integrate or run applications developed by a third -party or that access data, content or resources provided by a third party, you -agree that the Company is not responsible for those applications, data, content, -or resources. You understand that all data, content or resources which you may -access through such third party applications are the sole responsibility of the -person from which they originated and that the Company is not liable for any -loss or damage that you may experience as a result of the use or access of any -of those third party applications, data, content, or resources. - -5.2 You should be aware that the data, content, and resources presented to you -through such a third party application may be protected by intellectual property -rights which are owned by the providers (or by other persons or companies on -their behalf). You acknowledge that your use of such third party applications, -data, content, or resources may be subject to separate terms between you and the -relevant third party. In that case, the License Agreement does not affect your -legal relationship with these third parties. - -6. Use of Bitwarden Server - -You acknowledge and agree that the Bitwarden server products to which any -Compatible Application must connect is protected by intellectual property rights -which are owned by the Company and your use of the Bitwarden server products is -subject to additional terms not set forth in this License Agreement. - -7. Terminating this License Agreement - -7.1 The License Agreement will continue to apply until terminated by either you -or the Company as set out below. - -7.2 If you want to terminate the License Agreement, you may do so by ceasing -your use of the SDK and any relevant developer credentials. - -7.3 The Company may at any time, terminate the License Agreement with you if: - -(a) you have breached any provision of the License Agreement; or - -(b) the Company is required to do so by law; or - -(c) a third party with whom the Company offered certain parts of the SDK to you -has terminated its relationship with the Company or ceased to offer certain -parts of the SDK to either the Company or to you; or - -(d) the Company decides to no longer provide the SDK or certain parts of the SDK -to users in the country in which you are resident or from which you use the -service, or the provision of the SDK or certain SDK services to you by the -Company is, in the Company’'s sole discretion, no longer commercially viable or -technically practicable. - -7.4 When the License Agreement comes to an end, all of the legal rights, -obligations and liabilities that you and the Company have benefited from, been -subject to (or which have accrued over time whilst the License Agreement has -been in force) or which are expressed to continue indefinitely, shall be -unaffected by this cessation, and the provisions of paragraph 12.8 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -8. NO SUPPORT - -The Company is not obligated under this License Agreement to provide you any -support services for the SDK. Any support provided is at the Company’s sole -discretion and provided on an "as is" basis and without warranty of any kind. - -9. DISCLAIMER OF WARRANTIES - -9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE -RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF -ANY KIND FROM Bitwarden. - -9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED -THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY -RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF -DATA THAT RESULTS FROM SUCH USE. - -9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY -KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED -WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NON-INFRINGEMENT. - -10. LIMITATION OF LIABILITY - -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND -AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF -LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, -STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS -OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF -OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -11. Indemnification - -To the maximum extent permitted by law, you agree to defend, indemnify and hold -harmless the Company, its affiliates and their respective directors, officers, -employees and agents from and against any and all claims, actions, suits or -proceedings, as well as any and all losses, liabilities, damages, costs and -expenses (including reasonable attorneys fees) arising out of or accruing from -(a) your use of the SDK, (b) any application you develop on the SDK that -infringes any copyright, trademark, trade secret, trade dress, patent or other -intellectual property right of any person or defames any person or violates -their rights of publicity or privacy, and (c) any non-compliance by you with the -License Agreement. - -12. General Legal Terms - -12.1 The Company may make changes to the License Agreement as it distributes new -versions of the SDK. When these changes are made, the Company will make a new -version of the License Agreement available on the website where the SDK is made -available. - -12.2 The License Agreement constitutes the whole legal agreement between you and -the Company and governs your use of the SDK (excluding any services or software -which the Company may provide to you under a separate written agreement), and -completely replaces any prior agreements between you and the Company in relation -to the SDK. - -12.3 You agree that if the Company does not exercise or enforce any legal right -or remedy which is contained in the License Agreement (or which the Company has -the benefit of under any applicable law), this will not be taken to be a formal -waiver of the Company's rights and that those rights or remedies will still be -available to the Company. - -12.4 If any court of law, having the jurisdiction to decide on this matter, -rules that any provision of the License Agreement is invalid, then that -provision will be removed from the License Agreement without affecting the rest -of the License Agreement. The remaining provisions of the License Agreement will -continue to be valid and enforceable. - -12.5 You acknowledge and agree that each member of the group of companies of -which the Company is the parent shall be third party beneficiaries to the -License Agreement and that such other companies shall be entitled to directly -enforce, and rely upon, any provision of the License Agreement that confers a -benefit on them or rights in favor of them. Other than this, no other person or -company shall be third party beneficiaries to the License Agreement. - -12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND -REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND -REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON -DESTINATIONS, END USERS, AND END USE. - -12.7 The rights granted in the License Agreement may not be assigned or -transferred by either you or the Company without the prior written approval of -the other party, provided that the Company may assign this License Agreement -upon notice to you in connection with an acquisition, merger, sale of assets, or -similar corporate change in control for the Company or the Intellectual Property -Rights in the SDK. - -12.8 The License Agreement, and any dispute relating to or arising out of this -License Agreement, shall be governed by the laws of the State of California -without regard to its conflict of laws provisions. You and the Company agree to -submit to the exclusive jurisdiction of the courts located within the county of -Los Angeles, California to resolve any dispute or legal matter arising from the -License Agreement. Notwithstanding this, you agree that the Company shall be -allowed to apply for injunctive remedies, or any equivalent type of urgent legal -relief, in any forum or jurisdiction. diff --git a/crates/bitwarden-napi/npm/win32-x64-msvc/README.md b/crates/bitwarden-napi/npm/win32-x64-msvc/README.md deleted file mode 100644 index f4861676..00000000 --- a/crates/bitwarden-napi/npm/win32-x64-msvc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@bitwarden/sdk-napi-win32-x64-msvc` - -This is the **x86_64-pc-windows-msvc** binary for `@bitwarden/sdk-napi` diff --git a/crates/bitwarden-napi/npm/win32-x64-msvc/package.json b/crates/bitwarden-napi/npm/win32-x64-msvc/package.json deleted file mode 100644 index 5b2a9312..00000000 --- a/crates/bitwarden-napi/npm/win32-x64-msvc/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi-win32-x64-msvc", - "version": "1.0.0", - "homepage": "https://github.com/bitwarden/sdk#readme", - "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" - }, - "license": "SEE LICENSE IN LICENSE", - "author": "Bitwarden Inc. (https://bitwarden.com)", - "main": "sdk-napi.win32-x64-msvc.node", - "files": [ - "sdk-napi.win32-x64-msvc.node" - ], - "engines": { - "node": ">= 10" - }, - "os": [ - "win32" - ], - "cpu": [ - "x64" - ], - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - } -} diff --git a/crates/bitwarden-napi/package-lock.json b/crates/bitwarden-napi/package-lock.json deleted file mode 100644 index eaa8d347..00000000 --- a/crates/bitwarden-napi/package-lock.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@bitwarden/sdk-napi", - "version": "1.0.0", - "license": "SEE LICENSE IN LICENSE", - "devDependencies": { - "@napi-rs/cli": "2.18.4", - "typescript": "5.5.4" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/cli": { - "version": "2.18.4", - "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.18.4.tgz", - "integrity": "sha512-SgJeA4df9DE2iAEpr3M2H0OKl/yjtg1BnRI5/JyowS71tUWhrfSu2LT0V3vlHET+g1hBVlrO60PmEXwUEKp8Mg==", - "dev": true, - "license": "MIT", - "bin": { - "napi": "scripts/index.js" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - } - } -} diff --git a/crates/bitwarden-napi/package.json b/crates/bitwarden-napi/package.json deleted file mode 100644 index 31cee632..00000000 --- a/crates/bitwarden-napi/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@bitwarden/sdk-napi", - "version": "1.0.0", - "homepage": "https://github.com/bitwarden/sdk#readme", - "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" - }, - "license": "SEE LICENSE IN LICENSE", - "author": "Bitwarden Inc. (https://bitwarden.com)", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "binding.js", - "binding.d.ts", - "./dist/", - "./dist/bitwarden_client/" - ], - "scripts": { - "artifacts": "napi artifacts", - "build": "napi build --platform --release --js binding.js --dts binding.d.ts && tsc", - "build-arm64": "napi build --target aarch64-apple-darwin --platform --release --js binding.js --dts binding.d.ts && tsc", - "build:debug": "napi build --platform", - "prepublishOnly": "napi prepublish --skip-gh-release", - "tsc": "tsc", - "version": "napi version" - }, - "devDependencies": { - "@napi-rs/cli": "2.18.4", - "typescript": "5.5.4" - }, - "engines": { - "node": ">= 10" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "napi": { - "name": "sdk-napi", - "triples": { - "additional": [ - "aarch64-apple-darwin" - ] - } - } -} diff --git a/crates/bitwarden-napi/src-ts/bitwarden_client/index.ts b/crates/bitwarden-napi/src-ts/bitwarden_client/index.ts deleted file mode 100644 index 3a3765a1..00000000 --- a/crates/bitwarden-napi/src-ts/bitwarden_client/index.ts +++ /dev/null @@ -1,245 +0,0 @@ -import * as rust from "../../binding"; -import { LogLevel } from "../../binding"; -import { - Convert, - ClientSettings, - ProjectResponse, - ProjectsDeleteResponse, - ProjectsResponse, - SecretIdentifiersResponse, - SecretResponse, - SecretsDeleteResponse, - SecretsResponse, - SecretsSyncResponse, -} from "./schemas"; - -function handleResponse(response: { - success: boolean; - errorMessage?: string | null; - data?: T | null; -}): T { - if (!response.success) { - throw new Error(response.errorMessage || ""); - } - - if (response.data === null) { - throw new Error(response.errorMessage || "SDK response data is null"); - } - - return response.data as T; -} - -export class BitwardenClient { - client: rust.BitwardenClient; - - constructor(settings?: ClientSettings, loggingLevel?: LogLevel) { - const settingsJson = settings == null ? null : Convert.clientSettingsToJson(settings); - this.client = new rust.BitwardenClient(settingsJson, loggingLevel ?? LogLevel.Info); - } - - secrets(): SecretsClient { - return new SecretsClient(this.client); - } - - projects(): ProjectsClient { - return new ProjectsClient(this.client); - } - - auth(): AuthClient { - return new AuthClient(this.client); - } -} - -export class SecretsClient { - client: rust.BitwardenClient; - - constructor(client: rust.BitwardenClient) { - this.client = client; - } - - async get(id: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - get: { id }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async getByIds(ids: string[]): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - getByIds: { ids }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretsResponse(response)); - } - - async create( - organizationId: string, - key: string, - value: string, - note: string, - projectIds: string[], - ): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - create: { key, value, note, projectIds, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async list(organizationId: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - list: { organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretIdentifiersResponse(response)); - } - - async update( - organizationId: string, - id: string, - key: string, - value: string, - note: string, - projectIds: string[], - ): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - update: { id, key, value, note, projectIds, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async delete(ids: string[]): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - delete: { ids }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretsDeleteResponse(response)); - } - - async sync(organizationId: string, lastSyncedDate?: Date): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - secrets: { - sync: { organizationId, lastSyncedDate }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretsSyncResponse(response)); - } -} - -export class ProjectsClient { - client: rust.BitwardenClient; - - constructor(client: rust.BitwardenClient) { - this.client = client; - } - - async get(id: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - projects: { - get: { id }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async create(organizationId: string, name: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - projects: { - create: { name, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async list(organizationId: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - projects: { - list: { organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectsResponse(response)); - } - - async update(organizationId: string, id: string, name: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - projects: { - update: { id, name, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async delete(ids: string[]): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - projects: { - delete: { ids }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectsDeleteResponse(response)); - } -} - -export class AuthClient { - client: rust.BitwardenClient; - - constructor(client: rust.BitwardenClient) { - this.client = client; - } - - async loginAccessToken(accessToken: string, stateFile?: string): Promise { - const response = await this.client.runCommand( - Convert.commandToJson({ - loginAccessToken: { - accessToken, - stateFile, - }, - }), - ); - - handleResponse(Convert.toResponseForAccessTokenLoginResponse(response)); - } -} diff --git a/crates/bitwarden-napi/src-ts/index.ts b/crates/bitwarden-napi/src-ts/index.ts deleted file mode 100644 index 36b0649e..00000000 --- a/crates/bitwarden-napi/src-ts/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./bitwarden_client/index"; -export * from "./bitwarden_client/schemas"; -export { LogLevel } from "../binding"; diff --git a/crates/bitwarden-napi/src/client.rs b/crates/bitwarden-napi/src/client.rs deleted file mode 100644 index f41d5c35..00000000 --- a/crates/bitwarden-napi/src/client.rs +++ /dev/null @@ -1,44 +0,0 @@ -extern crate log; - -use bitwarden_json::client::Client as JsonClient; -use napi_derive::napi; - -#[napi] -pub enum LogLevel { - Trace, - Debug, - Info, - Warn, - Error, -} - -fn convert_level(level: LogLevel) -> log::LevelFilter { - match level { - LogLevel::Trace => log::LevelFilter::Trace, - LogLevel::Debug => log::LevelFilter::Debug, - LogLevel::Info => log::LevelFilter::Info, - LogLevel::Warn => log::LevelFilter::Warn, - LogLevel::Error => log::LevelFilter::Error, - } -} - -#[napi] -pub struct BitwardenClient(JsonClient); - -#[napi] -impl BitwardenClient { - #[napi(constructor)] - pub fn new(settings_input: Option, log_level: Option) -> Self { - // This will only fail if another logger was already initialized, so we can ignore the - // result - let _ = env_logger::Builder::from_default_env() - .filter_level(convert_level(log_level.unwrap_or(LogLevel::Info))) - .try_init(); - Self(bitwarden_json::client::Client::new(settings_input)) - } - - #[napi] - pub async fn run_command(&self, command_input: String) -> String { - self.0.run_command(&command_input).await - } -} diff --git a/crates/bitwarden-napi/src/lib.rs b/crates/bitwarden-napi/src/lib.rs deleted file mode 100644 index 37615d41..00000000 --- a/crates/bitwarden-napi/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(not(target_arch = "wasm32"))] -mod client; diff --git a/crates/bitwarden-napi/tsconfig.json b/crates/bitwarden-napi/tsconfig.json deleted file mode 100644 index f977e075..00000000 --- a/crates/bitwarden-napi/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "outDir": "./dist", - "rootDir": "./src-ts", - "strict": true, - "noImplicitAny": true, - "esModuleInterop": true, - "declaration": true - }, - "include": ["src-ts", "src-ts/bitwarden_client", "src-ts/index.ts"] -} diff --git a/crates/bitwarden-py/Cargo.toml b/crates/bitwarden-py/Cargo.toml deleted file mode 100644 index b637d5fa..00000000 --- a/crates/bitwarden-py/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "bitwarden-py" -version = "0.1.0" -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true -keywords.workspace = true - -[lib] -name = "bitwarden_py" -crate-type = ["cdylib"] - -[dependencies] -bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] } -pyo3 = { version = "0.22.1", features = ["extension-module"] } -pyo3-log = "0.11.0" - -[build-dependencies] -pyo3-build-config = { version = "0.22.1" } - -[target.'cfg(not(target_arch="wasm32"))'.dependencies] -tokio = { workspace = true, features = ["rt-multi-thread"] } - -[lints] -workspace = true diff --git a/crates/bitwarden-py/MANIFEST.in b/crates/bitwarden-py/MANIFEST.in deleted file mode 100644 index 7c68298b..00000000 --- a/crates/bitwarden-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include Cargo.toml -recursive-include src * diff --git a/crates/bitwarden-py/build.rs b/crates/bitwarden-py/build.rs deleted file mode 100644 index dace4a9b..00000000 --- a/crates/bitwarden-py/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - pyo3_build_config::add_extension_module_link_args(); -} diff --git a/crates/bitwarden-py/pyproject.toml b/crates/bitwarden-py/pyproject.toml deleted file mode 100644 index 31ffe048..00000000 --- a/crates/bitwarden-py/pyproject.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel", "setuptools-rust"] diff --git a/crates/bitwarden-py/src/client.rs b/crates/bitwarden-py/src/client.rs deleted file mode 100644 index 9c12a624..00000000 --- a/crates/bitwarden-py/src/client.rs +++ /dev/null @@ -1,28 +0,0 @@ -use bitwarden_json::client::Client as JsonClient; -use pyo3::prelude::*; - -#[pyclass] -pub struct BitwardenClient(tokio::runtime::Runtime, JsonClient); - -#[pymethods] -impl BitwardenClient { - #[new] - #[pyo3(signature = (settings_string=None))] - pub fn new(settings_string: Option) -> Self { - // This will only fail if another logger was already initialized, so we can ignore the - // result - let _ = pyo3_log::try_init(); - - let runtime = tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .expect("Failed to build tokio runtime"); - - Self(runtime, JsonClient::new(settings_string)) - } - - #[pyo3(text_signature = "($self, command_input)")] - fn run_command(&self, command_input: String) -> String { - self.0.block_on(self.1.run_command(&command_input)) - } -} diff --git a/crates/bitwarden-py/src/lib.rs b/crates/bitwarden-py/src/lib.rs deleted file mode 100644 index a6cc8dc4..00000000 --- a/crates/bitwarden-py/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[cfg(not(target_arch = "wasm32"))] -mod client; - -#[cfg(not(target_arch = "wasm32"))] -mod python_module; diff --git a/crates/bitwarden-py/src/python_module.rs b/crates/bitwarden-py/src/python_module.rs deleted file mode 100644 index 3e21b852..00000000 --- a/crates/bitwarden-py/src/python_module.rs +++ /dev/null @@ -1,9 +0,0 @@ -use pyo3::prelude::*; - -use crate::client::BitwardenClient; - -#[pymodule] -fn bitwarden_py(m: &Bound<'_, PyModule>) -> PyResult<()> { - m.add_class::()?; - Ok(()) -} diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index 4f68c08d..cd2c0484 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -15,7 +15,7 @@ keywords.workspace = true crate-type = ["cdylib"] [dependencies] -bitwarden = { workspace = true, features = ["wasm"] } +bitwarden-core = { workspace = true, features = ["wasm"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 994af1fc..8f2fa80d 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -1,7 +1,7 @@ extern crate console_error_panic_hook; use std::rc::Rc; -use bitwarden::{Client, ClientSettings}; +use bitwarden_core::{Client, ClientSettings}; use log::{set_max_level, Level}; use wasm_bindgen::prelude::*; diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml deleted file mode 100644 index fd3c278f..00000000 --- a/crates/bitwarden-wasm/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "bitwarden-wasm" -version = "0.1.0" -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true -keywords.workspace = true - -[lib] -crate-type = ["cdylib"] - -[dependencies] -argon2 = { version = ">=0.5.0, <0.6", features = [ - "alloc", - "zeroize", -], default-features = false } -bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] } -console_error_panic_hook = "0.1.7" -console_log = { version = "1.0.0", features = ["color"] } -js-sys = "0.3.68" -log = "0.4.20" -serde = { version = "1.0.196", features = ["derive"] } -wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } -wasm-bindgen-futures = "0.4.41" - -[dev-dependencies] -wasm-bindgen-test = "0.3.41" - -[target.'cfg(target_arch = "wasm32")'.dependencies] -chrono = { version = ">=0.4.26, <0.5", features = [ - "clock", - "serde", - "std", - "wasmbind", -], default-features = false } - -[lints] -workspace = true diff --git a/crates/bitwarden-wasm/README.md b/crates/bitwarden-wasm/README.md deleted file mode 100644 index 6fa8870f..00000000 --- a/crates/bitwarden-wasm/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Bitwarden-wasm - -Requirements: - -- `wasm32-unknown-unknown` rust target. -- `wasm-bindgen-cli` installed. -- `binaryen` installed for `wasm-opt` and `wasm2js`. - -```bash -rustup target add wasm32-unknown-unknown -cargo install -f wasm-bindgen-cli -brew install binaryen -``` - -#### Build - -```bash -# dev -./build.sh - -# release -./build.sh -r -``` diff --git a/crates/bitwarden-wasm/build.sh b/crates/bitwarden-wasm/build.sh deleted file mode 100755 index d49b12de..00000000 --- a/crates/bitwarden-wasm/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -# Move to the root of the repository -cd "$(dirname "$0")" -cd ../../ - -if [ "$1" != "-r" ]; then - # Dev - cargo build -p bitwarden-wasm --target wasm32-unknown-unknown - wasm-bindgen --target bundler --out-dir languages/js/wasm ./target/wasm32-unknown-unknown/debug/bitwarden_wasm.wasm - wasm-bindgen --target nodejs --out-dir languages/js/wasm/node ./target/wasm32-unknown-unknown/debug/bitwarden_wasm.wasm -else - # Release - cargo build -p bitwarden-wasm --target wasm32-unknown-unknown --release - wasm-bindgen --target bundler --out-dir languages/js/wasm ./target/wasm32-unknown-unknown/release/bitwarden_wasm.wasm - wasm-bindgen --target nodejs --out-dir languages/js/wasm/node ./target/wasm32-unknown-unknown/release/bitwarden_wasm.wasm -fi - -# Optimize size -wasm-opt -Os ./languages/js/wasm/bitwarden_wasm_bg.wasm -o ./languages/js/wasm/bitwarden_wasm_bg.wasm -wasm-opt -Os ./languages/js/wasm/node/bitwarden_wasm_bg.wasm -o ./languages/js/wasm/node/bitwarden_wasm_bg.wasm - -# Transpile to JS -wasm2js ./languages/js/wasm/bitwarden_wasm_bg.wasm -o ./languages/js/wasm/bitwarden_wasm_bg.wasm.js -npx terser ./languages/js/wasm/bitwarden_wasm_bg.wasm.js -o ./languages/js/wasm/bitwarden_wasm_bg.wasm.js diff --git a/crates/bitwarden-wasm/src/client.rs b/crates/bitwarden-wasm/src/client.rs deleted file mode 100644 index e130705c..00000000 --- a/crates/bitwarden-wasm/src/client.rs +++ /dev/null @@ -1,80 +0,0 @@ -extern crate console_error_panic_hook; -use std::rc::Rc; - -use argon2::{Algorithm, Argon2, Params, Version}; -use bitwarden_json::client::Client as JsonClient; -use js_sys::Promise; -use log::{set_max_level, Level}; -use wasm_bindgen::prelude::*; -use wasm_bindgen_futures::future_to_promise; - -#[wasm_bindgen] -pub enum LogLevel { - Trace, - Debug, - Info, - Warn, - Error, -} - -fn convert_level(level: LogLevel) -> Level { - match level { - LogLevel::Trace => Level::Trace, - LogLevel::Debug => Level::Debug, - LogLevel::Info => Level::Info, - LogLevel::Warn => Level::Warn, - LogLevel::Error => Level::Error, - } -} - -// Rc<...> is to avoid needing to take ownership of the Client during our async run_command -// function https://github.com/rustwasm/wasm-bindgen/issues/2195#issuecomment-799588401 -#[wasm_bindgen] -pub struct BitwardenClient(Rc); - -#[wasm_bindgen] -impl BitwardenClient { - #[wasm_bindgen(constructor)] - pub fn new(settings_input: Option, log_level: Option) -> Self { - console_error_panic_hook::set_once(); - let log_level = convert_level(log_level.unwrap_or(LogLevel::Info)); - if let Err(_e) = console_log::init_with_level(log_level) { - set_max_level(log_level.to_level_filter()) - } - - Self(Rc::new(bitwarden_json::client::Client::new(settings_input))) - } - - #[wasm_bindgen] - pub fn run_command(&self, js_input: String) -> Promise { - let rc = self.0.clone(); - future_to_promise(async move { - let result = rc.run_command(&js_input).await; - Ok(result.into()) - }) - } -} - -#[wasm_bindgen] -pub fn argon2( - password: &[u8], - salt: &[u8], - iterations: u32, - memory: u32, - parallelism: u32, -) -> Result, JsError> { - let argon = Argon2::new( - Algorithm::Argon2id, - Version::V0x13, - Params::new( - memory * 1024, // Convert MiB to KiB - iterations, - parallelism, - Some(32), - )?, - ); - - let mut hash = [0u8; 32]; - argon.hash_password_into(password, salt, &mut hash)?; - Ok(hash.to_vec()) -} diff --git a/crates/bitwarden-wasm/src/lib.rs b/crates/bitwarden-wasm/src/lib.rs deleted file mode 100644 index b79c47fc..00000000 --- a/crates/bitwarden-wasm/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -mod client; diff --git a/crates/bitwarden/CHANGELOG.md b/crates/bitwarden/CHANGELOG.md deleted file mode 100644 index 5d3eefa9..00000000 --- a/crates/bitwarden/CHANGELOG.md +++ /dev/null @@ -1,83 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project -adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -- Support for secrets sync (#678) -- Password generator (#986) - -### Changed - -- `ClientSettings` and `DeviceType` is now exported in the root module (#805) -- Secrets Manager now requires `bitwarden::secrets_manager::ClientSecretsExt` and - `bitwarden::secrets_manager::ClientProjectsExt` to be imported in order to access `secrets()` and - `projects` on the client (#798) -- Updated MSRV `1.75.0` (#980) - -### Removed - -- The deprecated `client.access_token_login()` is now removed. Please use - `client.auth().login_access_token()` instead. (#806) - -## [0.5.0] - 2024-04-26 - -### Changed - -- Switched TLS backend to `rustls`, removing the dependency on `OpenSSL`. (#374) -- `client::AccessToken` is now `auth::AccessToken`. (#656) - -### Fixed - -- Fix renew for service account access token logins (#702) - -## [0.4.0] - 2023-12-21 - -### Added - -- Support for basic state to avoid reauthenticating when creating a new `Client`. This is a breaking - change because of adding `state_file` to the `AccessTokenLoginRequest` struct. (#388) - -### Deprecated - -- `client.access_token_login()` is now deprecated and will be removed in a future release. Please - use `client.auth().login_access_token()` instead. (#319) - -## [0.3.1] - 2023-10-13 - -### Changed - -- `auth::request::AccessTokenLoginRequest` moved to `auth::login::AccessTokenLoginRequest` (#178) -- Support for fetching multiple secrets by ids (#150) - -## [0.3.0] - 2023-07-26 - -### Deprecated - -- The secrets manager SDK is now hidden behind a `secrets` feature flag. Make sure to enable this - flag in your `Cargo.toml` file. At the moment the flag is enabled by default for compatibility - reasons, but this is considered deprecated and the flag will be made opt-in eventually. - -### Added - -- Support for creating and editing secrets (#77) -- Support for creating and editing projects (#53) - -### Changed - -- Folder structure, update `use` declarations (#68) - -### Fixed - -- Improve login error handling (#109) - -## [0.2.1] - 2023-03-22 - -### Fixed - -- Add user agent to login requests (#11) diff --git a/crates/bitwarden/Cargo.toml b/crates/bitwarden/Cargo.toml deleted file mode 100644 index 3626f9d1..00000000 --- a/crates/bitwarden/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "bitwarden" -description = """ -Bitwarden Secrets Manager SDK -""" -keywords = ["bitwarden", "secrets-manager"] - -version.workspace = true -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true - -[features] -default = ["secrets"] - -no-memory-hardening = [ - "bitwarden-core/no-memory-hardening", -] # Disable memory hardening features -secrets = [ - "bitwarden-core/secrets", - "dep:bitwarden-sm", - "dep:bitwarden-generators", -] # Secrets manager API -wasm = ["bitwarden-core/wasm"] # WASM support - -[dependencies] -bitwarden-core = { workspace = true } -bitwarden-generators = { workspace = true, optional = true } -bitwarden-sm = { workspace = true, optional = true } -thiserror = { workspace = true } - -[dev-dependencies] -uuid = { workspace = true } - -[lints] -workspace = true diff --git a/crates/bitwarden/README.md b/crates/bitwarden/README.md deleted file mode 100644 index 010a6462..00000000 --- a/crates/bitwarden/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Bitwarden Secrets Manager SDK - -A Rust client SDK to interact with the -[Bitwarden Secrets Manager](https://bitwarden.com/products/secrets-manager/). This is a beta release -and might be missing some functionality. - -## Usage - -```toml -[dependencies] -bitwarden = { "*", features = ["secrets"] } -``` - -## Minimum Supported Rust Version - -Rust **1.75** or higher. - -## Example - -```rust -use bitwarden::{ - auth::login::AccessTokenLoginRequest, - error::Result, - secrets_manager::{secrets::SecretIdentifiersRequest, ClientSecretsExt}, - Client, ClientSettings, DeviceType, -}; -use uuid::Uuid; - -async fn test() -> Result<()> { - // Use the default values - let mut client = Client::new(None); - - // Or set your own values - let settings = ClientSettings { - identity_url: "https://identity.bitwarden.com".to_string(), - api_url: "https://api.bitwarden.com".to_string(), - user_agent: "Bitwarden Rust-SDK".to_string(), - device_type: DeviceType::SDK, - }; - let mut client = Client::new(Some(settings)); - - // Before we operate, we need to authenticate with a token - let token = AccessTokenLoginRequest { - access_token: String::from(""), - state_file: None, - }; - client.auth().login_access_token(&token).await.unwrap(); - - let org_id = SecretIdentifiersRequest { - organization_id: Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(), - }; - println!( - "Stored secrets: {:#?}", - client.secrets().list(&org_id).await.unwrap() - ); - Ok(()) -} -``` diff --git a/crates/bitwarden/src/error.rs b/crates/bitwarden/src/error.rs deleted file mode 100644 index 163ccc20..00000000 --- a/crates/bitwarden/src/error.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Errors that can occur when using this SDK - -use std::fmt::Debug; - -use thiserror::Error; - -#[derive(Debug, Error)] -pub enum Error { - #[error(transparent)] - Core(#[from] bitwarden_core::Error), -} - -// Ensure that the error messages implement Send and Sync -#[cfg(test)] -const _: () = { - fn assert_send() {} - fn assert_sync() {} - fn assert_all() { - assert_send::(); - assert_sync::(); - } -}; - -pub type Result = std::result::Result; diff --git a/crates/bitwarden/src/lib.rs b/crates/bitwarden/src/lib.rs deleted file mode 100644 index 77a063f5..00000000 --- a/crates/bitwarden/src/lib.rs +++ /dev/null @@ -1,72 +0,0 @@ -//! # Bitwarden -//! -//! A Rust client SDK to interact with the Bitwarden Secrets Manager. -//! This is a beta release and might be missing some functionality. -//! -//! To use this crate, add it to your `Cargo.toml`: -//! -//! ```ini -//! [dependencies] -//! bitwarden = { "*", features = ["secrets"] } -//! ``` -//! -//! # Basic setup -//! -//! All operations in this crate are done via a [Client]: -//! -//! ```rust -//! use bitwarden::{ -//! auth::login::AccessTokenLoginRequest, -//! error::Result, -//! secrets_manager::{secrets::SecretIdentifiersRequest, ClientSecretsExt}, -//! Client, ClientSettings, DeviceType, -//! }; -//! use uuid::Uuid; -//! -//! async fn test() -> Result<()> { -//! // Use the default values -//! let mut client = Client::new(None); -//! -//! // Or set your own values -//! let settings = ClientSettings { -//! identity_url: "https://identity.bitwarden.com".to_string(), -//! api_url: "https://api.bitwarden.com".to_string(), -//! user_agent: "Bitwarden Rust-SDK".to_string(), -//! device_type: DeviceType::SDK, -//! }; -//! let mut client = Client::new(Some(settings)); -//! -//! // Before we operate, we need to authenticate with a token -//! let token = AccessTokenLoginRequest { -//! access_token: String::from(""), -//! state_file: None, -//! }; -//! client.auth().login_access_token(&token).await.unwrap(); -//! -//! let org_id = SecretIdentifiersRequest { -//! organization_id: Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(), -//! }; -//! println!( -//! "Stored secrets: {:#?}", -//! client.secrets().list(&org_id).await.unwrap() -//! ); -//! Ok(()) -//! } -//! ``` - -// Ensure the readme docs compile -#[doc = include_str!("../README.md")] -mod readme {} - -pub use bitwarden_core::*; -pub mod error; - -#[cfg(feature = "secrets")] -pub mod generators { - pub use bitwarden_generators::{ClientGeneratorExt, PasswordError, PasswordGeneratorRequest}; -} - -#[cfg(feature = "secrets")] -pub mod secrets_manager { - pub use bitwarden_sm::*; -} diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md deleted file mode 100644 index 2690c14f..00000000 --- a/crates/bws/CHANGELOG.md +++ /dev/null @@ -1,78 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project -adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -- The ability to edit unassigned secrets with direct permissions. (#906) - -### Changed - -- Updated MSRV `1.75.0` (#980) - -### Removed - -- The deprecated `action type` commands are now removed. Please use `type action` instead. (#836) - -## [0.5.0] - 2024-04-26 - -### Added - -- Add a `BWS_CONFIG_FILE` environment variable to specify the location of the config file (#571) -- The `bws` CLI is now available as a Docker image (`docker run -it bitwarden/bws --help`) (#305) -- The `bws` CLI releases are now code signed on Windows and Mac (#534, #535) - -### Fixed - -- Re-add output options to the help menu after they were accidentally removed (#477) - -### Changed - -- Switched TLS backend to `rusttls`, removing the dependency on `OpenSSL` (#374) -- Updated MSRV for `bws` to `1.71.0` (#589) - -## [0.4.0] - 2023-12-21 - -### Added - -- Ability to output secrets in an `env` format with `bws` (#320) -- Basic state to avoid reauthenticating every run, used when setting the `state_file_dir` key in the - config (#388) - -## [0.3.1] - 2023-10-13 - -### Added - -- Support for shell autocompletion with the `bws completions` command (#103) -- When running `bws` with no args, the help text is now printed to `stderr` instead of `stdout` to - be consistent with `bws subcommand` behavior (#190) - -## [0.3.0] - 2023-07-26 - -### Deprecated - -- Switched command order from `action type` to `type action`, please re-read the help documentation - (#76) - -### Added - -- Ability to create and edit projects (#53) -- Ability to create and edit secrets (#77) -- Support `NO_COLOR` environment variable to disable CLI colors (#61) -- Support for `CLICOLOR_FORCE` (#74) - -### Fixed - -- Improve login error handling (#109) -- Respect users color choice for errors (#61) - -## [0.2.1] - 2023-03-22 - -### Fixed - -- Add user agent to login requests (#11) diff --git a/crates/bws/Cargo.toml b/crates/bws/Cargo.toml deleted file mode 100644 index 08e3941f..00000000 --- a/crates/bws/Cargo.toml +++ /dev/null @@ -1,60 +0,0 @@ -[package] -name = "bws" -version = "1.0.0" -description = """ -Bitwarden Secrets Manager CLI -""" -keywords = ["bitwarden", "secrets-manager", "cli"] -exclude = ["Dockerfile*", "entitlements.plist"] - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true - -[dependencies] -bat = { version = "0.24.0", features = [ - "regex-onig", -], default-features = false } -bitwarden = { workspace = true, features = ["secrets"] } -bitwarden-cli = { workspace = true } -chrono = { version = "0.4.38", features = [ - "clock", - "std", -], default-features = false } -clap = { version = "4.5.4", features = ["derive", "env", "string"] } -clap_complete = "4.5.2" -color-eyre = "0.6.3" -comfy-table = "7.1.1" -directories = "5.0.1" -env_logger = "0.11.1" -itertools = "0.13.0" -log = "0.4.20" -regex = { version = "1.10.3", features = [ - "std", - "perf", -], default-features = false } -serde = "1.0.196" -serde_json = "1.0.113" -serde_yaml = "0.9" -supports-color = "3.0.0" -thiserror = "1.0.57" -tokio = { workspace = true, features = ["rt-multi-thread"] } -toml = "0.8.10" -uuid = { version = "1.7.0", features = ["serde"] } -which = "6.0.1" - -[build-dependencies] -bitwarden-cli = { workspace = true } -clap = { version = "4.5.4", features = ["derive", "string"] } -clap_complete = "4.5.2" -clap_mangen = "0.2.20" -uuid = { version = "1.7.0" } - -[dev-dependencies] -tempfile = "3.10.0" - -[lints] -workspace = true diff --git a/crates/bws/Dockerfile b/crates/bws/Dockerfile deleted file mode 100644 index 07f9f3a7..00000000 --- a/crates/bws/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -############################################### -# Build stage # -############################################### -FROM --platform=$BUILDPLATFORM rust:1.81 AS build - -# Docker buildx supplies the value for this arg -ARG TARGETPLATFORM - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* - -# Copy required project files -COPY . /app - -# Build project -WORKDIR /app/crates/bws -RUN cargo build --release --bin bws - -# Bundle bws dependencies -RUN mkdir /lib-bws -RUN mkdir /lib64-bws - -RUN ldd /app/target/release/bws | tr -s '[:blank:]' '\n' | grep '^/lib' | xargs -I % cp % /lib-bws -RUN ldd /app/target/release/bws | tr -s '[:blank:]' '\n' | grep '^/lib64' | xargs -I % cp % /lib64-bws - -# Make a user and HOME directory for the app stage -RUN useradd -m app - -############################################### -# App stage # -############################################### -FROM scratch - -ARG TARGETPLATFORM -LABEL com.bitwarden.product="bitwarden" - -# Set a HOME directory and copy the user file -COPY --from=build /home/app /home/app -COPY --from=build /etc/passwd /etc/passwd -ENV HOME=/home/app -WORKDIR /home/app - -# Switch to the app user -USER app - -# Copy built project from the build stage -COPY --from=build /app/target/release/bws /bin/bws - -# Copy certs -COPY --from=build /etc/ssl/certs /etc/ssl/certs - -# Copy bws dependencies -COPY --from=build /lib-bws /lib -COPY --from=build /lib64-bws /lib64 - -ENTRYPOINT ["bws"] diff --git a/crates/bws/Dockerfile.dockerignore b/crates/bws/Dockerfile.dockerignore deleted file mode 100644 index 50f4b123..00000000 --- a/crates/bws/Dockerfile.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!crates/* -!Cargo.toml -!Cargo.lock diff --git a/crates/bws/README.md b/crates/bws/README.md deleted file mode 100644 index 524a168a..00000000 --- a/crates/bws/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# Bitwarden Secrets Manager CLI - -A Rust CLI for interacting with the -[Bitwarden Secrets Manager](https://bitwarden.com/products/secrets-manager/). This is a beta release -and might be missing some functionality. - -## Install - -We offer three ways to install bws: - -### Cargo (crates.io) - -Download bws via `cargo` from [crates.io](https://crates.io): - -```bash -cargo install bws --locked -``` - -### Install Script (from GitHub Releases) - -Linux/macOS: `curl https://bws.bitwarden.com/install | sh` - -Windows: `iwr https://bws.bitwarden.com/install | iex` - -An optional `-u/--uninstall` flag can be passed to the POSIX script to uninstall the CLI. The -PowerShell version accepts an equivalent `-Uninstall` flag. The uninstallation process will remove -the `bws` binary and the configuration directory (`~/.bws`). - -### GitHub Releases (Manual) - -Download a pre-built binary from the [Releases](https://github.com/bitwarden/sdk/releases) page. - -## Usage - -```bash -bws --help -``` - -## How to enable shell autocompletions - -### Zsh - -If completion is not enabled already, you need to enable it first: - -```zsh -echo "autoload -U compinit; compinit" >> ~/.zshrc -``` - -Enable autocompletions for the current user: - -```zsh -echo 'source <(/path/to/bws completions zsh)' >> ~/.zshrc -``` - -### Bash - -Enable autocompletions for the current user: - -```zsh -echo 'source <(/path/to/bws completions bash)' >> ~/.bashrc -``` - -For more detailed documentation, please refer to the -[Secrets Manager CLI help article](https://bitwarden.com/help/secrets-manager-cli/). - -## Docker - -We also provide a docker image preloaded with the `bws` cli. - -```bash -# From the root of the repository -docker build -f crates/bws/Dockerfile -t bitwarden/bws . - -docker run --rm -it bitwarden/bws --help -``` - -To use a configuration file, utilize docker -[bind mounting](https://docs.docker.com/storage/bind-mounts/) to expose it to the container: - -```bash -docker run --rm -it -v "$HOME"/.bws:/home/app/.bws bitwarden/bws --help -``` - -## How to build manpages - -The manpages get built during compilation of the `bws` crate through the use of a build script. The -output path of this build script can be located as follows: - -``` -MANPAGES_DIR=$(cargo build -p bws --message-format json | jq -r --slurp '.[] | select (.reason == "build-script-executed") | select(.package_id|contains("crates/bws")) .out_dir') -``` - -After running the provided commands, the built manpages should be located in -`$MANPAGES_DIR/manpages` diff --git a/crates/bws/build.rs b/crates/bws/build.rs deleted file mode 100644 index be056237..00000000 --- a/crates/bws/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -include!("src/cli.rs"); - -fn main() -> Result<(), std::io::Error> { - use std::{env, fs, path::Path}; - - let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR exists"); - let path = Path::new(&out_dir).join("manpages"); - fs::create_dir_all(&path).expect("OUT_DIR is writable"); - - let cmd = ::command(); - clap_mangen::generate_to(cmd, &path)?; - - Ok(()) -} diff --git a/crates/bws/entitlements.plist b/crates/bws/entitlements.plist deleted file mode 100644 index aeaa1504..00000000 --- a/crates/bws/entitlements.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.cs.allow-unsigned-executable-memory - - - \ No newline at end of file diff --git a/crates/bws/scripts/install.ps1 b/crates/bws/scripts/install.ps1 deleted file mode 100755 index daa5cf9d..00000000 --- a/crates/bws/scripts/install.ps1 +++ /dev/null @@ -1,108 +0,0 @@ -param ( - [switch]$Uninstall -) - -$ErrorActionPreference = "Stop" - -$defaultBwsVersion = "1.0.0" -$bwsVersion = if ($env:bwsVersion) { $env:bwsVersion } else { $defaultBwsVersion } -$installDir = [Environment]::GetFolderPath([Environment+SpecialFolder]::LocalApplicationData) | Join-Path -ChildPath "Programs" | Join-Path -ChildPath "Bitwarden" - -# https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-processor#properties -$processorArch = (Get-CimInstance -ClassName Win32_Processor).Architecture -if ($processorArch -eq 9) { - $arch = "x86_64" -} elseif ($processorArch -eq 12) { - $arch = "aarch64" -} else { - throw "Unsupported architecture: $processorArch" -} - -function Test-BwsInstallation { - $existingBws = Get-Command bws -ErrorAction SilentlyContinue - if ($null -ne $existingBws) { - $userInput = Read-Host "bws is already installed at $($existingBws.Source). Do you want to overwrite it? (Y/N)" - if ($userInput -ne "Y") { - Write-Host "Installation cancelled by user." - exit - } - } -} - -function Invoke-BwsDownload { - Write-Host "Detected architecture: $arch" - - $bwsUrl = "https://github.com/bitwarden/sdk/releases/download/bws-v$bwsVersion/bws-$arch-pc-windows-msvc-$bwsVersion.zip" - Write-Host "Downloading bws from: $bwsUrl" - $outputPath = Join-Path $env:TEMP "bws.zip" - Invoke-WebRequest -Uri $bwsUrl -OutFile $outputPath - return $outputPath -} - -function Test-Checksum { - param($zipPath) - Write-Host "Validating checksum..." - - $checksumUrl = "https://github.com/bitwarden/sdk/releases/download/bws-v$bwsVersion/bws-sha256-checksums-$bwsVersion.txt" - $checksumFile = Join-Path $env:TEMP "bws-checksums.txt" - Invoke-WebRequest -Uri $checksumUrl -OutFile $checksumFile - - $expectedChecksum = (Get-Content $checksumFile | Where-Object { $_ -match "bws-$arch-pc-windows-msvc-$bwsVersion.zip" }).Split(" ")[0] - $actualChecksum = (Get-FileHash -Algorithm SHA256 -Path $zipPath).Hash - - if ($actualChecksum -ne $expectedChecksum) { - throw "Checksum validation failed. Expected: $expectedChecksum, Actual: $actualChecksum" - } else { - Write-Host "Checksum validation successful." - } -} - -function Install-Bws { - param($zipPath) - Write-Host "Installing bws..." - New-Item -ItemType Directory -Force -Path $installDir | Out-Null - Expand-Archive -Force $zipPath -DestinationPath $installDir - Write-Host "bws installed to $installDir" - setx PATH "$env:PATH;$installDir" - Write-Host "$installDir has been added to your PATH" - Write-Host "Please restart your shell to use bws" -} - -function Test-Bws { - Write-Host "Checking bws..." - $bwsPath = Join-Path $installDir "bws.exe" - if (Test-Path $bwsPath) { - Write-Host "bws is installed at $bwsPath" - } else { - throw "bws is not installed" - } -} - -function Remove-Bws { - Write-Host "Uninstalling bws..." - - if (Test-Path $installDir) { - Remove-Item -Path $installDir -Recurse -Force - Write-Host "bws uninstalled from $installDir" - } else { - Write-Host "bws installation directory not found at $installDir. Skipping removal." - } - - $configDir = "$env:USERPROFILE\.bws" - if (Test-Path $configDir -PathType Container) { - Remove-Item -Path $configDir -Recurse -Force - Write-Host "bws config directory removed from $configDir" - } else { - Write-Host "bws config directory not found at $configDir. Skipping removal." - } -} - -if ($Uninstall) { - Remove-Bws -} else { - Test-BwsInstallation - $zipPath = Invoke-BwsDownload - Test-Checksum -zipPath $zipPath - Install-Bws -zipPath $zipPath - Test-Bws -} diff --git a/crates/bws/scripts/install.sh b/crates/bws/scripts/install.sh deleted file mode 100755 index 6cd7fe01..00000000 --- a/crates/bws/scripts/install.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/sh - -################################################## -# An installer for the bws command line utility. # -################################################## - -DEFAULT_BWS_VERSION="1.0.0" -BWS_VERSION="${BWS_VERSION:-$DEFAULT_BWS_VERSION}" - -main() { - case "$1" in - -u | --uninstall) - uninstall_bws - ;; - *) - check_required - platform_detect - arch_detect - download_bws - validate_checksum - install_bws - ;; - esac -} - -error() { - echo "$1" >&2 - echo "Exiting..." >&2 - exit 1 -} - -check_required() { - if ! command -v curl >/dev/null && ! command -v wget >/dev/null; then - error "curl or wget is required to download bws." - fi - - if ! command -v unzip >/dev/null; then - error "unzip is required to install bws." - fi -} - -can_sudo() { - if command -v sudo >/dev/null; then - echo "Attempting to install bws with sudo. Please enter your password if prompted." - if sudo -v 2>/dev/null; then - echo "sudo is available and we have the necessary permissions." - echo "Installing bws to /usr/local/bin..." - return 0 - else - echo "sudo is available, but we failed to authenticate." - return 1 - fi - else - echo "sudo is not available." - return 1 - fi -} - -platform_detect() { - if [ "$(uname -s)" = "Linux" ]; then - PLATFORM="unknown-linux-gnu" - elif [ "$(uname -s)" = "Darwin" ]; then - PLATFORM="apple-darwin" - else - error "Unsupported platform: $(uname -s)" - fi -} - -arch_detect() { - if [ "$(uname -m)" = "x86_64" ]; then - ARCH="x86_64" - elif [ "$(uname -m)" = "aarch64" ]; then # Linux uname output - ARCH="aarch64" - elif [ "$(uname -m)" = "arm64" ]; then # Darwin uname output - ARCH="aarch64" - else - error "Unsupported architecture: $(uname -m)" - fi -} - -checksum() { - if command -v sha256sum >/dev/null; then - sha256sum "$1" - else - shasum -a 256 "$1" - fi -} - -downloader() { - if command -v curl >/dev/null; then - curl -L -o "$2" "$1" - else - wget -O "$2" "$1" - fi -} - -extract() { - unzip -o "$1" -d "$2" -} - -download_bws() { - bws_url="https://github.com/bitwarden/sdk/releases/download/bws-v${BWS_VERSION}/bws-${ARCH}-${PLATFORM}-${BWS_VERSION}.zip" - echo "Downloading bws from: $bws_url" - tmp_dir="$(mktemp -d)" - downloader "$bws_url" "$tmp_dir/bws.zip" -} - -validate_checksum() { - checksum_url="https://github.com/bitwarden/sdk/releases/download/bws-v${BWS_VERSION}/bws-sha256-checksums-${BWS_VERSION}.txt" - echo "Downloading checksum file from: $checksum_url" - checksum_file="$tmp_dir/bws-checksums.txt" - downloader "$checksum_url" "$checksum_file" - - expected_checksum="$(grep "bws-${ARCH}-${PLATFORM}-${BWS_VERSION}.zip" "$checksum_file" | awk '{print $1}')" - actual_checksum="$(checksum "$tmp_dir/bws.zip" | awk '{print $1}')" - - if [ "$actual_checksum" != "$expected_checksum" ]; then - error "Checksum validation failed. Expected: $expected_checksum, Actual: $actual_checksum" - else - echo "Checksum validation successful." - fi -} - -install_bws() { - echo "Installing bws..." - extract "$tmp_dir/bws.zip" "$tmp_dir" - chmod +x "$tmp_dir/bws" - - if can_sudo; then - sudo install -m 755 "$tmp_dir/bws" /usr/local/bin/bws - - if ! command -v bws >/dev/null; then - error "Installation failed. bws was not found in /usr/local/bin" - fi - - echo "bws installed to /usr/local/bin/bws" - else - echo "Installing to your \$HOME directory..." - user_bin_dir="${HOME}/.local/bin" - mkdir -p "${user_bin_dir}" - install -m 755 "$tmp_dir/bws" "${user_bin_dir}/bws" - - if ! command -v "${user_bin_dir}/bws" >/dev/null; then - error "Installation failed. bws was not found in ${user_bin_dir}" - fi - - echo "bws installed at ${user_bin_dir}/bws" - echo "Please add ${user_bin_dir} to your PATH by adding the following line to your ~/.profile or shell rc file:" - echo "export PATH=\"\$PATH:${user_bin_dir}\"" - fi - - rm -rf "$tmp_dir" -} - -uninstall_bws() { - if command -v bws >/dev/null; then - echo "Uninstalling bws..." - if can_sudo; then - sudo rm "$(command -v bws)" - else - rm "$(command -v bws)" - fi - - # Safely remove the configuration directory - if [ -n "$HOME" ]; then - echo "Removing bws configuration directory at ${HOME}/.bws" - echo "If you use another directory for your configuration, you may want to remove it manually." - rm -rf "${HOME}/.bws" - else - echo "HOME environment variable is not set. Cannot safely remove .bws directory." - fi - - echo "bws uninstalled successfully." - else - echo "bws is not installed." - fi - exit 0 -} - -main "$@" diff --git a/crates/bws/src/cli.rs b/crates/bws/src/cli.rs deleted file mode 100644 index 9c81e8bf..00000000 --- a/crates/bws/src/cli.rs +++ /dev/null @@ -1,169 +0,0 @@ -use std::path::PathBuf; - -use bitwarden_cli::Color; -use clap::{ArgGroup, Parser, Subcommand, ValueEnum}; -use clap_complete::Shell; -use uuid::Uuid; - -pub(crate) const ACCESS_TOKEN_KEY_VAR_NAME: &str = "BWS_ACCESS_TOKEN"; -pub(crate) const CONFIG_FILE_KEY_VAR_NAME: &str = "BWS_CONFIG_FILE"; -pub(crate) const PROFILE_KEY_VAR_NAME: &str = "BWS_PROFILE"; -pub(crate) const SERVER_URL_KEY_VAR_NAME: &str = "BWS_SERVER_URL"; -pub(crate) const UUIDS_AS_KEYNAMES_VAR_NAME: &str = "BWS_UUIDS_AS_KEYNAMES"; - -pub(crate) const DEFAULT_CONFIG_FILENAME: &str = "config"; -pub(crate) const DEFAULT_CONFIG_DIRECTORY: &str = ".config/bws"; - -#[allow(non_camel_case_types)] -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)] -pub(crate) enum ProfileKey { - server_base, - server_api, - server_identity, - state_dir, - state_opt_out, -} - -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)] -#[allow(clippy::upper_case_acronyms)] -pub(crate) enum Output { - JSON, - YAML, - Env, - Table, - TSV, - None, -} - -#[derive(Parser, Debug)] -#[command(name = "bws", version, about = "Bitwarden Secrets CLI", long_about = None)] -pub(crate) struct Cli { - // Optional as a workaround for https://github.com/clap-rs/clap/issues/3572 - #[command(subcommand)] - pub(crate) command: Option, - - #[arg(short = 'o', long, global = true, value_enum, default_value_t = Output::JSON, help="Output format")] - pub(crate) output: Output, - - #[arg(short = 'c', long, global = true, value_enum, default_value_t = Color::Auto, help="Use colors in the output")] - pub(crate) color: Color, - - #[arg(short = 't', long, global = true, env = ACCESS_TOKEN_KEY_VAR_NAME, hide_env_values = true, help="Specify access token for the service account")] - pub(crate) access_token: Option, - - #[arg( - short = 'f', - long, - global = true, - env = CONFIG_FILE_KEY_VAR_NAME, - help = format!("[default: ~/{}/{}] Config file to use", DEFAULT_CONFIG_DIRECTORY, DEFAULT_CONFIG_FILENAME) - )] - pub(crate) config_file: Option, - - #[arg(short = 'p', long, global = true, env = PROFILE_KEY_VAR_NAME, help="Profile to use from the config file")] - pub(crate) profile: Option, - - #[arg(short = 'u', long, global = true, env = SERVER_URL_KEY_VAR_NAME, help="Override the server URL from the config file")] - pub(crate) server_url: Option, -} - -#[derive(Subcommand, Debug)] -pub(crate) enum Commands { - #[command(long_about = "Configure the CLI", arg_required_else_help(true))] - Config { - name: Option, - value: Option, - - #[arg(short = 'd', long)] - delete: bool, - }, - - #[command(long_about = "Generate shell completion files")] - Completions { shell: Option }, - - #[command(long_about = "Commands available on Projects")] - Project { - #[command(subcommand)] - cmd: ProjectCommand, - }, - #[command(long_about = "Commands available on Secrets")] - Secret { - #[command(subcommand)] - cmd: SecretCommand, - }, - #[command(long_about = "Run a command with secrets injected")] - Run { - #[arg(help = "The command to run")] - command: Vec, - #[arg(long, help = "The shell to use")] - shell: Option, - #[arg( - long, - help = "Don't inherit environment variables from the current shell" - )] - no_inherit_env: bool, - #[arg(long, help = "The ID of the project to use")] - project_id: Option, - #[arg( - long, - global = true, - env = UUIDS_AS_KEYNAMES_VAR_NAME, - help = "Use the secret UUID (in its POSIX form) instead of the key name for the environment variable" - )] - uuids_as_keynames: bool, - }, -} - -#[derive(Subcommand, Debug)] -pub(crate) enum SecretCommand { - Create { - key: String, - value: String, - - #[arg(help = "The ID of the project this secret will be added to")] - project_id: Uuid, - - #[arg(long, help = "An optional note to add to the secret")] - note: Option, - }, - Delete { - secret_ids: Vec, - }, - #[clap(group = ArgGroup::new("edit_field").required(true).multiple(true))] - Edit { - secret_id: Uuid, - #[arg(long, group = "edit_field")] - key: Option, - #[arg(long, group = "edit_field")] - value: Option, - #[arg(long, group = "edit_field")] - note: Option, - #[arg(long, group = "edit_field")] - project_id: Option, - }, - Get { - secret_id: Uuid, - }, - List { - project_id: Option, - }, -} - -#[derive(Subcommand, Debug)] -pub(crate) enum ProjectCommand { - Create { - name: String, - }, - Delete { - project_ids: Vec, - }, - Edit { - project_id: Uuid, - #[arg(long, group = "edit_field")] - name: String, - }, - Get { - project_id: Uuid, - }, - List, -} diff --git a/crates/bws/src/command/mod.rs b/crates/bws/src/command/mod.rs deleted file mode 100644 index 98287e45..00000000 --- a/crates/bws/src/command/mod.rs +++ /dev/null @@ -1,67 +0,0 @@ -pub(crate) mod project; -pub(crate) mod run; -pub(crate) mod secret; - -use std::{path::PathBuf, str::FromStr}; - -use bitwarden::auth::AccessToken; -use clap::CommandFactory; -use clap_complete::Shell; -use color_eyre::eyre::{bail, Result}; - -use crate::{config, util, Cli, ProfileKey}; - -pub(crate) fn completions(shell: Option) -> Result<()> { - let Some(shell) = shell.or_else(Shell::from_env) else { - bail!("Couldn't autodetect a valid shell. Run `bws completions --help` for more info."); - }; - - let mut cmd = Cli::command(); - let name = cmd.get_name().to_string(); - clap_complete::generate(shell, &mut cmd, name, &mut std::io::stdout()); - - Ok(()) -} - -pub(crate) fn config( - name: Option, - value: Option, - delete: bool, - profile: Option, - access_token: Option, - config_file: Option, -) -> Result<()> { - let profile = if let Some(profile) = profile { - profile - } else if let Some(access_token) = access_token { - AccessToken::from_str(&access_token)? - .access_token_id - .to_string() - } else { - String::from("default") - }; - - if delete { - config::delete_profile(config_file.as_deref(), profile)?; - println!("Profile deleted successfully!"); - } else { - let (name, value) = match (name, value) { - (None, None) => bail!("Missing `name` and `value`"), - (None, Some(_)) => bail!("Missing `value`"), - (Some(_), None) => bail!("Missing `name`"), - (Some(ProfileKey::state_opt_out), Some(value)) => { - if util::string_to_bool(value.as_str()).is_err() { - bail!("Profile key \"state_opt_out\" must be \"true\" or \"false\""); - } else { - (ProfileKey::state_opt_out, value) - } - } - (Some(name), Some(value)) => (name, value), - }; - - config::update_profile(config_file.as_deref(), profile, name, value)?; - println!("Profile updated successfully!"); - }; - - Ok(()) -} diff --git a/crates/bws/src/command/project.rs b/crates/bws/src/command/project.rs deleted file mode 100644 index 3b521e2c..00000000 --- a/crates/bws/src/command/project.rs +++ /dev/null @@ -1,141 +0,0 @@ -use bitwarden::{ - secrets_manager::{ - projects::{ - ProjectCreateRequest, ProjectGetRequest, ProjectPutRequest, ProjectsDeleteRequest, - ProjectsListRequest, - }, - ClientProjectsExt, - }, - Client, -}; -use color_eyre::eyre::{bail, Result}; -use uuid::Uuid; - -use crate::{ - render::{serialize_response, OutputSettings}, - ProjectCommand, -}; - -pub(crate) async fn process_command( - command: ProjectCommand, - client: Client, - organization_id: Uuid, - output_settings: OutputSettings, -) -> Result<()> { - match command { - ProjectCommand::List => list(client, organization_id, output_settings).await, - ProjectCommand::Get { project_id } => get(client, project_id, output_settings).await, - ProjectCommand::Create { name } => { - create(client, organization_id, name, output_settings).await - } - ProjectCommand::Edit { project_id, name } => { - edit(client, organization_id, project_id, name, output_settings).await - } - ProjectCommand::Delete { project_ids } => delete(client, project_ids).await, - } -} - -pub(crate) async fn list( - client: Client, - organization_id: Uuid, - output_settings: OutputSettings, -) -> Result<()> { - let projects = client - .projects() - .list(&ProjectsListRequest { organization_id }) - .await? - .data; - serialize_response(projects, output_settings); - - Ok(()) -} - -pub(crate) async fn get( - client: Client, - project_id: Uuid, - output_settings: OutputSettings, -) -> Result<()> { - let project = client - .projects() - .get(&ProjectGetRequest { id: project_id }) - .await?; - serialize_response(project, output_settings); - - Ok(()) -} - -pub(crate) async fn create( - client: Client, - organization_id: Uuid, - name: String, - output_settings: OutputSettings, -) -> Result<()> { - let project = client - .projects() - .create(&ProjectCreateRequest { - organization_id, - name, - }) - .await?; - serialize_response(project, output_settings); - - Ok(()) -} - -pub(crate) async fn edit( - client: Client, - organization_id: Uuid, - project_id: Uuid, - name: String, - output_settings: OutputSettings, -) -> Result<()> { - let project = client - .projects() - .update(&ProjectPutRequest { - id: project_id, - organization_id, - name, - }) - .await?; - serialize_response(project, output_settings); - - Ok(()) -} - -pub(crate) async fn delete(client: Client, project_ids: Vec) -> Result<()> { - let count = project_ids.len(); - - let result = client - .projects() - .delete(ProjectsDeleteRequest { ids: project_ids }) - .await?; - - let projects_failed: Vec<(Uuid, String)> = result - .data - .into_iter() - .filter_map(|r| r.error.map(|e| (r.id, e))) - .collect(); - let deleted_projects = count - projects_failed.len(); - - match deleted_projects { - 2.. => println!("{} projects deleted successfully.", deleted_projects), - 1 => println!("{} project deleted successfully.", deleted_projects), - _ => (), - } - - match projects_failed.len() { - 2.. => eprintln!("{} projects had errors:", projects_failed.len()), - 1 => eprintln!("{} project had an error:", projects_failed.len()), - _ => (), - } - - for project in &projects_failed { - eprintln!("{}: {}", project.0, project.1); - } - - if !projects_failed.is_empty() { - bail!("Errors when attempting to delete projects."); - } - - Ok(()) -} diff --git a/crates/bws/src/command/run.rs b/crates/bws/src/command/run.rs deleted file mode 100644 index 6548778e..00000000 --- a/crates/bws/src/command/run.rs +++ /dev/null @@ -1,149 +0,0 @@ -use std::{ - collections::HashMap, - io::{IsTerminal, Read}, - process, -}; - -use bitwarden::{ - secrets_manager::{ - secrets::{SecretIdentifiersByProjectRequest, SecretIdentifiersRequest, SecretsGetRequest}, - ClientSecretsExt, - }, - Client, -}; -use color_eyre::eyre::{bail, Result}; -use itertools::Itertools; -use uuid::Uuid; -use which::which; - -use crate::{ - util::{is_valid_posix_name, uuid_to_posix}, - ACCESS_TOKEN_KEY_VAR_NAME, -}; - -// Essential environment variables that should be preserved even when `--no-inherit-env` is used -const WINDOWS_ESSENTIAL_VARS: &[&str] = &["SystemRoot", "ComSpec", "windir"]; - -pub(crate) async fn run( - client: Client, - organization_id: Uuid, - project_id: Option, - uuids_as_keynames: bool, - no_inherit_env: bool, - shell: Option, - command: Vec, -) -> Result { - let is_windows = std::env::consts::OS == "windows"; - - let shell = shell.unwrap_or_else(|| { - if is_windows { - "powershell".to_string() - } else { - "sh".to_string() - } - }); - - if which(&shell).is_err() { - bail!("Shell '{}' not found", shell); - } - - let user_command = if command.is_empty() { - if std::io::stdin().is_terminal() { - bail!("No command provided"); - } - - let mut buffer = String::new(); - std::io::stdin().read_to_string(&mut buffer)?; - buffer - } else { - command.join(" ") - }; - - let res = if let Some(project_id) = project_id { - client - .secrets() - .list_by_project(&SecretIdentifiersByProjectRequest { project_id }) - .await? - } else { - client - .secrets() - .list(&SecretIdentifiersRequest { organization_id }) - .await? - }; - - let secret_ids = res.data.into_iter().map(|e| e.id).collect(); - let secrets = client - .secrets() - .get_by_ids(SecretsGetRequest { ids: secret_ids }) - .await? - .data; - - if !uuids_as_keynames { - if let Some(duplicate) = secrets.iter().map(|s| &s.key).duplicates().next() { - bail!("Multiple secrets with name: '{}'. Use --uuids-as-keynames or use unique names for secrets", duplicate); - } - } - - let environment: HashMap = secrets - .into_iter() - .map(|s| { - if uuids_as_keynames { - (uuid_to_posix(&s.id), s.value) - } else { - (s.key, s.value) - } - }) - .inspect(|(k, _)| { - if !is_valid_posix_name(k) { - eprintln!( - "Warning: secret '{}' does not have a POSIX-compliant name", - k - ); - } - }) - .collect(); - - let mut command = process::Command::new(shell); - command - .arg("-c") - .arg(&user_command) - .stdout(process::Stdio::inherit()) - .stderr(process::Stdio::inherit()); - - if no_inherit_env { - let path = std::env::var("PATH").unwrap_or_else(|_| match is_windows { - true => "C:\\Windows;C:\\Windows\\System32".to_string(), - false => "/bin:/usr/bin".to_string(), - }); - - command.env_clear(); - - // Preserve essential PowerShell environment variables on Windows - if is_windows { - for &var in WINDOWS_ESSENTIAL_VARS { - if let Ok(value) = std::env::var(var) { - command.env(var, value); - } - } - } - - command.env("PATH", path); // PATH is always necessary - command.envs(environment); - } else { - command.env_remove(ACCESS_TOKEN_KEY_VAR_NAME); - command.envs(environment); - } - - // propagate the exit status from the child process - match command.spawn() { - Ok(mut child) => match child.wait() { - Ok(exit_status) => Ok(exit_status.code().unwrap_or(1)), - Err(e) => { - bail!("Failed to wait for process: {}", e) - } - }, - Err(e) => { - bail!("Failed to execute process: {}", e) - } - } -} diff --git a/crates/bws/src/command/secret.rs b/crates/bws/src/command/secret.rs deleted file mode 100644 index 0f1aa398..00000000 --- a/crates/bws/src/command/secret.rs +++ /dev/null @@ -1,221 +0,0 @@ -use bitwarden::{ - secrets_manager::{ - secrets::{ - SecretCreateRequest, SecretGetRequest, SecretIdentifiersByProjectRequest, - SecretIdentifiersRequest, SecretPutRequest, SecretsDeleteRequest, SecretsGetRequest, - }, - ClientSecretsExt, - }, - Client, -}; -use color_eyre::eyre::{bail, Result}; -use uuid::Uuid; - -use crate::{ - render::{serialize_response, OutputSettings}, - SecretCommand, -}; - -#[derive(Debug)] -pub(crate) struct SecretCreateCommandModel { - pub(crate) key: String, - pub(crate) value: String, - pub(crate) note: Option, - pub(crate) project_id: Uuid, -} - -#[derive(Debug)] -pub(crate) struct SecretEditCommandModel { - pub(crate) id: Uuid, - pub(crate) key: Option, - pub(crate) value: Option, - pub(crate) note: Option, - pub(crate) project_id: Option, -} - -pub(crate) async fn process_command( - command: SecretCommand, - client: Client, - organization_id: Uuid, - output_settings: OutputSettings, -) -> Result<()> { - match command { - SecretCommand::List { project_id } => { - list(client, organization_id, project_id, output_settings).await - } - SecretCommand::Get { secret_id } => get(client, secret_id, output_settings).await, - SecretCommand::Create { - key, - value, - note, - project_id, - } => { - create( - client, - organization_id, - SecretCreateCommandModel { - key, - value, - note, - project_id, - }, - output_settings, - ) - .await - } - SecretCommand::Edit { - secret_id, - key, - value, - note, - project_id, - } => { - edit( - client, - organization_id, - SecretEditCommandModel { - id: secret_id, - key, - value, - note, - project_id, - }, - output_settings, - ) - .await - } - SecretCommand::Delete { secret_ids } => delete(client, secret_ids).await, - } -} - -pub(crate) async fn list( - client: Client, - organization_id: Uuid, - project_id: Option, - output_settings: OutputSettings, -) -> Result<()> { - let res = if let Some(project_id) = project_id { - client - .secrets() - .list_by_project(&SecretIdentifiersByProjectRequest { project_id }) - .await? - } else { - client - .secrets() - .list(&SecretIdentifiersRequest { organization_id }) - .await? - }; - - let secret_ids = res.data.into_iter().map(|e| e.id).collect(); - let secrets = client - .secrets() - .get_by_ids(SecretsGetRequest { ids: secret_ids }) - .await? - .data; - serialize_response(secrets, output_settings); - - Ok(()) -} - -pub(crate) async fn get( - client: Client, - secret_id: Uuid, - output_settings: OutputSettings, -) -> Result<()> { - let secret = client - .secrets() - .get(&SecretGetRequest { id: secret_id }) - .await?; - serialize_response(secret, output_settings); - - Ok(()) -} - -pub(crate) async fn create( - client: Client, - organization_id: Uuid, - secret: SecretCreateCommandModel, - output_settings: OutputSettings, -) -> Result<()> { - let secret = client - .secrets() - .create(&SecretCreateRequest { - organization_id, - key: secret.key, - value: secret.value, - note: secret.note.unwrap_or_default(), - project_ids: Some(vec![secret.project_id]), - }) - .await?; - serialize_response(secret, output_settings); - - Ok(()) -} - -pub(crate) async fn edit( - client: Client, - organization_id: Uuid, - secret: SecretEditCommandModel, - output_settings: OutputSettings, -) -> Result<()> { - let old_secret = client - .secrets() - .get(&SecretGetRequest { id: secret.id }) - .await?; - - let new_secret = client - .secrets() - .update(&SecretPutRequest { - id: secret.id, - organization_id, - key: secret.key.unwrap_or(old_secret.key), - value: secret.value.unwrap_or(old_secret.value), - note: secret.note.unwrap_or(old_secret.note), - project_ids: secret - .project_id - .or(old_secret.project_id) - .map(|id| vec![id]), - }) - .await?; - serialize_response(new_secret, output_settings); - - Ok(()) -} - -pub(crate) async fn delete(client: Client, secret_ids: Vec) -> Result<()> { - let count = secret_ids.len(); - - let result = client - .secrets() - .delete(SecretsDeleteRequest { ids: secret_ids }) - .await?; - - let secrets_failed: Vec<(Uuid, String)> = result - .data - .into_iter() - .filter_map(|r| r.error.map(|e| (r.id, e))) - .collect(); - let deleted_secrets = count - secrets_failed.len(); - - match deleted_secrets { - 2.. => println!("{} secrets deleted successfully.", deleted_secrets), - 1 => println!("{} secret deleted successfully.", deleted_secrets), - _ => (), - } - - match secrets_failed.len() { - 2.. => eprintln!("{} secrets had errors:", secrets_failed.len()), - 1 => eprintln!("{} secret had an error:", secrets_failed.len()), - _ => (), - } - - for secret in &secrets_failed { - eprintln!("{}: {}", secret.0, secret.1); - } - - if !secrets_failed.is_empty() { - bail!("Errors when attempting to delete secrets."); - } - - Ok(()) -} diff --git a/crates/bws/src/config.rs b/crates/bws/src/config.rs deleted file mode 100644 index 9fd91849..00000000 --- a/crates/bws/src/config.rs +++ /dev/null @@ -1,217 +0,0 @@ -use std::{ - collections::HashMap, - fs::read_to_string, - path::{Path, PathBuf}, -}; - -use color_eyre::eyre::{bail, Result}; -use directories::BaseDirs; -use serde::{Deserialize, Serialize}; - -use crate::cli::{ProfileKey, DEFAULT_CONFIG_DIRECTORY, DEFAULT_CONFIG_FILENAME}; - -#[derive(Debug, Serialize, Deserialize, Default)] -pub(crate) struct Config { - pub profiles: HashMap, -} - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] -pub(crate) struct Profile { - pub server_base: Option, - pub server_api: Option, - pub server_identity: Option, - pub state_dir: Option, - pub state_opt_out: Option, -} - -impl ProfileKey { - fn update_profile_value(&self, p: &mut Profile, value: String) { - match self { - ProfileKey::server_base => p.server_base = Some(value), - ProfileKey::server_api => p.server_api = Some(value), - ProfileKey::server_identity => p.server_identity = Some(value), - ProfileKey::state_dir => p.state_dir = Some(value), - ProfileKey::state_opt_out => p.state_opt_out = Some(value), - } - } -} - -fn get_config_path(config_file: Option<&Path>, ensure_folder_exists: bool) -> Result { - let config_file = match config_file { - Some(path) => path.to_owned(), - None => { - let Some(base_dirs) = BaseDirs::new() else { - bail!("A valid home directory doesn't exist"); - }; - base_dirs - .home_dir() - .join(DEFAULT_CONFIG_DIRECTORY) - .join(DEFAULT_CONFIG_FILENAME) - } - }; - - if ensure_folder_exists { - if let Some(parent_folder) = config_file.parent() { - std::fs::create_dir_all(parent_folder)?; - } - } - - Ok(config_file) -} - -pub(crate) fn load_config(config_file: Option<&Path>, must_exist: bool) -> Result { - let file = get_config_path(config_file, false)?; - - let content = match file.exists() { - true => read_to_string(file), - false if must_exist => bail!("Config file doesn't exist"), - false => return Ok(Config::default()), - }; - - let config: Config = toml::from_str(&content?)?; - Ok(config) -} - -fn write_config(config: Config, config_file: Option<&Path>) -> Result<()> { - let file = get_config_path(config_file, true)?; - - let content = toml::to_string_pretty(&config)?; - - std::fs::write(file, content)?; - Ok(()) -} - -pub(crate) fn update_profile( - config_file: Option<&Path>, - profile: String, - name: ProfileKey, - value: String, -) -> Result<()> { - let mut config = load_config(config_file, false)?; - - let p = config.profiles.entry(profile).or_default(); - name.update_profile_value(p, value); - - write_config(config, config_file)?; - Ok(()) -} - -pub(crate) fn delete_profile(config_file: Option<&Path>, profile: String) -> Result<()> { - let mut config = load_config(config_file, true)?; - - if !config.profiles.contains_key(&profile) { - bail!("Profile does not exist"); - } - - config.profiles.remove(&profile); - - write_config(config, config_file)?; - Ok(()) -} - -impl Profile { - pub(crate) fn from_url(url: &str) -> Result { - if !url.starts_with("http://") && !url.starts_with("https://") { - bail!("Server URL must start with http:// or https://, the provided URL is: `{url}`"); - } - - Ok(Profile { - server_base: Some(url.to_string()), - server_api: None, - server_identity: None, - state_dir: None, - state_opt_out: None, - }) - } - pub(crate) fn api_url(&self) -> Result { - if let Some(api) = &self.server_api { - return Ok(api.clone()); - } - - if let Some(base) = &self.server_base { - return Ok(format!("{base}/api")); - } - - bail!("Profile has no `server_base` or `server_api`"); - } - - pub(crate) fn identity_url(&self) -> Result { - if let Some(identity) = &self.server_identity { - return Ok(identity.clone()); - } - - if let Some(base) = &self.server_base { - return Ok(format!("{base}/identity")); - } - - bail!("Profile has no `server_base` or `server_identity`"); - } -} - -impl Config { - pub(crate) fn select_profile( - &self, - profile: &str, - profile_defined: bool, - ) -> Result> { - if let Some(profile) = self.profiles.get(profile) { - return Ok(Some(profile.clone())); - } - - if profile_defined { - bail!("The specified profile does not exist"); - } - - if let Some(profile) = self.profiles.get("default") { - return Ok(Some(profile.clone())); - } - - Ok(None) - } -} - -#[cfg(test)] -mod tests { - use std::io::Write; - - use tempfile::NamedTempFile; - - use super::*; - - #[test] - fn config_doesnt_exist() { - let c = load_config(Some(Path::new("non_existing")), true); - assert!(c.is_err()); - - let c = load_config(None, false); - assert!(c.is_ok()); - } - - #[test] - fn config_exist() { - let tmpfile = NamedTempFile::new().unwrap(); - write!(tmpfile.as_file(), "[profiles]").unwrap(); - - let c = load_config(Some(Path::new(tmpfile.as_ref())), true); - let config = c.unwrap(); - assert_eq!(0, config.profiles.len()); - } - - #[test] - fn config_exist_with_profile() { - let tmpfile = NamedTempFile::new().unwrap(); - write!( - tmpfile.as_file(), - "[profiles.default] - server_base = \"https://bitwarden.com\" - " - ) - .unwrap(); - - let c = load_config(Some(Path::new(tmpfile.as_ref())), true); - assert_eq!( - "https://bitwarden.com", - c.unwrap().profiles["default"].server_base.as_ref().unwrap() - ); - } -} diff --git a/crates/bws/src/main.rs b/crates/bws/src/main.rs deleted file mode 100644 index e77c8fd2..00000000 --- a/crates/bws/src/main.rs +++ /dev/null @@ -1,195 +0,0 @@ -use std::{path::PathBuf, str::FromStr}; - -use bitwarden::{ - auth::{login::AccessTokenLoginRequest, AccessToken}, - ClientSettings, -}; -use bitwarden_cli::install_color_eyre; -use clap::{CommandFactory, Parser}; -use color_eyre::eyre::{bail, Result}; -use config::Profile; -use log::error; -use render::OutputSettings; - -mod cli; -mod command; -mod config; -mod render; -mod state; -mod util; - -use crate::cli::*; - -#[tokio::main(flavor = "current_thread")] -async fn main() -> Result<()> { - env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init(); - - process_commands().await -} - -#[allow(clippy::comparison_chain)] -async fn process_commands() -> Result<()> { - let cli = Cli::parse(); - let color = cli.color; - - install_color_eyre(color)?; - - let Some(command) = cli.command else { - let mut cmd = Cli::command(); - eprintln!("{}", cmd.render_help().ansi()); - std::process::exit(1); - }; - - // These commands don't require authentication, so we process them first - match command { - Commands::Completions { shell } => { - return command::completions(shell); - } - Commands::Config { - name, - value, - delete, - } => { - return command::config( - name, - value, - delete, - cli.profile, - cli.access_token, - cli.config_file, - ); - } - _ => (), - } - - let access_token = match cli.access_token { - Some(key) => key, - None => bail!("Missing access token"), - }; - let access_token_obj: AccessToken = access_token.parse()?; - - let profile = get_config_profile( - &cli.server_url, - &cli.profile, - &cli.config_file, - &access_token, - )?; - - let settings = profile - .clone() - .map(|p| -> Result<_> { - Ok(ClientSettings { - identity_url: p.identity_url()?, - api_url: p.api_url()?, - ..Default::default() - }) - }) - .transpose()?; - - let state_file = match get_state_opt_out(&profile) { - true => None, - false => match state::get_state_file( - profile.and_then(|p| p.state_dir).map(Into::into), - access_token_obj.access_token_id.to_string(), - ) { - Ok(state_file) => Some(state_file), - Err(e) => { - eprintln!("Warning: {}\nRetrieving the state file failed. Attempting to continue without using state. Please set \"state_dir\" in your config file to avoid authentication limits.", e); - None - } - }, - }; - - let client = bitwarden::Client::new(settings); - - // Load session or return if no session exists - let _ = client - .auth() - .login_access_token(&AccessTokenLoginRequest { - access_token, - state_file, - }) - .await?; - - let organization_id = match client.internal.get_access_token_organization() { - Some(id) => id, - None => { - error!("Access token isn't associated to an organization."); - return Ok(()); - } - }; - - let output_settings = OutputSettings::new(cli.output, color); - - // And finally we process all the commands which require authentication - match command { - Commands::Project { cmd } => { - command::project::process_command(cmd, client, organization_id, output_settings).await - } - - Commands::Secret { cmd } => { - command::secret::process_command(cmd, client, organization_id, output_settings).await - } - - Commands::Run { - command, - shell, - no_inherit_env, - project_id, - uuids_as_keynames, - } => { - let exit_code = command::run::run( - client, - organization_id, - project_id, - uuids_as_keynames, - no_inherit_env, - shell, - command, - ) - .await?; - - // exit with the exit code from the child process - std::process::exit(exit_code); - } - - Commands::Config { .. } | Commands::Completions { .. } => { - unreachable!() - } - } -} - -fn get_config_profile( - server_url: &Option, - profile: &Option, - config_file: &Option, - access_token: &str, -) -> Result, color_eyre::Report> { - let profile = if let Some(server_url) = server_url { - Some(config::Profile::from_url(server_url)?) - } else { - let profile_defined = profile.is_some(); - - let profile_key = if let Some(profile) = profile { - profile.to_owned() - } else { - AccessToken::from_str(access_token)? - .access_token_id - .to_string() - }; - - let config = config::load_config(config_file.as_deref(), config_file.is_some())?; - config.select_profile(&profile_key, profile_defined)? - }; - Ok(profile) -} - -fn get_state_opt_out(profile: &Option) -> bool { - if let Some(profile) = profile { - if let Some(state_opt_out) = &profile.state_opt_out { - return util::string_to_bool(state_opt_out).unwrap_or(false); - } - } - - false -} diff --git a/crates/bws/src/render.rs b/crates/bws/src/render.rs deleted file mode 100644 index bf0c26f6..00000000 --- a/crates/bws/src/render.rs +++ /dev/null @@ -1,154 +0,0 @@ -use bitwarden::secrets_manager::{projects::ProjectResponse, secrets::SecretResponse}; -use bitwarden_cli::Color; -use chrono::{DateTime, Utc}; -use comfy_table::Table; -use serde::Serialize; - -use crate::{cli::Output, util::is_valid_posix_name}; - -const ASCII_HEADER_ONLY: &str = " -- "; - -pub(crate) struct OutputSettings { - pub(crate) output: Output, - pub(crate) color: Color, -} - -impl OutputSettings { - pub(crate) fn new(output: Output, color: Color) -> Self { - OutputSettings { output, color } - } -} - -pub(crate) fn serialize_response, const N: usize>( - data: T, - output_settings: OutputSettings, -) { - match output_settings.output { - Output::JSON => { - let mut text = - serde_json::to_string_pretty(&data).expect("Serialize should be infallible"); - // Yaml/table/tsv serializations add a newline at the end, so we do the same here for - // consistency - text.push('\n'); - pretty_print("json", &text, output_settings.color); - } - Output::YAML => { - let text = serde_yaml::to_string(&data).expect("Serialize should be infallible"); - pretty_print("yaml", &text, output_settings.color); - } - Output::Env => { - let mut commented_out = false; - let mut text: Vec = data - .get_values() - .into_iter() - .map(|row| { - if is_valid_posix_name(&row[1]) { - format!("{}=\"{}\"", row[1], row[2]) - } else { - commented_out = true; - format!("# {}=\"{}\"", row[1], row[2].replace('\n', "\n# ")) - } - }) - .collect(); - - if commented_out { - text.push(String::from( - "\n# one or more secrets have been commented-out due to a problematic key name", - )); - } - - pretty_print( - "sh", - &format!("{}\n", text.join("\n")), - output_settings.color, - ); - } - Output::Table => { - let mut table = Table::new(); - table - .load_preset(ASCII_HEADER_ONLY) - .set_header(T::get_headers()) - .add_rows(data.get_values()); - - println!("{table}"); - } - Output::TSV => { - println!("{}", T::get_headers().join("\t")); - - let rows: Vec = data - .get_values() - .into_iter() - .map(|row| row.join("\t")) - .collect(); - println!("{}", rows.join("\n")); - } - Output::None => {} - } -} - -fn pretty_print(language: &str, data: &str, color: Color) { - if color.is_enabled() { - bat::PrettyPrinter::new() - .input_from_bytes(data.as_bytes()) - .language(language) - .print() - .expect("Input is valid"); - } else { - print!("{}", data); - } -} - -// We're using const generics for the array lengths to make sure the header count and value count -// match -pub(crate) trait TableSerialize: Sized { - fn get_headers() -> [&'static str; N]; - fn get_values(&self) -> Vec<[String; N]>; -} - -// Generic impl for Vec so we can call `serialize_response` with both individual -// elements and lists of elements, like we do with the JSON and YAML cases -impl, const N: usize> TableSerialize for Vec { - fn get_headers() -> [&'static str; N] { - T::get_headers() - } - fn get_values(&self) -> Vec<[String; N]> { - let mut values = Vec::new(); - for t in self { - values.append(&mut t.get_values()); - } - values - } -} - -fn format_date(date: &DateTime) -> String { - date.format("%Y-%m-%d %H:%M:%S").to_string() -} - -impl TableSerialize<3> for ProjectResponse { - fn get_headers() -> [&'static str; 3] { - ["ID", "Name", "Creation Date"] - } - - fn get_values(&self) -> Vec<[String; 3]> { - vec![[ - self.id.to_string(), - self.name.clone(), - format_date(&self.creation_date), - ]] - } -} - -impl TableSerialize<4> for SecretResponse { - fn get_headers() -> [&'static str; 4] { - ["ID", "Key", "Value", "Creation Date"] - } - - fn get_values(&self) -> Vec<[String; 4]> { - vec![[ - self.id.to_string(), - self.key.clone(), - self.value.clone(), - format_date(&self.creation_date), - ]] - } -} diff --git a/crates/bws/src/state.rs b/crates/bws/src/state.rs deleted file mode 100644 index b5756a05..00000000 --- a/crates/bws/src/state.rs +++ /dev/null @@ -1,32 +0,0 @@ -use std::path::PathBuf; - -use color_eyre::eyre::{bail, Result}; -use directories::BaseDirs; - -use crate::DEFAULT_CONFIG_DIRECTORY; - -pub(crate) const DEFAULT_STATE_DIRECTORY: &str = "state"; - -pub(crate) fn get_state_file( - state_dir: Option, - access_token_id: String, -) -> Result { - let mut state_dir = match state_dir { - Some(state_dir) => state_dir, - None => { - if let Some(base_dirs) = BaseDirs::new() { - base_dirs - .home_dir() - .join(DEFAULT_CONFIG_DIRECTORY) - .join(DEFAULT_STATE_DIRECTORY) - } else { - bail!("A valid home directory doesn't exist"); - } - } - }; - - std::fs::create_dir_all(&state_dir)?; - state_dir.push(access_token_id); - - Ok(state_dir) -} diff --git a/crates/bws/src/util.rs b/crates/bws/src/util.rs deleted file mode 100644 index a86f0f56..00000000 --- a/crates/bws/src/util.rs +++ /dev/null @@ -1,93 +0,0 @@ -use regex::Regex; -use uuid::Uuid; - -const VALID_POSIX_NAME_REGEX: &str = "^[a-zA-Z_][a-zA-Z0-9_]*$"; -const STRING_TO_BOOL_ERROR_MESSAGE: &str = "Could not convert string to bool"; - -pub(crate) fn is_valid_posix_name(input_text: &str) -> bool { - Regex::new(VALID_POSIX_NAME_REGEX) - .expect("VALID_POSIX_NAME_REGEX to be a valid regex") - .is_match(input_text) -} - -pub(crate) fn string_to_bool(value: &str) -> Result { - match value.trim().to_lowercase().as_str() { - "true" | "1" => Ok(true), - "false" | "0" => Ok(false), - _ => Err(STRING_TO_BOOL_ERROR_MESSAGE), - } -} - -/// Converts a UUID to a POSIX-compliant environment variable name. -/// -/// POSIX environment variable names must start with a letter or an underscore -/// and can only contain letters, numbers, and underscores. -pub(crate) fn uuid_to_posix(uuid: &Uuid) -> String { - format!("_{}", uuid.to_string().replace('-', "_")) -} - -mod tests { - #[allow(unused_imports)] - use super::*; - - #[test] - fn test_is_valid_posix_name_true() { - assert!(is_valid_posix_name("a_valid_name")); - assert!(is_valid_posix_name("another_valid_name")); - assert!(is_valid_posix_name("_another_valid_name")); - assert!(is_valid_posix_name("ANOTHER_ONE")); - assert!(is_valid_posix_name( - "abcdefghijklmnopqrstuvwxyz__ABCDEFGHIJKLMNOPQRSTUVWXYZ__0123456789" - )); - } - - #[test] - fn test_is_valid_posix_name_false() { - assert!(!is_valid_posix_name("")); - assert!(!is_valid_posix_name("1a")); - assert!(!is_valid_posix_name("a bad name")); - assert!(!is_valid_posix_name("another-bad-name")); - assert!(!is_valid_posix_name("a\nbad\nname")); - } - - #[test] - fn test_uuid_to_posix_success() { - assert_eq!( - "_759130d0_29dd_48bd_831a_e3bdbafeeb6e", - uuid_to_posix( - &uuid::Uuid::parse_str("759130d0-29dd-48bd-831a-e3bdbafeeb6e").expect("valid uuid") - ) - ); - assert!(is_valid_posix_name(&uuid_to_posix(&uuid::Uuid::new_v4()))); - } - - #[test] - fn test_string_to_bool_true_true() { - let result = string_to_bool("true"); - assert_eq!(result, Ok(true)); - } - - #[test] - fn test_string_to_bool_one_true() { - let result = string_to_bool("1"); - assert_eq!(result, Ok(true)); - } - - #[test] - fn test_string_to_bool_false_false() { - let result = string_to_bool("false"); - assert_eq!(result, Ok(false)); - } - - #[test] - fn test_string_to_bool_zero_false() { - let result = string_to_bool("0"); - assert_eq!(result, Ok(false)); - } - - #[test] - fn test_string_to_bool_bad_string_errors() { - let result = string_to_bool("hello world"); - assert_eq!(result, Err(STRING_TO_BOOL_ERROR_MESSAGE)); - } -} diff --git a/crates/sdk-schemas/Cargo.toml b/crates/sdk-schemas/Cargo.toml deleted file mode 100644 index 13a66487..00000000 --- a/crates/sdk-schemas/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "sdk-schemas" -version = "0.1.0" -publish = false - -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -homepage.workspace = true -repository.workspace = true -license-file.workspace = true -keywords.workspace = true - -[features] - -[dependencies] -anyhow = "1.0.82" -bitwarden = { workspace = true } -bitwarden-json = { path = "../bitwarden-json" } -bitwarden-uniffi = { path = "../bitwarden-uniffi", optional = true } -itertools = "0.13.0" -schemars = { workspace = true, features = ["preserve_order"] } -serde_json = "1.0.113" diff --git a/crates/sdk-schemas/src/main.rs b/crates/sdk-schemas/src/main.rs deleted file mode 100644 index 2db3ce5f..00000000 --- a/crates/sdk-schemas/src/main.rs +++ /dev/null @@ -1,118 +0,0 @@ -use std::{fs::File, io::Write}; - -use anyhow::Result; -use schemars::{schema::RootSchema, schema_for, JsonSchema}; - -/// Creates a json schema file for any type passed in using Schemars. The filename and path of the -/// generated schema file is derived from the namespace passed into the macro or supplied as the -/// first argument. -/// -/// The schema filename is given by the last namespace element and trims off any `>` characters. -/// This means the filename will represent the last _generic_ type of the type given. -/// -/// The schema path is rooted at the current working directory. -/// -/// # Usage -/// -/// ## Fully generated -/// -/// Subpath is equal to the namespace except the last two elements, which are assumed to be -/// a filename and struct name. -/// -/// Min namespace length is currently 3. -/// -/// ### Examples -/// -/// ``` -/// write_schema_for!(request::command::Command); -/// ``` -/// will generate `Command.json` at `{{pwd}}/request/Command.json` -/// -/// ``` -/// write_schema_for!(response::two_factor_login_response::two_factor_providers::TwoFactorProviders); -/// ``` -/// will generate `TwoFactorProviders.json` at -/// `{{pwd}}/response/two_factor_login_response/TwoFactorProviders.json` -/// -/// ## Path specified -/// -/// You can also specify a custom path and type, separated by a comman -/// -/// ### Examples -/// -/// ``` -/// write_schema_for!("path/to/folder", Request); -/// ``` -/// will generate `Response.json` at `{{pwd}}/path/to/folder/Response.json` -macro_rules! write_schema_for { - ($type:ty) => { - use itertools::Itertools; - - let schema = schema_for!($type); - - let type_name = stringify!($type); - let path: Vec<&str> = type_name.split("::").collect(); - let dir_path = - String::from("support/schemas/") + &path.iter().take(path.len() - 2).join("/"); - - write_schema(schema, dir_path, type_name.to_string())?; - }; - ($path:literal, $type:ty) => { - let schema = schema_for!($type); - - write_schema( - schema, - String::from("support/schemas/") + $path, - stringify!($type).to_string(), - )?; - }; -} - -fn write_schema(schema: RootSchema, dir_path: String, type_name: String) -> Result<()> { - let file_name = type_name - .split("::") - .last() - .unwrap() - .to_string() - .trim_end_matches('>') - .to_string() - + ".json"; - - let content = serde_json::to_string_pretty(&schema)?; - let _ = std::fs::create_dir_all(&dir_path); - let mut file = File::create(format!("{}/{}", dir_path, file_name))?; - writeln!(&mut file, "{}", &content)?; - Ok(()) -} - -use bitwarden_json::response::Response; - -#[allow(dead_code)] -#[derive(JsonSchema)] -struct SchemaTypes { - // Input types for new Client - client_settings: bitwarden::ClientSettings, - - // Input types for Client::run_command - input_command: bitwarden_json::command::Command, - - // Output types for Client::run_command - api_key_login: Response, - password_login: Response, - login_access_token: Response, - secret_identifiers: Response, - secret: Response, - secrets: Response, - secrets_delete: Response, - secrets_sync: Response, - project: Response, - projects: Response, - projects_delete: Response, - password: Response, -} - -fn main() -> Result<()> { - write_schema_for!("schema_types", SchemaTypes); - - Ok(()) -} diff --git a/languages/cpp/CMakeBuild.md b/languages/cpp/CMakeBuild.md deleted file mode 100644 index b75da5c1..00000000 --- a/languages/cpp/CMakeBuild.md +++ /dev/null @@ -1,61 +0,0 @@ -# CMake Build - -## Introduction - -Cmake is used to build the C++ Bitwarden client library. Output should be placed in the build directory. -The output contains two dynamic libraries: - -- The C++ client `BitwardenClient` -- The Bitwarden library used by the C++ client `bitwarden_c`. - -See how to use these libraries in the [example use guide](./examples/ExampleUse.md) - -## Prerequisites - -- Cmake installed, minimum version 3.15 -- `schemas.hpp` generated into `include` directory -- installed `nlohmann-json` library -- installed `boost` library - -## Build Commands - -One should be in the root directory of the C++ wrapper (the same level where is CMakeLists.txt placed). Paths of the -three libraries should be placed inside the cmake build command: - -```bash -mkdir -p build -cd build -cmake .. -DNLOHMANN=/path/to/include/nlohmann -DBOOST=/path/to/include/boost -DTARGET=relative/path/to/libbitwarden_c -cmake --build . -``` - -## IDE Support - -You may need to manually set the CMake `TARGET` variable for your IDE. For CLion, add the following to the CMake options -settings: - -```bash -# macOS example --DTARGET=../../target/release/libbitwarden_c.dylib -``` - -## Example - -### macOS - -#### Install Prerequisites - -```bash -brew install cmake -brew install boost -brew install nlohmann-json -``` - -#### Build - -```bash -mkdir -p build -cd build -cmake .. -DNLOHMANN=/opt/homebrew/include -DBOOST=/opt/homebrew/include -DTARGET=../../target/release/libbitwarden_c.dylib -cmake --build . -``` diff --git a/languages/cpp/CMakeLists.txt b/languages/cpp/CMakeLists.txt deleted file mode 100644 index e6ad7f4f..00000000 --- a/languages/cpp/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(BitwardenClient) - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -# Set placeholders to be passed from command line -set(NLOHMANN_JSON_INCLUDE_DIR_PLACEHOLDER ${NLOHMANN}) -set(BOOST_INCLUDE_DIR_PLACEHOLDER ${BOOST}) -set(TARGET_INCLUDE_DIR_PLACEHOLDER ${TARGET}) - -# Specify the locations of nlohmann.json and Boost libraries -find_path(NLOHMANN_JSON_INCLUDE_DIR nlohmann/json.hpp HINTS ${NLOHMANN_JSON_INCLUDE_DIR_PLACEHOLDER}) -find_path(BOOST_INCLUDE_DIR boost/optional.hpp HINTS ${BOOST_INCLUDE_DIR_PLACEHOLDER}) - -# Include directories for library -include_directories(include ${NLOHMANN_JSON_INCLUDE_DIR} ${BOOST_INCLUDE_DIR}) - -# Add library source files -file(GLOB SOURCES "src/*.cpp") - -# Add library source files along with the schemas.cpp file -add_library(BitwardenClient SHARED ${SOURCES} ${SCHEMAS_SOURCE}) - -# Set path for native library loading -set(LIB_BITWARDEN_C "${CMAKE_SOURCE_DIR}/${TARGET}") - -# Copy the library to the build directory before building -add_custom_command( - TARGET BitwardenClient PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${LIB_BITWARDEN_C} - $ -) - -# Link libraries -target_link_libraries(BitwardenClient PRIVATE ${LIB_BITWARDEN_C}) diff --git a/languages/cpp/README.md b/languages/cpp/README.md deleted file mode 100644 index fb714a20..00000000 --- a/languages/cpp/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Bitwarden Secrets Manager SDK - -C++ bindings for interacting with the [Bitwarden Secrets Manager]. This is a beta release and might be missing some functionality. - -## Create access token - -Review the help documentation on [Access Tokens] - -## Usage code snippets - -### Client settings - -```c++ -// Optional - if not stressed, then default values are used -BitwardenSettings bitwardenSettings; -bitwardenSettings.set_api_url(""); -bitwardenSettings.set_identity_url(""); -``` - - -### Create new Bitwarden client - -```c++ -std::string accessToken = ""; -std::string stateFile = ""; -// Optional - argument in BitwardenClient -BitwardenClient bitwardenClient = BitwardenClient(bitwardenSettings); -bitwardenClient.loginAccessToken(accessToken, stateFile); -``` - -### Create new project - -```c++ -boost::uuids::uuid organizationUuid = boost::uuids::string_generator()(""); -ProjectResponse projectResponseCreate = bitwardenClient.createProject(organizationUuid, "TestProject"); -boost::uuids::uuid projectId = boost::uuids::string_generator()(projectResponseCreate.get_id()); -``` - -### List all projects - -```c++ -ProjectsResponse projectResponseList = bitwardenClient.listProjects(organizationUuid); -``` - -### Get project details - -```c++ -ProjectResponse projectResponseGet = bitwardenClient.getProject(projectId); -``` - -### Update project - -```c++ -ProjectResponse projectResponseUpdate = bitwardenClient.updateProject(organizationUuid, projectId, "TestProjectUpdated"); -``` - -### Delete projects - -```c++ -ProjectsDeleteResponse projectsDeleteResponse = bitwardenClient.deleteProjects({projectId}); -``` - -### Add new secret - -```c++ -std::string key = "key"; -std::string value = "value"; -std::string note = "note"; -SecretResponse secretResponseCreate = bitwardenClient.createSecret(organizationUuid, key, value, note, {projectId}); -boost::uuids::uuid secretId = boost::uuids::string_generator()(secretResponseCreate.get_id()); -``` - -### List secrets - -```c++ -SecretIdentifiersResponse secretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); -``` - -### Get secret details - -```c++ -SecretResponse secretResponseGet = bitwardenClient.getSecret(secretId); -``` - -### Get multiple secrets by ids - -```c++ -std::vector secretIds = {secretId, secretId2}; -SecretsResponse secretsResponseGet = bitwardenClient.getSecrets(secretIds); -``` - -### Update secret - -```c++ -SecretResponse secretResponseUpdate = bitwardenClient.updateSecret(organizationUuid, secretId, "key2", "value2", "note2", {projectId}); -``` - -### Sync secrets - -```c++ -std::chrono::system_clock::time_point lastSyncedDate = std::chrono::system_clock::now(); -SecretsSyncResponse secretsSyncResponse = bitwardenClient.sync(orgnizationUuid, lastSyncedDate); -``` - -# Delete secrets - -```c++ -SecretsDeleteResponse secretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); -``` - -[Access Tokens]: https://bitwarden.com/help/access-tokens/ -[Bitwarden Secrets Manager]: https://bitwarden.com/products/secrets-manager/ diff --git a/languages/cpp/examples/ExampleUse.md b/languages/cpp/examples/ExampleUse.md deleted file mode 100644 index f5ec6f6f..00000000 --- a/languages/cpp/examples/ExampleUse.md +++ /dev/null @@ -1,108 +0,0 @@ -# Examples - -## Prerequisites - -### Bitwarden Libraries - -Have the two Bitwarden libraries at the same path: - -- `BitwardenClient` -- `bitwarden_c` - -For each OS the library files will be the following: - -- macOS: `libBitwardenClient.dylib` and `libbitwarden_c.dylib` -- Linux: `libBitwardenClient.so` and `libbitwarden_c.so` -- Windows: `BitwardenClient.dll` and `bitwarden_c.dll` - -Follow the [cmake build guide](../CMakeBuild.md) to create the libraries locally. - -### Include Directory - -`include` directory contains: - -- `BitwardenLibrary.h` -- `BitwardenClient.h` -- `BitwardenSettings.h` -- `CommandRunner.h` -- `Projects.h` -- `Secrets.h` -- `schemas.hpp` - -### Other Libraries - -- `nlohmann-json` () -- `boost` () - -### Compiling - -Use g++/clang++ for compiling. - -Example of the folder structure (macOS): - -```text ---root - --build - `libBitwardenClient.dylib` - `libbitwarden_c.dylib` - --include - --`BitwardenLibrary.h` - --`BitwardenClient.h` - --`BitwardenSettings.h` - --`CommandRunner.h` - --`Projects.h` - --`Secrets.h` - --`schemas.hpp` - --examples - --`Wrapper.cpp` -``` - -Set the environment variable path for the Bitwarden libraries. - -For macOS: - -```bash -export DYLD_LIBRARY_PATH=/path/to/your/library:$DYLD_LIBRARY_PATH -``` - -For Linux: - -```bash -export LD_LIBRARY_PATH=/path/to/your/library:$LD_LIBRARY_PATH -``` - -For Windows: - -```shell - set "PATH=%PATH%;C:\path\to\your\library" -``` - -Set environment variables used in `Wrapper.cpp`: - -```bash -export ACCESS_TOKEN=<"access-token"> -export ORGANIZATION_ID=<"organization-id"> -export API_URL=http://localhost:4000 -export IDENTITY_URL=http://localhost:33656 -``` - -Compile: - -```bash -cd examples -clang++ -std=c++20 -I../include -I/path/to/include/nlohmann -I/path/to/include/boost -L../build/ -o MyBitwardenApp Wrapper.cpp -lBitwardenClient -ldl -``` - -for Windows `-ldl` should be excluded, - -for macOS nlohmann and boost libraries installed with homebrew the following can be used: - -```bash --I/opt/homebrew/include -``` - -The result is `MyBitwardenApp` in the `examples` directory, and can be ran from the `examples` directory: - -```bash -./MyBitwardenApp -``` diff --git a/languages/cpp/examples/Wrapper.cpp b/languages/cpp/examples/Wrapper.cpp deleted file mode 100644 index 7790adfb..00000000 --- a/languages/cpp/examples/Wrapper.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "BitwardenClient.h" -#include -#include -#include - -int main() { - // Retrieve access token and organization ID from environment variables - const char *accessTokenEnv = std::getenv("ACCESS_TOKEN"); - const char *organizationIdEnv = std::getenv("ORGANIZATION_ID"); - - // Use optional state file for authentication - const char *stateFile = std::getenv("STATE_FILE"); - - const char *apiUrl = std::getenv("API_URL"); - const char *identityUrl = std::getenv("IDENTITY_URL"); - - if (!accessTokenEnv || !organizationIdEnv) { - std::cerr << "Error: Environment variables ACCESS_TOKEN or ORGANIZATION_ID not set." << std::endl; - return 1; - } - - std::string accessToken = accessTokenEnv; - std::string organizationId = organizationIdEnv; - - // Configuring the URLS is optional; if unset, use bitwarden.com - BitwardenSettings bitwardenSettings; - if (apiUrl != nullptr && identityUrl != nullptr) { - bitwardenSettings.set_api_url(apiUrl); - bitwardenSettings.set_identity_url(identityUrl); - } else { - std::cerr << "Info: API_URL and IDENTITY_URL are not set, using default values..." << std::endl; - } - - // Create a Bitwarden client instance - BitwardenClient bitwardenClient(bitwardenSettings); - - // Access token login - if (stateFile != nullptr) { - bitwardenClient.loginAccessToken(accessToken, stateFile); - } else { - bitwardenClient.loginAccessToken(accessToken); - } - - // Convert organization ID to UUID - boost::uuids::uuid organizationUuid = boost::uuids::string_generator()(organizationId); - - // Create a new project - std::cout << "Projects:\n"; - ProjectResponse projectResponseCreate = bitwardenClient.createProject(organizationUuid, "NewTestProject"); - boost::uuids::uuid projectId = boost::uuids::string_generator()(projectResponseCreate.get_id()); - - std::cout << "\tcreateProject: '" << projectResponseCreate.get_name() << "'\n\n"; - - // List projects - ProjectsResponse projectResponseList = bitwardenClient.listProjects(organizationUuid); - std::cout << "\tlistProjects:\n"; - for (const ProjectResponse& project : projectResponseList.get_data()) { - std::cout << "\t\tID: '" << project.get_id() << "', Name: '" << project.get_name() << "'\n"; - } - std::cout << '\n'; - - // Get project details - ProjectResponse projectResponseGet = bitwardenClient.getProject(projectId); - std::cout << "\tgetProject:\n\t\tID: '" << projectResponseGet.get_id() << "', Name: '" << projectResponseGet.get_name() << "'\n\n"; - - // Update project - ProjectResponse projectResponseUpdate = bitwardenClient.updateProject(organizationUuid, projectId, "NewTestProject2"); - std::cout << "\tupdateProject: '" << projectResponseUpdate.get_name() << "'\n\n"; - - // Secrets - std::string key = "key"; - std::string value = "value"; - std::string note = "note"; - - // Sync secrets - std::cout << "Secrets:\n"; - std::cout << "\tSyncing secrets...\n"; - SecretsSyncResponse secretsSyncResponse = bitwardenClient.sync(organizationUuid, {}); - std::chrono::system_clock::time_point lastSyncedDate = std::chrono::system_clock::now(); - std::cout << "\t\tSync has changes: '" << (secretsSyncResponse.get_has_changes() ? "true" : "false") << "'\n\n"; - - std::cout << "\tSyncing again to ensure no changes since last sync...\n"; - secretsSyncResponse = bitwardenClient.sync(organizationUuid, lastSyncedDate); - std::cout << "\t\tSync has changes: '" << (secretsSyncResponse.get_has_changes() ? "true" : "false") << "'\n\n"; - - // Create a new secret - SecretResponse secretResponseCreate = bitwardenClient.createSecret(organizationUuid, key, value, note, {projectId}); - boost::uuids::uuid secretId = boost::uuids::string_generator()(secretResponseCreate.get_id()); - - std::cout << "\tcreateSecret: '" << secretResponseCreate.get_key() << "'\n\n"; - - // List secrets - SecretIdentifiersResponse secretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); - std::cout << "\tlistSecrets:\n"; - for (const SecretIdentifierResponse& secretIdentifier : secretIdentifiersResponse.get_data()) { - std::cout << "\t\tID: '" << secretIdentifier.get_id() << "'\n"; - } - std::cout << '\n'; - - // Get secret details - SecretResponse secretResponseGet = bitwardenClient.getSecret(secretId); - std::cout << "\tgetSecret: '" << secretResponseGet.get_key() << "'\n\n"; - - // Get secrets by IDs - std::cout << "\tgetSecretsByIds:\n"; - SecretsResponse secretsResponseGetByIds = bitwardenClient.getSecretsByIds({secretId}); - for (const SecretResponse& secret : secretsResponseGetByIds.get_data()) { - std::cout << "\t\tID: '" << secret.get_id() << "', Key: '" << secret.get_key() << "'\n"; - } - std::cout << '\n'; - - // Update secret - key = "updated-key"; - value = "updated-value"; - note = "updated-note"; - SecretResponse responseForSecretResponseUpdate = bitwardenClient.updateSecret( - organizationUuid, secretId, key, value, note, {projectId}); - - std::cout << "\tupdateSecret: '" << responseForSecretResponseUpdate.get_key() << "'\n\n"; - - // Delete secrets - std::cout << "Deleting projects and secrets...\n"; - SecretsDeleteResponse secretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); - std::cout << "\tdeleteSecrets: '" << secretsDeleteResponse.get_data()[0].get_id() << "'\n\n"; - - // Delete projects - ProjectsDeleteResponse projectsDeleteResponse = bitwardenClient.deleteProjects({projectId}); - std::cout << "\tdeleteProjects: '" << projectsDeleteResponse.get_data()[0].get_id() << "'\n\n"; - - return 0; -} diff --git a/languages/cpp/include/BitwardenClient.h b/languages/cpp/include/BitwardenClient.h deleted file mode 100644 index 2910c49b..00000000 --- a/languages/cpp/include/BitwardenClient.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "CommandRunner.h" -#include "BitwardenSettings.h" -#include "Projects.h" -#include "Secrets.h" -#include -#include - -class BitwardenClient { -public: - explicit BitwardenClient(const BitwardenSettings& bitwardenSettings = BitwardenSettings()); - ~BitwardenClient(); - - void loginAccessToken(const std::string& accessToken, const std::string& stateFile = ""); - ProjectResponse getProject(const boost::uuids::uuid& id); - ProjectResponse createProject(const boost::uuids::uuid& organizationId, const std::string& name); - ProjectResponse updateProject(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& name); - ProjectsDeleteResponse deleteProjects(const std::vector& ids); - ProjectsResponse listProjects(const boost::uuids::uuid &organizationId); - SecretResponse getSecret(const boost::uuids::uuid& id); - SecretsResponse getSecretsByIds(const std::vector& ids); - SecretResponse createSecret(const boost::uuids::uuid& organizationId, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds); - SecretResponse updateSecret(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds); - SecretsDeleteResponse deleteSecrets(const std::vector& ids); - SecretIdentifiersResponse listSecrets(const boost::uuids::uuid& organizationId); - SecretsSyncResponse sync(const boost::uuids::uuid &organizationId, const std::chrono::system_clock::time_point &lastSyncedDate); - -private: - BitwardenLibrary* library; - void* client; - CommandRunner* commandRunner; - Projects projects; - Secrets secrets; - bool isClientOpen; - ClientSettings clientSettings; - -}; diff --git a/languages/cpp/include/BitwardenLibrary.h b/languages/cpp/include/BitwardenLibrary.h deleted file mode 100644 index 5fee7872..00000000 --- a/languages/cpp/include/BitwardenLibrary.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include - -#ifdef _WIN32 -#include -#else -#include -#endif - -class BitwardenLibrary { -public: - BitwardenLibrary(const std::string& providedLibraryPath); - ~BitwardenLibrary(); - - void* init(const char* clientSettingsJson); - void free_mem(void* client); - const char* run_command(const char* commandJson, void* client); - -private: -#ifdef _WIN32 - HMODULE libraryHandle; -#else - void* libraryHandle; -#endif -}; - diff --git a/languages/cpp/include/BitwardenSettings.h b/languages/cpp/include/BitwardenSettings.h deleted file mode 100644 index 4d075ed0..00000000 --- a/languages/cpp/include/BitwardenSettings.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include - -class BitwardenSettings { -public: - BitwardenSettings() = default; - ~BitwardenSettings() = default; - - const std::string& get_api_url() const { return api_url; } - void set_api_url(const std::string& value) { api_url = value; } - - const std::string& get_identity_url() const { return identity_url; } - void set_identity_url(const std::string& value) { identity_url = value; } - -private: - std::string api_url; - std::string identity_url; -}; diff --git a/languages/cpp/include/CommandRunner.h b/languages/cpp/include/CommandRunner.h deleted file mode 100644 index 9aa6cbe9..00000000 --- a/languages/cpp/include/CommandRunner.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include -#include -#include "BitwardenLibrary.h" -#include "schemas.hpp" -#include - -using namespace Bitwarden::Sdk; - -class CommandRunner { -public: - CommandRunner(BitwardenLibrary* library, void* client); - - template - R runCommand(const Command& command, Func deserializer); - - - -private: - BitwardenLibrary* library; - void* client; - - std::string commandToString(const Command& command); - nlohmann::json filterNullObjects(const nlohmann::json& input); -}; - -template -R CommandRunner::runCommand(const Command& command, Func deserializer) { - // Serialize the Command object to a JSON string - std::string jsonString = commandToString(command); - const char* jsonCStr = jsonString.c_str(); - const char* response = library->run_command(jsonCStr, client); - - // Deserialize the response using the provided deserializer function - T deserialized = deserializer(response); - - // Unwrap the response and throw an exception if it was not successful - if (!deserialized.get_success()) { - throw std::runtime_error(*deserialized.get_error_message()); - } - - return deserialized.get_data().get(); -} - diff --git a/languages/cpp/include/Projects.h b/languages/cpp/include/Projects.h deleted file mode 100644 index 27511c32..00000000 --- a/languages/cpp/include/Projects.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include -#include -#include "CommandRunner.h" - -class Projects { -public: - Projects(CommandRunner* commandRunner); - - ProjectResponse get(const boost::uuids::uuid& id); - ProjectResponse create(const boost::uuids::uuid& organizationId, const std::string& name); - ProjectResponse update(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& name); - ProjectsDeleteResponse deleteProjects(const std::vector& ids); - ProjectsResponse list(const boost::uuids::uuid& organizationId); - -private: - CommandRunner* commandRunner; -}; diff --git a/languages/cpp/include/Secrets.h b/languages/cpp/include/Secrets.h deleted file mode 100644 index 5c5a3275..00000000 --- a/languages/cpp/include/Secrets.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "CommandRunner.h" - -class Secrets { -public: - Secrets(CommandRunner* commandRunner); - - SecretResponse get(const boost::uuids::uuid& id); - SecretsResponse getByIds(const std::vector &ids); - SecretResponse create(const boost::uuids::uuid& organizationId, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds); - SecretResponse update(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds); - SecretsDeleteResponse deleteSecrets(const std::vector& ids); - SecretIdentifiersResponse list(const boost::uuids::uuid& organizationId); - SecretsSyncResponse sync(const boost::uuids::uuid& organizationId, const boost::optional& lastSyncedDate); - -private: - CommandRunner* commandRunner; -}; - diff --git a/languages/cpp/src/BitwardenClient.cpp b/languages/cpp/src/BitwardenClient.cpp deleted file mode 100644 index 2d11977d..00000000 --- a/languages/cpp/src/BitwardenClient.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include "BitwardenClient.h" -#include -#include - -BitwardenClient::BitwardenClient(const BitwardenSettings& bitwardenSettings) - : library(nullptr), commandRunner(nullptr), isClientOpen(false), projects(nullptr), secrets(nullptr) { - - // Set default values for optional strings - boost::optional apiUrl = bitwardenSettings.get_api_url().empty() - ? boost::optional("https://api.bitwarden.com") - : boost::optional(bitwardenSettings.get_api_url()); - - boost::optional identityUrl = bitwardenSettings.get_identity_url().empty() - ? boost::optional("https://identity.bitwarden.com") - : boost::optional(bitwardenSettings.get_identity_url()); - - boost::optional user_agent = boost::optional("Bitwarden CPP-SDK"); - - // Set values in clientSettings - clientSettings.set_device_type(Bitwarden::Sdk::DeviceType::SDK); - clientSettings.set_user_agent(user_agent); - clientSettings.set_api_url(apiUrl); - clientSettings.set_identity_url(identityUrl); - - nlohmann::json jsonClientSettings; - Bitwarden::Sdk::to_json(jsonClientSettings, clientSettings); - - std::string jsonClientSettingsString = jsonClientSettings.dump(); - const char* jsonClientSettingsCStr = jsonClientSettingsString.c_str(); - - try { - library = new BitwardenLibrary("./"); - client = library->init(jsonClientSettingsCStr); - commandRunner = new CommandRunner(library, client); - projects = Projects(commandRunner); - secrets = Secrets(commandRunner); - isClientOpen = true; - } catch (const std::exception& ex) { - std::cerr << "Failed to initialize: " << ex.what() << std::endl; - throw ex; - } -} - -BitwardenClient::~BitwardenClient() { - if (library) { - delete commandRunner; - library->free_mem(client); - delete library; - isClientOpen = false; - } -} - -void BitwardenClient::loginAccessToken(const std::string& accessToken, const std::string& stateFile) { - Command command; - AccessTokenLoginRequest accessTokenLoginRequest; - accessTokenLoginRequest.set_access_token(accessToken); - accessTokenLoginRequest.set_state_file(stateFile); - command.set_login_access_token(accessTokenLoginRequest); - - auto deserializer = [](const char* response) -> ResponseForApiKeyLoginResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForApiKeyLoginResponse loginResponse; - Bitwarden::Sdk::from_json(jsonResponse, loginResponse); - return loginResponse; - }; - try { - commandRunner->runCommand(command, deserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in accessTokenLogin: " << ex.what() << std::endl; - throw ex; - } -} - -ProjectResponse BitwardenClient::getProject(const boost::uuids::uuid& id){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return projects.get(id); -} - -ProjectResponse BitwardenClient::createProject(const boost::uuids::uuid& organizationId, const std::string& name){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return projects.create(organizationId, name); -} - -ProjectResponse BitwardenClient::updateProject(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& name){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return projects.update(organizationId, id, name); -} - -ProjectsDeleteResponse BitwardenClient::deleteProjects(const std::vector& ids) { - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return projects.deleteProjects(ids); - -} - -ProjectsResponse BitwardenClient::listProjects(const boost::uuids::uuid &organizationId) { - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return projects.list(organizationId); - -} - -SecretResponse BitwardenClient::getSecret(const boost::uuids::uuid& id){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.get(id); -} - -SecretsResponse BitwardenClient::getSecretsByIds(const std::vector& ids){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.getByIds(ids); -} - -SecretResponse BitwardenClient::createSecret(const boost::uuids::uuid& organizationId, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.create(organizationId, key, value, note, projectIds); -} - -SecretResponse BitwardenClient::updateSecret(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds){ - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.update(organizationId, id, key, value, note, projectIds); -} - -SecretsDeleteResponse BitwardenClient::deleteSecrets(const std::vector& ids) { - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.deleteSecrets(ids); - -} - -SecretIdentifiersResponse BitwardenClient::listSecrets(const boost::uuids::uuid &organizationId) { - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.list(organizationId); - -} - -SecretsSyncResponse BitwardenClient::sync(const boost::uuids::uuid &organizationId, const std::chrono::system_clock::time_point &lastSyncedDate) { - if (!isClientOpen) { - throw std::runtime_error("Client is not open."); - } - return secrets.sync(organizationId, lastSyncedDate); -} diff --git a/languages/cpp/src/BitwardenLibrary.cpp b/languages/cpp/src/BitwardenLibrary.cpp deleted file mode 100644 index 0af59278..00000000 --- a/languages/cpp/src/BitwardenLibrary.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "BitwardenLibrary.h" -#include - -BitwardenLibrary::BitwardenLibrary(const std::string& providedLibraryPath) : libraryHandle(nullptr) { - std::string libraryExtension; - std::string libraryNameUnix = "libbitwarden_c"; - std::string libraryNameWin = "bitwarden_c"; -#if defined(_WIN32) - libraryExtension = ".dll"; -#elif defined(__linux__) - libraryExtension = ".so"; -#elif defined(__APPLE__) - libraryExtension = ".dylib"; -#else - // Unsupported platform - std::cerr << "Unsupported platform." << std::endl; - return; -#endif - - // Load the dynamic library -#ifdef _WIN32 - std::string libraryPath = providedLibraryPath + libraryNameWin + libraryExtension; - // Load the dynamic library on Windows - libraryHandle = LoadLibraryA(libraryPath.c_str()); - - if (!libraryHandle) { - std::cerr << "Failed to load the Bitwarden library." << std::endl; - } -#else - std::string libraryPath = providedLibraryPath + libraryNameUnix + libraryExtension; - // Load the dynamic library on Unix-based systems (Linux, macOS) - libraryHandle = dlopen(libraryPath.c_str(), RTLD_NOW); - - if (!libraryHandle) { - std::cerr << "Failed to load the Bitwarden library: " << dlerror() << std::endl; - } -#endif -} - -BitwardenLibrary::~BitwardenLibrary() { - if (libraryHandle) { -#ifdef _WIN32 - FreeLibrary(libraryHandle); -#else - dlclose(libraryHandle); -#endif - } -} - -void* BitwardenLibrary::init(const char* clientSettingsJson) { - typedef void* (*InitFunction)(const char*); - InitFunction initFunction = nullptr; - -#ifdef _WIN32 - // Get the address of the init function on Windows - initFunction = reinterpret_cast(GetProcAddress(libraryHandle, "init")); -#else - // Get the address of the init function on Unix-based systems - initFunction = reinterpret_cast(dlsym(libraryHandle, "init")); -#endif - - if (initFunction) { - return initFunction(clientSettingsJson); - } - - std::cerr << "Failed to load init function from the Bitwarden library: " << std::endl; - return nullptr; -} - -void BitwardenLibrary::free_mem(void* client) { - typedef void (*FreeMemFunction)(void*); - FreeMemFunction freeMemFunction = nullptr; - -#ifdef _WIN32 - // Get the address of the free_mem function on Windows - freeMemFunction = reinterpret_cast(GetProcAddress(libraryHandle, "free_mem")); -#else - // Get the address of the free_mem function on Unix-based systems - freeMemFunction = reinterpret_cast(dlsym(libraryHandle, "free_mem")); -#endif - - if (freeMemFunction) { - freeMemFunction(client); - } else { - std::cerr << "Failed to load free_mem function from the Bitwarden library." << std::endl; - } -} - -const char* BitwardenLibrary::run_command(const char* commandJson, void* client) { - typedef const char* (*RunCommandFunction)(const char*, void*); - RunCommandFunction runCommandFunction = nullptr; - -#ifdef _WIN32 - // Get the address of the run_command function on Windows - runCommandFunction = reinterpret_cast(GetProcAddress(libraryHandle, "run_command")); -#else - // Get the address of the run_command function on Unix-based systems - runCommandFunction = reinterpret_cast(dlsym(libraryHandle, "run_command")); -#endif - - if (runCommandFunction) { - return runCommandFunction(commandJson, client); - } - - std::cerr << "Failed to load run_command function from the Bitwarden library." << std::endl; - return nullptr; -} diff --git a/languages/cpp/src/CommandRunner.cpp b/languages/cpp/src/CommandRunner.cpp deleted file mode 100644 index 032347f3..00000000 --- a/languages/cpp/src/CommandRunner.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "CommandRunner.h" -#include -#include -#include - - -CommandRunner::CommandRunner(BitwardenLibrary* library, void* client) : library(library), client(client) {} - -// Function to recursively filter out objects with all null values -nlohmann::json CommandRunner::filterNullObjects(const nlohmann::json& input) { - nlohmann::json result; - - for (auto it = input.begin(); it != input.end(); ++it) { - if (!it.value().is_null()) { - if (it.value().is_object()) { - // Recursively filter nested objects - json nestedFiltered = filterNullObjects(it.value()); - if (!nestedFiltered.empty()) { - result[it.key()] = nestedFiltered; - } - } else { - result[it.key()] = it.value(); - } - } - } - - return result; -} - -// Implement the commandToString function -std::string CommandRunner::commandToString(const Command& command) { - try { - // Create an nlohmann::json object from the Command object - nlohmann::json jsonCommand; - nlohmann::json filteredJsonCommand; - - Bitwarden::Sdk::to_json(jsonCommand, command); - - filteredJsonCommand = filterNullObjects(jsonCommand); - - // Convert the JSON to a string - std::string jsonCommandString = filteredJsonCommand.dump(); - - return jsonCommandString; - } catch (const std::exception& ex) { - std::cerr << "Error: " << ex.what() << std::endl; - throw ex; - } -} diff --git a/languages/cpp/src/Projects.cpp b/languages/cpp/src/Projects.cpp deleted file mode 100644 index b2fa1c68..00000000 --- a/languages/cpp/src/Projects.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "Projects.h" -#include -#include -#include -#include -#include - -Projects::Projects(CommandRunner* commandRunner) : commandRunner(commandRunner) {} - -auto projectsDeserializer = [](const char* response) -> ResponseForProjectResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForProjectResponse projectResponse; - Bitwarden::Sdk::from_json(jsonResponse, projectResponse); - return projectResponse; -}; - -auto deleteProjectsDeserializer = [](const char* response) -> ResponseForProjectsDeleteResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForProjectsDeleteResponse deleteProjectsResponse; - Bitwarden::Sdk::from_json(jsonResponse, deleteProjectsResponse); - return deleteProjectsResponse; -}; - -auto projectListDeserializer = [](const char* response) -> ResponseForProjectsResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForProjectsResponse listResponse; - Bitwarden::Sdk::from_json(jsonResponse, listResponse); - return listResponse; -}; - -ProjectResponse Projects::get(const boost::uuids::uuid& id) { - Command command; - ProjectsCommand projectsCommand; - ProjectGetRequest projectGetRequest; - - std::string idStr = boost::uuids::to_string(id); - projectGetRequest.set_id(idStr); - - projectsCommand.set_get(projectGetRequest); - command.set_projects(projectsCommand); - - try { - return commandRunner->runCommand(command, projectsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in getProject: " << ex.what() << std::endl; - throw ex; - } -} - -ProjectResponse Projects::create(const boost::uuids::uuid& organizationId, const std::string& name) { - Command command; - ProjectsCommand projectsCommand; - ProjectCreateRequest projectCreateRequest; - - std::string orgIdStr = boost::uuids::to_string(organizationId); - projectCreateRequest.set_organization_id(orgIdStr); - - projectCreateRequest.set_name(name); - projectsCommand.set_create(projectCreateRequest); - command.set_projects(projectsCommand); - - try { - return commandRunner->runCommand(command, projectsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in createProject: " << ex.what() << std::endl; - throw ex; - } -} - -ProjectResponse Projects::update(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& name) { - Command command; - ProjectsCommand projectsCommand; - ProjectPutRequest projectPutRequest; - - std::string idStr = boost::uuids::to_string(id); - projectPutRequest.set_id(idStr); - - std::string orgIdStr = boost::uuids::to_string(organizationId); - projectPutRequest.set_organization_id(orgIdStr); - - projectPutRequest.set_name(name); - projectsCommand.set_update(projectPutRequest); - command.set_projects(projectsCommand); - - try { - return commandRunner->runCommand(command, projectsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in updateProject: " << ex.what() << std::endl; - throw ex; - } -} - -ProjectsDeleteResponse Projects::deleteProjects(const std::vector& ids) { - Command command; - ProjectsCommand projectsCommand; - ProjectsDeleteRequest projectsDeleteRequest; - - std::vector idStrs; - for (const auto& id : ids) { - idStrs.push_back(boost::uuids::to_string(id)); - } - projectsDeleteRequest.set_ids(idStrs); - - projectsCommand.set_projects_command_delete(projectsDeleteRequest); - command.set_projects(projectsCommand); - - try { - return commandRunner->runCommand(command, deleteProjectsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in deleteProjects: " << ex.what() << std::endl; - throw ex; - } -} - -ProjectsResponse Projects::list(const boost::uuids::uuid& organizationId) { - Command command; - ProjectsCommand projectsCommand; - ProjectsListRequest projectsListRequest; - - std::string orgIdStr = boost::uuids::to_string(organizationId); - projectsListRequest.set_organization_id(orgIdStr); - - projectsCommand.set_list(projectsListRequest); - command.set_projects(projectsCommand); - - try { - return commandRunner->runCommand(command, projectListDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in listProjects: " << ex.what() << std::endl; - throw ex; - } -} diff --git a/languages/cpp/src/Secrets.cpp b/languages/cpp/src/Secrets.cpp deleted file mode 100644 index 1fff9441..00000000 --- a/languages/cpp/src/Secrets.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#include "Secrets.h" -#include -#include -#include -#include - -Secrets::Secrets(CommandRunner* commandRunner) : commandRunner(commandRunner) {} - -auto secretsDeserializer = [](const std::string& response) -> ResponseForSecretResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForSecretResponse secretResponse; - Bitwarden::Sdk::from_json(jsonResponse, secretResponse); - return secretResponse; -}; - -auto secretsByIdsDeserializer = [](const std::string& response) -> ResponseForSecretsResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForSecretsResponse secretsResponse; - Bitwarden::Sdk::from_json(jsonResponse, secretsResponse); - return secretsResponse; -}; - -auto deleteSecretsDeserializer = [](const std::string& response) -> ResponseForSecretsDeleteResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForSecretsDeleteResponse deleteSecretsResponse; - Bitwarden::Sdk::from_json(jsonResponse, deleteSecretsResponse); - return deleteSecretsResponse; -}; - -auto secretListDeserializer = [](const std::string& response) -> ResponseForSecretIdentifiersResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForSecretIdentifiersResponse listResponse; - Bitwarden::Sdk::from_json(jsonResponse, listResponse); - return listResponse; -}; - -auto secretsSyncDeserializer = [](const std::string& response) -> ResponseForSecretsSyncResponse { - nlohmann::json jsonResponse = nlohmann::json::parse(response); - ResponseForSecretsSyncResponse syncResponse; - Bitwarden::Sdk::from_json(jsonResponse, syncResponse); - return syncResponse; -}; - -SecretResponse Secrets::get(const boost::uuids::uuid& id) { - Command command; - SecretsCommand secretsCommand; - SecretGetRequest secretGetRequest; - - std::string idStr = boost::uuids::to_string(id); - secretGetRequest.set_id(idStr); - - secretsCommand.set_get(secretGetRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in getSecret: " << ex.what() << std::endl; - throw ex; - } -} - -SecretsResponse Secrets::getByIds(const std::vector& ids) { - Command command; - SecretsCommand secretsCommand; - SecretsGetRequest secretsGetRequest; - - std::vector idsStr; - for (const auto& id : ids) { - idsStr.push_back(boost::uuids::to_string(id)); - } - secretsGetRequest.set_ids(idsStr); - - secretsCommand.set_get_by_ids(secretsGetRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretsByIdsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in getSecretsByIds: " << ex.what() << std::endl; - throw ex; - } -} - -SecretResponse Secrets::create(const boost::uuids::uuid& organizationId, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds) { - Command command; - SecretsCommand secretsCommand; - SecretCreateRequest secretCreateRequest; - - std::string orgIdStr = boost::uuids::to_string(organizationId); - secretCreateRequest.set_organization_id(orgIdStr); - - secretCreateRequest.set_key(key); - secretCreateRequest.set_value(value); - secretCreateRequest.set_note(note); - - std::vector projectIdsStr; - for (const auto& projectId : projectIds) { - projectIdsStr.push_back(boost::uuids::to_string(projectId)); - } - secretCreateRequest.set_project_ids(projectIdsStr); - - secretsCommand.set_create(secretCreateRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in createSecret: " << ex.what() << std::endl; - throw ex; - } -} - -SecretResponse Secrets::update(const boost::uuids::uuid& organizationId, const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const std::vector& projectIds) { - Command command; - SecretsCommand secretsCommand; - SecretPutRequest secretPutRequest; - - std::string idStr = boost::uuids::to_string(id); - secretPutRequest.set_id(idStr); - - std::string orgIdStr = boost::uuids::to_string(organizationId); - secretPutRequest.set_organization_id(orgIdStr); - - secretPutRequest.set_key(key); - secretPutRequest.set_value(value); - secretPutRequest.set_note(note); - - std::vector projectIdsStr; - for (const auto& projectId : projectIds) { - projectIdsStr.push_back(boost::uuids::to_string(projectId)); - } - secretPutRequest.set_project_ids(projectIdsStr); - - secretsCommand.set_update(secretPutRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in updateSecret: " << ex.what() << std::endl; - throw ex; - } -} - -SecretsDeleteResponse Secrets::deleteSecrets(const std::vector& ids) { - Command command; - SecretsCommand secretsCommand; - SecretsDeleteRequest secretsDeleteRequest; - - std::vector idsStr; - for (const auto& id : ids) { - idsStr.push_back(boost::uuids::to_string(id)); - } - secretsDeleteRequest.set_ids(idsStr); - - secretsCommand.set_secrets_command_delete(secretsDeleteRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, deleteSecretsDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in deleteSecrets: " << ex.what() << std::endl; - throw ex; - } -} - -SecretIdentifiersResponse Secrets::list(const boost::uuids::uuid& organizationId) { - Command command; - SecretsCommand secretsCommand; - SecretIdentifiersRequest secretIdentifiersRequest; - - std::string orgIdStr = boost::uuids::to_string(organizationId); - secretIdentifiersRequest.set_organization_id(orgIdStr); - - secretsCommand.set_list(secretIdentifiersRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretListDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in listSecret: " << ex.what() << std::endl; - throw ex; - } -} - -SecretsSyncResponse Secrets::sync(const boost::uuids::uuid& organizationId, const boost::optional& lastSyncedDate) { - Command command; - SecretsCommand secretsCommand; - SecretsSyncRequest secretsSyncRequest; - - std::string orgIdStr = boost::uuids::to_string(organizationId); - secretsSyncRequest.set_organization_id(orgIdStr); - - if (lastSyncedDate.has_value()) { - auto timePoint = lastSyncedDate.value(); - - // Get time as time_t and milliseconds - auto timeT = std::chrono::system_clock::to_time_t(timePoint); - auto milliseconds = std::chrono::duration_cast(timePoint.time_since_epoch()) % 1000; - - // Convert to a tm struct - std::tm tm = *std::gmtime(&timeT); - - // Create a string stream to format the date and time - std::stringstream dateStream; - dateStream << std::put_time(&tm, "%Y-%m-%dT%H:%M:%S"); - - // Add milliseconds - dateStream << '.' << std::setw(3) << std::setfill('0') << milliseconds.count() << 'Z'; - - // Convert to string - std::string dateStr = dateStream.str(); - - // Set the last synced date - secretsSyncRequest.set_last_synced_date(dateStr); - } else { - secretsSyncRequest.set_last_synced_date(boost::none); - } - - secretsCommand.set_sync(secretsSyncRequest); - command.set_secrets(secretsCommand); - - try { - return commandRunner->runCommand(command, secretsSyncDeserializer); - } catch (const std::exception& ex) { - std::cerr << "Error in syncSecrets: " << ex.what() << std::endl; - throw ex; - } -} diff --git a/languages/cpp/vcpkg.json b/languages/cpp/vcpkg.json deleted file mode 100644 index 8e5b968b..00000000 --- a/languages/cpp/vcpkg.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "bitwarden-sdk-secrets", - "version": "0.1.0", - "homepage": "https://github.com/bitwarden/sdk/tree/languages/cpp", - "description": "Bitwarden Secrets Manager SDK for C++", - "dependencies": [ - "boost-uuid", - "boost-optional", - "nlohmann-json" - ] -} diff --git a/languages/csharp/.editorconfig b/languages/csharp/.editorconfig deleted file mode 100644 index 21d7ac4a..00000000 --- a/languages/csharp/.editorconfig +++ /dev/null @@ -1,125 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Don't use tabs for indentation. -[*] -indent_style = space -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -guidelines = 120 -# (Please don't specify an indent_size here; that has too many unintended consequences.) - -# Code files -[*.{cs,csx,vb,vbx}] -indent_size = 4 -charset = utf-8-bom - -# Xml project files -[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 2 - -# Xml config files -[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] -indent_size = 2 - -# JSON files -[*.json] -indent_size = 2 - -# Dotnet code style settings: -[*.{cs,vb}] -# Sort using and Import directives with System.* appearing first -dotnet_sort_system_directives_first = true -# Avoid "this." and "Me." if not necessary -dotnet_style_qualification_for_field = false:suggestion -dotnet_style_qualification_for_property = false:suggestion -dotnet_style_qualification_for_method = false:suggestion -dotnet_style_qualification_for_event = false:suggestion - -# Use language keywords instead of framework type names for type references -dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion -dotnet_style_predefined_type_for_member_access = true:suggestion - -# Suggest more modern language features when available -dotnet_style_object_initializer = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_explicit_tuple_names = true:suggestion - -# Prefix private members with underscore -dotnet_naming_rule.private_members_with_underscore.symbols = private_fields -dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore -dotnet_naming_rule.private_members_with_underscore.severity = suggestion - -dotnet_naming_symbols.private_fields.applicable_kinds = field -dotnet_naming_symbols.private_fields.applicable_accessibilities = private - -dotnet_naming_style.prefix_underscore.capitalization = camel_case -dotnet_naming_style.prefix_underscore.required_prefix = _ - -# Async methods should have "Async" suffix -dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods -dotnet_naming_rule.async_methods_end_in_async.style = end_in_async -dotnet_naming_rule.async_methods_end_in_async.severity = suggestion - -dotnet_naming_symbols.any_async_methods.applicable_kinds = method -dotnet_naming_symbols.any_async_methods.applicable_accessibilities = * -dotnet_naming_symbols.any_async_methods.required_modifiers = async - -dotnet_naming_style.end_in_async.required_prefix = -dotnet_naming_style.end_in_async.required_suffix = Async -dotnet_naming_style.end_in_async.capitalization = pascal_case -dotnet_naming_style.end_in_async.word_separator = - -# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items. -dotnet_diagnostic.CS0618.severity = suggestion - -# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items. -dotnet_diagnostic.CS0612.severity = suggestion - -# Remove unnecessary using directives https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005 -dotnet_diagnostic.IDE0005.severity = warning - -# CSharp code style settings: -[*.cs] -# Prefer "var" everywhere -csharp_style_var_for_built_in_types = true:suggestion -csharp_style_var_when_type_is_apparent = true:suggestion -csharp_style_var_elsewhere = true:suggestion - -# Prefer method-like constructs to have a expression-body -csharp_style_expression_bodied_methods = true:none -csharp_style_expression_bodied_constructors = true:none -csharp_style_expression_bodied_operators = true:none - -# Prefer property-like constructs to have an expression-body -csharp_style_expression_bodied_properties = true:none -csharp_style_expression_bodied_indexers = true:none -csharp_style_expression_bodied_accessors = true:none - -# Suggest more modern language features when available -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_throw_expression = true:suggestion -csharp_style_conditional_delegate_call = true:suggestion - -# Newline settings -csharp_new_line_before_open_brace = all -csharp_new_line_before_else = true -csharp_new_line_before_catch = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_members_in_anonymous_types = true - -# Namespace settings -csharp_style_namespace_declarations = file_scoped:warning - -# Switch expression -dotnet_diagnostic.CS8509.severity = error # missing switch case for named enum value -dotnet_diagnostic.CS8524.severity = none # missing switch case for unnamed enum value diff --git a/languages/csharp/Bitwarden.Sdk.Samples/Bitwarden.Sdk.Samples.csproj b/languages/csharp/Bitwarden.Sdk.Samples/Bitwarden.Sdk.Samples.csproj deleted file mode 100644 index 5b189d8c..00000000 --- a/languages/csharp/Bitwarden.Sdk.Samples/Bitwarden.Sdk.Samples.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net6.0 - enable - enable - - - - - - - diff --git a/languages/csharp/Bitwarden.Sdk.Samples/Program.cs b/languages/csharp/Bitwarden.Sdk.Samples/Program.cs deleted file mode 100644 index e80d1201..00000000 --- a/languages/csharp/Bitwarden.Sdk.Samples/Program.cs +++ /dev/null @@ -1,73 +0,0 @@ -īģŋusing Bitwarden.Sdk; - -// Get environment variables -var identityUrl = Environment.GetEnvironmentVariable("IDENTITY_URL")!; -var apiUrl = Environment.GetEnvironmentVariable("API_URL")!; -var organizationId = Guid.Parse(Environment.GetEnvironmentVariable("ORGANIZATION_ID")!); -var accessToken = Environment.GetEnvironmentVariable("ACCESS_TOKEN")!; -var stateFile = Environment.GetEnvironmentVariable("STATE_FILE")!; - -// Create the SDK Client -using var bitwardenClient = new BitwardenClient(new BitwardenSettings -{ - ApiUrl = apiUrl, - IdentityUrl = identityUrl -}); - -// Authenticate -bitwardenClient.Auth.LoginAccessToken(accessToken, stateFile); - -// Projects List -var projectsList = bitwardenClient.Projects.List(organizationId).Data; -Console.WriteLine("A list of all projects:"); -foreach (ProjectResponse pr in projectsList) -{ - Console.WriteLine(" Project: " + pr.Name); -} - -Console.Write("Press enter to continue..."); -Console.ReadLine(); - -// Projects Create, Update, & Get -Console.WriteLine("Creating and updating a project"); -var projectResponse = bitwardenClient.Projects.Create(organizationId, "NewTestProject"); -projectResponse = bitwardenClient.Projects.Update(organizationId, projectResponse.Id, "NewTestProject Renamed"); -projectResponse = bitwardenClient.Projects.Get(projectResponse.Id); -Console.WriteLine("Here is the project we created and updated:"); -Console.WriteLine(projectResponse.Name); - -Console.Write("Press enter to continue..."); -Console.ReadLine(); - -// Secrets list -var secretsList = bitwardenClient.Secrets.List(organizationId).Data; -Console.WriteLine("A list of all secrets:"); -foreach (SecretIdentifierResponse sr in secretsList) -{ - Console.WriteLine(" Secret: " + sr.Key); -} - -Console.Write("Press enter to continue..."); -Console.ReadLine(); - -// Secrets Create, Update, Get -Console.WriteLine("Creating and updating a secret"); -var secretResponse = bitwardenClient.Secrets.Create(organizationId, "New Secret", "the secret value", "the secret note", new[] { projectResponse.Id }); -secretResponse = bitwardenClient.Secrets.Update(organizationId, secretResponse.Id, "New Secret Name", "the secret value", "the secret note", new[] { projectResponse.Id }); -secretResponse = bitwardenClient.Secrets.Get(secretResponse.Id); -Console.WriteLine("Here is the secret we created and updated:"); -Console.WriteLine(secretResponse.Key); - -Console.Write("Press enter to continue..."); -Console.ReadLine(); - -// Secrets GetByIds -var secretsResponse = bitwardenClient.Secrets.GetByIds(new[] { secretResponse.Id }); - -// Secrets Sync -var syncResponse = bitwardenClient.Secrets.Sync(organizationId, null); - -// Secrets & Projects Delete -Console.WriteLine("Deleting our secret and project"); -bitwardenClient.Secrets.Delete(new[] { secretResponse.Id }); -bitwardenClient.Projects.Delete(new[] { projectResponse.Id }); diff --git a/languages/csharp/Bitwarden.Sdk/AuthClient.cs b/languages/csharp/Bitwarden.Sdk/AuthClient.cs deleted file mode 100644 index e801f2ae..00000000 --- a/languages/csharp/Bitwarden.Sdk/AuthClient.cs +++ /dev/null @@ -1,21 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class AuthClient -{ - private readonly CommandRunner _commandRunner; - - internal AuthClient(CommandRunner commandRunner) - { - _commandRunner = commandRunner; - } - - public void LoginAccessToken(string accessToken, string stateFile = "") - { - var command = new Command { LoginAccessToken = new AccessTokenLoginRequest { AccessToken = accessToken, StateFile = stateFile } }; - var response = _commandRunner.RunCommand(command); - if (response is not { Success: true }) - { - throw new BitwardenAuthException(response != null ? response.ErrorMessage : "Login failed"); - } - } -} diff --git a/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj b/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj deleted file mode 100644 index a7c82e4b..00000000 --- a/languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - net6.0 - enable - enable - Bitwarden.Sdk - - Bitwarden Secrets Manager SDK - Bitwarden Inc. - .NET bindings for interacting with the Bitwarden Secrets Manager - Bitwarden Inc. - SDK - - https://github.com/bitwarden/sdk/tree/main/languages/csharp - Git - - https://bitwarden.com/products/secrets-manager/ - Bitwarden.Secrets.Sdk - bitwarden.png - Bitwarden;Secrets Manager;Sdk;.NET - README.md - LICENSE.txt - 0.1.0 - - - - - - - - - - - - - - - 4 - - - - Always - true - - - Always - true - - - Always - true - - - - - Always - true - runtimes/osx-x64/native - - - Always - true - runtimes/osx-arm64/native - - - Always - true - runtimes/linux-x64/native - - - Always - true - runtimes/win-x64/native - - - \ No newline at end of file diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenAuthException.cs b/languages/csharp/Bitwarden.Sdk/BitwardenAuthException.cs deleted file mode 100644 index 7bb9f873..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenAuthException.cs +++ /dev/null @@ -1,13 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class BitwardenAuthException : Exception -{ - public BitwardenAuthException(string message) : base(message) - { - } - - public BitwardenAuthException(string message, Exception innerException) - : base(message, innerException) - { - } -} diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenClient.cs b/languages/csharp/Bitwarden.Sdk/BitwardenClient.cs deleted file mode 100644 index 2f10e0cf..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenClient.cs +++ /dev/null @@ -1,31 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public sealed class BitwardenClient : IDisposable -{ - private readonly CommandRunner _commandRunner; - private readonly BitwardenSafeHandle _handle; - - public BitwardenClient(BitwardenSettings? settings = null) - { - var clientSettings = new ClientSettings - { - ApiUrl = settings?.ApiUrl!, - IdentityUrl = settings?.IdentityUrl!, - UserAgent = "Bitwarden DOTNET-SDK" - }; - - _handle = BitwardenLibrary.Init(clientSettings.ToJson()); - _commandRunner = new CommandRunner(_handle); - Projects = new ProjectsClient(_commandRunner); - Secrets = new SecretsClient(_commandRunner); - Auth = new AuthClient(_commandRunner); - } - - public ProjectsClient Projects { get; } - - public SecretsClient Secrets { get; } - - public AuthClient Auth { get; set; } - - public void Dispose() => _handle.Dispose(); -} diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenException.cs b/languages/csharp/Bitwarden.Sdk/BitwardenException.cs deleted file mode 100644 index 1cf6abaa..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenException.cs +++ /dev/null @@ -1,13 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class BitwardenException : Exception -{ - public BitwardenException(string message) : base(message) - { - } - - public BitwardenException(string message, Exception innerException) - : base(message, innerException) - { - } -} diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenLibrary.cs b/languages/csharp/Bitwarden.Sdk/BitwardenLibrary.cs deleted file mode 100644 index ada39940..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenLibrary.cs +++ /dev/null @@ -1,21 +0,0 @@ -īģŋusing System.Runtime.InteropServices; - -namespace Bitwarden.Sdk; - -internal static class BitwardenLibrary -{ - [DllImport("bitwarden_c", CallingConvention = CallingConvention.Cdecl)] - private static extern BitwardenSafeHandle init(string settings); - - [DllImport("bitwarden_c", CallingConvention = CallingConvention.Cdecl)] - private static extern void free_mem(IntPtr handle); - - [DllImport("bitwarden_c", CallingConvention = CallingConvention.Cdecl)] - private static extern string run_command(string json, BitwardenSafeHandle handle); - - internal static BitwardenSafeHandle Init(string settings) => init(settings); - - internal static void FreeMemory(IntPtr handle) => free_mem(handle); - - internal static string RunCommand(string json, BitwardenSafeHandle handle) => run_command(json, handle); -} diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenSafeHandle.cs b/languages/csharp/Bitwarden.Sdk/BitwardenSafeHandle.cs deleted file mode 100644 index 7939aab6..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenSafeHandle.cs +++ /dev/null @@ -1,17 +0,0 @@ -īģŋusing Microsoft.Win32.SafeHandles; - -namespace Bitwarden.Sdk; - -internal class BitwardenSafeHandle : SafeHandleZeroOrMinusOneIsInvalid -{ - public BitwardenSafeHandle() : base(true) - { - SetHandle(handle); - } - - protected override bool ReleaseHandle() - { - BitwardenLibrary.FreeMemory(handle); - return true; - } -} diff --git a/languages/csharp/Bitwarden.Sdk/BitwardenSettings.cs b/languages/csharp/Bitwarden.Sdk/BitwardenSettings.cs deleted file mode 100644 index a7ccdcd2..00000000 --- a/languages/csharp/Bitwarden.Sdk/BitwardenSettings.cs +++ /dev/null @@ -1,14 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class BitwardenSettings -{ - /// - /// The api url of the targeted Bitwarden instance. Defaults to `https://api.bitwarden.com` - /// - public string? ApiUrl { get; set; } - - /// - /// The identity url of the targeted Bitwarden instance. Defaults to `https://identity.bitwarden.com` - /// - public string? IdentityUrl { get; set; } -} diff --git a/languages/csharp/Bitwarden.Sdk/CommandRunner.cs b/languages/csharp/Bitwarden.Sdk/CommandRunner.cs deleted file mode 100644 index fbd6b7e3..00000000 --- a/languages/csharp/Bitwarden.Sdk/CommandRunner.cs +++ /dev/null @@ -1,20 +0,0 @@ -īģŋusing System.Text.Json; - -namespace Bitwarden.Sdk; - -internal class CommandRunner -{ - private readonly BitwardenSafeHandle _handle; - - internal CommandRunner(BitwardenSafeHandle handle) - { - _handle = handle; - } - - internal T? RunCommand(Command command) - { - var req = JsonSerializer.Serialize(command, Converter.Settings); - var result = BitwardenLibrary.RunCommand(req, _handle); - return JsonSerializer.Deserialize(result, Converter.Settings); - } -} diff --git a/languages/csharp/Bitwarden.Sdk/ProjectsClient.cs b/languages/csharp/Bitwarden.Sdk/ProjectsClient.cs deleted file mode 100644 index 47a41936..00000000 --- a/languages/csharp/Bitwarden.Sdk/ProjectsClient.cs +++ /dev/null @@ -1,94 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class ProjectsClient -{ - private readonly CommandRunner _commandRunner; - - internal ProjectsClient(CommandRunner commandRunner) - { - _commandRunner = commandRunner; - } - - public ProjectResponse Get(Guid id) - { - var command = new Command { Projects = new ProjectsCommand { Get = new ProjectGetRequest { Id = id } } }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Project not found"); - } - - public ProjectResponse Create(Guid organizationId, string name) - { - var command = new Command - { - Projects = new ProjectsCommand - { - Create = new ProjectCreateRequest { OrganizationId = organizationId, Name = name } - } - }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Project create failed"); - } - - public ProjectResponse Update(Guid organizationId, Guid id, string name) - { - var command = new Command - { - Projects = new ProjectsCommand - { - Update = new ProjectPutRequest { Id = id, OrganizationId = organizationId, Name = name } - } - }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Project update failed"); - } - - public ProjectsDeleteResponse Delete(Guid[] ids) - { - var command = new Command - { - Projects = new ProjectsCommand { Delete = new ProjectsDeleteRequest { Ids = ids } } - }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Project delete failed"); - } - - public ProjectsResponse List(Guid organizationId) - { - var command = new Command - { - Projects = new ProjectsCommand { List = new ProjectsListRequest { OrganizationId = organizationId } } - }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "No projects for given organization"); - } -} diff --git a/languages/csharp/Bitwarden.Sdk/SecretsClient.cs b/languages/csharp/Bitwarden.Sdk/SecretsClient.cs deleted file mode 100644 index 5dd77fc6..00000000 --- a/languages/csharp/Bitwarden.Sdk/SecretsClient.cs +++ /dev/null @@ -1,145 +0,0 @@ -īģŋnamespace Bitwarden.Sdk; - -public class SecretsClient -{ - private readonly CommandRunner _commandRunner; - - internal SecretsClient(CommandRunner commandRunner) - { - _commandRunner = commandRunner; - } - - public SecretResponse Get(Guid id) - { - var command = new Command { Secrets = new SecretsCommand { Get = new SecretGetRequest { Id = id } } }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secret not found"); - } - - public SecretsResponse GetByIds(Guid[] ids) - { - var command = new Command { Secrets = new SecretsCommand { GetByIds = new SecretsGetRequest { Ids = ids } } }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secret not found"); - } - - public SecretResponse Create(Guid organizationId, string key, string value, string note, Guid[] projectIds) - { - var command = new Command - { - Secrets = new SecretsCommand - { - Create = new SecretCreateRequest - { - Key = key, - Value = value, - Note = note, - OrganizationId = organizationId, - ProjectIds = projectIds - } - } - }; - - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secret create failed"); - } - - public SecretResponse Update(Guid organizationId, Guid id, string key, string value, string note, Guid[] projectIds) - { - var command = new Command - { - Secrets = new SecretsCommand - { - Update = new SecretPutRequest - { - Id = id, - Key = key, - Value = value, - Note = note, - OrganizationId = organizationId, - ProjectIds = projectIds - } - } - }; - - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secret update failed"); - } - - public SecretsDeleteResponse Delete(Guid[] ids) - { - var command = new Command { Secrets = new SecretsCommand { Delete = new SecretsDeleteRequest { Ids = ids } } }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secrets delete failed"); - } - - public SecretIdentifiersResponse List(Guid organizationId) - { - var command = new Command - { - Secrets = new SecretsCommand { List = new SecretIdentifiersRequest { OrganizationId = organizationId } } - }; - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "No secrets for given organization"); - } - - public SecretsSyncResponse Sync(Guid organizationId, DateTimeOffset? lastSyncedDate) - { - var command = new Command - { - Secrets = new SecretsCommand - { - Sync = new SecretsSyncRequest - { - OrganizationId = organizationId, - LastSyncedDate = lastSyncedDate - } - } - }; - - var result = _commandRunner.RunCommand(command); - - if (result is { Success: true }) - { - return result.Data; - } - - throw new BitwardenException(result != null ? result.ErrorMessage : "Secret update failed"); - } -} diff --git a/languages/csharp/Bitwarden.Sdk/bitwarden.png b/languages/csharp/Bitwarden.Sdk/bitwarden.png deleted file mode 100644 index 681629a2716a6c9fff49281850bbc4ec34cf43cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 790 zcmV+x1L^#UP)C00012P)t-s0000W zVBZ*E-y2}x7+~KRVB8m9-56cn7hT*KUECL5-4|Zn|NsB-_5I@O`_$q1#n<+?%=D~f{r0Z^)>0prOQHJG1d*d{5;3j9@7hT-w**Kg4000bhQchC<5Fju>V2_`# zzt8W9O#{6E00Lr3L_t(|+U?uTlBzHehGBFDQA~pJ6M=m9f1PJ>rnIm@D(OI6^t-q6 zOk=F6(#|Fw^P~V74;Dd`3miV7?`Qik<)jAb_m^?Z3~)GO-=71h6A7jXuJUf8{iCi0zLp#TtKT{RqzK`27rvv1^{3}0rUYFga9lHa3=%s z2EZ@?ts(>P2iPzGeW?uu;1&X)=id+t7(xK_bwe-!tv`VN1gXV3fbnUx`qrty0XXdk zpyzAH0$}h3)N0xQ9st%0;NCBe1s8zM127mhtpgu`dJV8_t-$~g!5YBb>G=!*5v&0o znw}pEfNmAw8uea>cmUWHz{9BbEaCv@fGJ?StM~K+aRC_gBB0gu`~k56aMe7(8bzuc z7y!S^a8tAzU;_&9`Wz}A4*t)uA{*c$Nq+@ak^ z>;nLLqe!L)b^`#NR+DrG>R diff --git a/languages/csharp/Bitwarden.sln b/languages/csharp/Bitwarden.sln deleted file mode 100644 index 4cf8d147..00000000 --- a/languages/csharp/Bitwarden.sln +++ /dev/null @@ -1,22 +0,0 @@ -īģŋ -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bitwarden.Sdk", "Bitwarden.Sdk\Bitwarden.Sdk.csproj", "{DADE59E5-E573-430A-8EB2-BC21D8E8C1D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bitwarden.Sdk.Samples", "Bitwarden.Sdk.Samples\Bitwarden.Sdk.Samples.csproj", "{CA9F8EDC-643F-4624-AC00-F741E1F30CA4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DADE59E5-E573-430A-8EB2-BC21D8E8C1D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DADE59E5-E573-430A-8EB2-BC21D8E8C1D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DADE59E5-E573-430A-8EB2-BC21D8E8C1D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DADE59E5-E573-430A-8EB2-BC21D8E8C1D3}.Release|Any CPU.Build.0 = Release|Any CPU - {CA9F8EDC-643F-4624-AC00-F741E1F30CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA9F8EDC-643F-4624-AC00-F741E1F30CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA9F8EDC-643F-4624-AC00-F741E1F30CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA9F8EDC-643F-4624-AC00-F741E1F30CA4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/languages/csharp/LICENSE.txt b/languages/csharp/LICENSE.txt deleted file mode 100644 index e9d496ff..00000000 --- a/languages/csharp/LICENSE.txt +++ /dev/null @@ -1,295 +0,0 @@ -BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT -Version 1, 17 March 2023 - -1. Introduction - -1.1 The Bitwarden Software Development Kit (referred to in the License Agreement -as the "SDK" and available for download at the following URL -https://github.com/bitwarden/sdk) is licensed to you subject to the terms of -this License Agreement. The License Agreement forms a legally binding contract -between you and the Company in relation to your use of the SDK. - -1.2 "Bitwarden" means the Bitwarden software made available by the Company, -available for download at the following URL, as updated from time to time. - -1.3 A "Compatible Application" means any software program or service that (i) -connects to and interoperates with a current version of the Bitwarden server -products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: -https://bitwarden.com/terms/#acceptable_use. - -1.4 "Company" means Bitwarden Inc., organized under the laws of the State of -Delaware. - -2. Accepting this License Agreement - -2.1 In order to access or use the SDK, you must first agree to the License -Agreement. You may not access or use the SDK if you do not accept the License -Agreement. - -2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to -the terms of the License Agreement. - -2.3 You may not access or use the SDK and may not accept the License Agreement -if you are a person barred from receiving the SDK under the laws of the United -States or other countries, including the country in which you are resident or -from which you access or use the SDK. - -2.4 If you are agreeing to be bound by the License Agreement on behalf of your -employer or any other entity, you represent and warrant that you have full legal -authority to bind your employer or such other entity to the License Agreement. -If you do not have the requisite authority, you may not accept the License -Agreement or you may not access or use the SDK on behalf of your employer or -other entity. - -3. SDK License from Bitwarden - -3.1 Subject to the terms of this License Agreement, Bitwarden grants you a -limited, worldwide, royalty-free, non-assignable, non-exclusive, and -non-sublicensable license to use the SDK solely (a) to develop, test, and -demonstrate a Compatible Application; (b) to develop, test, and run a Compatible -Application for personal use by your family; or (c) to to develop, test, and run -a Compatible Application for the internal business operations of your -organization in connection with a paid license for a Bitwarden server product, -provided that in no case above may the Compatible Application be offered, -licensed, or sold to a third party. - -3.2 You agree that Bitwarden or third parties own all legal right, title and -interest in and to the SDK, including any Intellectual Property Rights that -subsist in the SDK. "Intellectual Property Rights" means any and all rights -under patent law, copyright law, trade secret law, trademark law, and any and -all other proprietary rights. Bitwarden reserves all rights not expressly -granted to you. - -3.3 You may not use this SDK to develop applications for use with software other -than Bitwarden (including non-compatible implementations of Bitwarden) or to -develop another SDK. - -3.4 You may not use the SDK for any purpose not expressly permitted by the -License Agreement. Except for contributions to Bitwarden pursuant to the -Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by -applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK -or any part of the SDK. - -3.5 Use, reproduction, and distribution of a component of the SDK licensed under -an open source software license are governed solely by the terms of that open -source software license and not the License Agreement. - -3.6 You agree that the form and nature of the SDK that the Company provides may -change without prior notice to you and that future versions of the SDK may be -incompatible with applications developed on previous versions of the SDK. You -agree that the Company may stop (permanently or temporarily) providing the SDK -or any features within the SDK to you or to users generally at the Company’s -sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of the -Company’s trade names, trademarks, service marks, logos, domain names, or other -distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights -notices (including copyright and trademark notices) that may be affixed to or -contained within the SDK. - -4. Use of the SDK by You - -4.1 The Company agrees that it obtains no right, title, or interest from you (or -your licensors) under the License Agreement in or to any software applications -that you develop using the SDK, including any Intellectual Property Rights that -subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are -permitted by (a) the License Agreement and (b) any applicable law, regulation or -generally accepted practices or guidelines in the relevant jurisdictions -(including any laws regarding the export of data or software to and from the -United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for other users, -you will protect the privacy and legal rights of those users. If the users -provide you with user names, passwords, or other login information or personal -information, you must make the users aware that the information will be -available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or -sensitive information provided by users, it must do so securely. If the user -provides your application with Bitwarden Account information, your application -may only use that information to access the user's Bitwarden Account when, and -for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including -the development or distribution of an application, that interferes with, -disrupts, damages, or accesses in an unauthorized manner the servers, networks, -or other properties or services of any third party including, but not limited -to, the Company, or any mobile communications carrier or public cloud service. - -4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge -and agree that you shall retrieve data only with the user's explicit consent and -only when, and for the limited purposes for which, the user has given you -permission to do so. - -4.6 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any data, content, or resources -that you create, transmit or display through Bitwarden and/or applications for -Bitwarden, and for the consequences of your actions (including any loss or -damage which Bitwarden may suffer) by doing so. - -4.7 You agree that you are solely responsible for, and that the Company has no -responsibility to you or to any third party for, any breach of your obligations -under the License Agreement, any applicable third party contract or Terms of -Service, or any applicable law or regulation, and for the consequences -(including any loss or damage which the Company or any third party may suffer) -of any such breach. - -5. Third Party Applications - -5.1 If you use the SDK to integrate or run applications developed by a third -party or that access data, content or resources provided by a third party, you -agree that the Company is not responsible for those applications, data, content, -or resources. You understand that all data, content or resources which you may -access through such third party applications are the sole responsibility of the -person from which they originated and that the Company is not liable for any -loss or damage that you may experience as a result of the use or access of any -of those third party applications, data, content, or resources. - -5.2 You should be aware that the data, content, and resources presented to you -through such a third party application may be protected by intellectual property -rights which are owned by the providers (or by other persons or companies on -their behalf). You acknowledge that your use of such third party applications, -data, content, or resources may be subject to separate terms between you and the -relevant third party. In that case, the License Agreement does not affect your -legal relationship with these third parties. - -6. Use of Bitwarden Server - -You acknowledge and agree that the Bitwarden server products to which any -Compatible Application must connect is protected by intellectual property rights -which are owned by the Company and your use of the Bitwarden server products is -subject to additional terms not set forth in this License Agreement. - -7. Terminating this License Agreement - -7.1 The License Agreement will continue to apply until terminated by either you -or the Company as set out below. - -7.2 If you want to terminate the License Agreement, you may do so by ceasing -your use of the SDK and any relevant developer credentials. - -7.3 The Company may at any time, terminate the License Agreement with you if: - -(a) you have breached any provision of the License Agreement; or - -(b) the Company is required to do so by law; or - -(c) a third party with whom the Company offered certain parts of the SDK to you -has terminated its relationship with the Company or ceased to offer certain -parts of the SDK to either the Company or to you; or - -(d) the Company decides to no longer provide the SDK or certain parts of the SDK -to users in the country in which you are resident or from which you use the -service, or the provision of the SDK or certain SDK services to you by the -Company is, in the Company’'s sole discretion, no longer commercially viable or -technically practicable. - -7.4 When the License Agreement comes to an end, all of the legal rights, -obligations and liabilities that you and the Company have benefited from, been -subject to (or which have accrued over time whilst the License Agreement has -been in force) or which are expressed to continue indefinitely, shall be -unaffected by this cessation, and the provisions of paragraph 12.8 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -8. NO SUPPORT - -The Company is not obligated under this License Agreement to provide you any -support services for the SDK. Any support provided is at the Company’s sole -discretion and provided on an "as is" basis and without warranty of any kind. - -9. DISCLAIMER OF WARRANTIES - -9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE -RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF -ANY KIND FROM Bitwarden. - -9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED -THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY -RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF -DATA THAT RESULTS FROM SUCH USE. - -9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY -KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED -WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NON-INFRINGEMENT. - -10. LIMITATION OF LIABILITY - -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND -AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF -LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, -STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS -OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF -OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -11. Indemnification - -To the maximum extent permitted by law, you agree to defend, indemnify and hold -harmless the Company, its affiliates and their respective directors, officers, -employees and agents from and against any and all claims, actions, suits or -proceedings, as well as any and all losses, liabilities, damages, costs and -expenses (including reasonable attorneys fees) arising out of or accruing from -(a) your use of the SDK, (b) any application you develop on the SDK that -infringes any copyright, trademark, trade secret, trade dress, patent or other -intellectual property right of any person or defames any person or violates -their rights of publicity or privacy, and (c) any non-compliance by you with the -License Agreement. - -12. General Legal Terms - -12.1 The Company may make changes to the License Agreement as it distributes new -versions of the SDK. When these changes are made, the Company will make a new -version of the License Agreement available on the website where the SDK is made -available. - -12.2 The License Agreement constitutes the whole legal agreement between you and -the Company and governs your use of the SDK (excluding any services or software -which the Company may provide to you under a separate written agreement), and -completely replaces any prior agreements between you and the Company in relation -to the SDK. - -12.3 You agree that if the Company does not exercise or enforce any legal right -or remedy which is contained in the License Agreement (or which the Company has -the benefit of under any applicable law), this will not be taken to be a formal -waiver of the Company's rights and that those rights or remedies will still be -available to the Company. - -12.4 If any court of law, having the jurisdiction to decide on this matter, -rules that any provision of the License Agreement is invalid, then that -provision will be removed from the License Agreement without affecting the rest -of the License Agreement. The remaining provisions of the License Agreement will -continue to be valid and enforceable. - -12.5 You acknowledge and agree that each member of the group of companies of -which the Company is the parent shall be third party beneficiaries to the -License Agreement and that such other companies shall be entitled to directly -enforce, and rely upon, any provision of the License Agreement that confers a -benefit on them or rights in favor of them. Other than this, no other person or -company shall be third party beneficiaries to the License Agreement. - -12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND -REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND -REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON -DESTINATIONS, END USERS, AND END USE. - -12.7 The rights granted in the License Agreement may not be assigned or -transferred by either you or the Company without the prior written approval of -the other party, provided that the Company may assign this License Agreement -upon notice to you in connection with an acquisition, merger, sale of assets, or -similar corporate change in control for the Company or the Intellectual Property -Rights in the SDK. - -12.8 The License Agreement, and any dispute relating to or arising out of this -License Agreement, shall be governed by the laws of the State of California -without regard to its conflict of laws provisions. You and the Company agree to -submit to the exclusive jurisdiction of the courts located within the county of -Los Angeles, California to resolve any dispute or legal matter arising from the -License Agreement. Notwithstanding this, you agree that the Company shall be -allowed to apply for injunctive remedies, or any equivalent type of urgent legal -relief, in any forum or jurisdiction. diff --git a/languages/csharp/README.md b/languages/csharp/README.md deleted file mode 100644 index ece863fa..00000000 --- a/languages/csharp/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Bitwarden Secrets Manager SDK - -.NET bindings for interacting with the [Bitwarden Secrets Manager]. This is a beta release and might be missing some functionality. - -## Create access token - -Review the help documentation on [Access Tokens] - -## Usage code snippets - -### Create new Bitwarden client - -```csharp -const string accessToken = ""; -const string stateFile = ""; - -using var bitwardenClient = new BitwardenClient(new BitwardenSettings -{ - ApiUrl = apiUrl, - IdentityUrl = identityUrl -}); - -bitwardenClient.LoginAccessToken(accessToken, stateFile); -``` - -### Create new project - -```csharp -var organizationId = Guid.Parse(""); -var projectResponse = bitwardenClient.Projects().Create(organizationId, "TestProject"); -``` - -### List all projects - -```csharp -var response = bitwardenClient.Projects.List(organizationId); -``` - -### Update project - -```csharp -var projectId = projectResponse.Id; -projectResponse = bitwardenClient.Projects.Get(projectId); -projectResponse = bitwardenClient.Projects.Update(organizationId, projectId, "TestProjectUpdated"); -``` - -### Add new secret - -```csharp -var key = "key"; -var value = "value"; -var note = "note"; -var secretResponse = bitwardenClient.Secrets.Create(organizationId, key, value, note, new[] { projectId }); -``` - -### Update secret -```csharp -var secretId = secretResponse.Id; -secretResponse = bitwardenClient.Secrets.Get(secretId); -secretResponse = bitwardenClient.Secrets.Update(organizationId, secretId, "key2", "value2", "note2", new[] { projectId }); -``` - -### Secret GetByIds - -```csharp -var secretsResponse = bitwardenClient.Secrets.GetByIds(new[] { secretResponse.Id }); -``` - -### List secrets - -```csharp -var secretIdentifiersResponse = bitwardenClient.Secrets.List(organizationId); -``` - -### Sync secrets - -```csharp -var syncResponse = bitwardenClient.Secrets.Sync(organizationId, null); -``` - -# Delete secret or project - -```csharp -bitwardenClient.Secrets.Delete(new [] { secretId }); -bitwardenClient.Projects.Delete(new [] { projectId }); -``` - -[Access Tokens]: https://bitwarden.com/help/access-tokens/ -[Bitwarden Secrets Manager]: https://bitwarden.com/products/secrets-manager/ diff --git a/languages/csharp/global.json b/languages/csharp/global.json deleted file mode 100644 index 391ba3c2..00000000 --- a/languages/csharp/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "sdk": { - "version": "8.0.100", - "rollForward": "latestFeature" - } -} diff --git a/languages/go/.version b/languages/go/.version deleted file mode 100644 index e6d5cb83..00000000 --- a/languages/go/.version +++ /dev/null @@ -1 +0,0 @@ -1.0.2 \ No newline at end of file diff --git a/languages/go/INSTRUCTIONS.md b/languages/go/INSTRUCTIONS.md deleted file mode 100644 index 1c970247..00000000 --- a/languages/go/INSTRUCTIONS.md +++ /dev/null @@ -1,150 +0,0 @@ -# Instructions - -This guide is for developers who want to use the Bitwarden Go SDK module in their own Go projects. Please see the main [README](./README.md) and [example.go](./example/example.go) file for examples. - -## Supported Targets - -The Bitwarden Go SDK module utilizes FFI calls to the Bitwarden Rust SDK via [cgo](https://pkg.go.dev/cmd/cgo). The module supports the following statically linked targets: - -- Linux `x86-64` & `arm64` -- macOS `x86-64` & `arm64` -- Windows `x86-64` - -## Linux - -### Prerequisites - -- [Go](https://go.dev/dl) -- A C toolchain - -We recommend the [MUSL toolchain](https://musl.libc.org). You can install this on most debian based systems with: - -```shell -sudo apt install musl-tools -``` - -### Set Go Environment Info - -#### Enable cgo - -```shell -go env -w CGO_ENABLED=1 -``` - -#### Set the C compiler - -```shell -go env -w CC=musl-gcc -``` - -#### Verify -```shell -go env -``` - -### Install the Bitwarden Go SDK - -#### Adding the Module - -```shell -go get github.com/bitwarden/sdk-go -``` - -#### Build - -```shell -go build -ldflags '-linkmode external -extldflags "-static -Wl,-unresolved-symbols=ignore-all"' -``` - -## macOS - -### Prerequisites - -- [Go](https://go.dev/dl) -- A C toolchain - -[Clang](https://clang.llvm.org/get_started.html) is the default C and C++ toolchain on Mac OS. The easiest way to ensure you have the toolchain is to install the Xcode Command Line tools. - -You can install Clang with: - - -```shell -xcode-select --install -``` - -### Set Go Environment Info - -#### Enable cgo - -```shell -go env -w CGO_ENABLED=1 -``` - -#### Set the C & C++ compilers - -```shell -go env -w CC=clang CXX=clang++ -``` - -#### Verify -```shell -go env -``` - -### Install the Bitwarden Go SDK - -#### Adding the Module - -```shell -go get github.com/bitwarden/sdk-go -``` - -#### Build - -```shell -go build -``` - -## Windows - -### Prerequisites - -- [Go](https://go.dev/dl) -- [GCC](https://gcc.gnu.org) - -Go [documentation](https://go.dev/wiki/cgo) recommends the mingw-w64 gcc compiler. - -We recommend following the Visual Studio Code [guide](https://code.visualstudio.com/docs/cpp/config-mingw#_installing-the-mingww64-toolchain) for installing the mingw-w64 toolchain. - -### Set Go Environment Info - -#### Enable cgo - -```shell -go env -w CGO_ENABLED=1 -``` - -#### Set the C & C++ compilers - -```shell -go env -w CC=gcc CXX=g++ -``` - -#### Verify -```shell -go env -``` - -### Install the Bitwarden Go SDK - -#### Adding the Module - -```shell -go get github.com/bitwarden/sdk-go -``` - -#### Build - -```shell -go build -``` diff --git a/languages/go/README.md b/languages/go/README.md deleted file mode 100644 index 8332f5dc..00000000 --- a/languages/go/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# Bitwarden SDK in Go - -This SDK is designed to interact with Bitwarden services in Go. It includes implementations for -managing projects and secrets, as well as a client interface to facilitate operations like login. - -## Prerequisites - -- Go installed -- C environment to run CGO - -## Installation - -Follow the installation instructions [here](./INSTRUCTIONS.md). - -## Table of Contents - -- [Initialization](#initialization) -- [Login](#login) -- [Projects](#projects) -- [Secrets](#secrets) -- [Close Client](#close-client) - ---- - -### Initialization - -To initialize the client, you need to import the SDK and create a new `BitwardenClient` instance. - -```go -import "github.com/bitwarden/sdk-go" - -bitwardenClient, _ := sdk.NewBitwardenClient(&apiURL, &identityURL) -``` - ---- - -### Login - -To login using an access token. Define some `stateFile` and pass it to use state, or pass `nil` -instead to not use state. - -```go -stateFile := os.Getenv("STATE_FILE") - -err := bitwardenClient.AccessTokenLogin(accessToken, &stateFile) -``` - ---- - -### Projects - -#### Create a Project - -```go -project, err := bitwardenClient.Projects().Create("organization_id", "project_name") -``` - -#### List Projects - -```go -projects, err := bitwardenClient.Projects().List("organization_id") -``` - -#### Get a Project - -```go -project, err := bitwardenClient.Projects().Get("project_id") -``` - -#### Update a Project - -```go -project, err := bitwardenClient.Projects().Update("project_id", "organization_id", "new_project_name") -``` - -#### Delete Projects - -```go -project, err := bitwardenClient.Projects().Delete([]string{"project_id_1", "project_id_2"}) -``` - ---- - -### Secrets - -#### Create a Secret - -```go -secret, err := bitwardenClient.Secrets().Create("key", "value", "note", "organization_id", []string{"project_id"}) -``` - -#### List Secrets - -```go -secrets, err := bitwardenClient.Secrets().List("organization_id") -``` - -#### Get a Secret - -```go -secret, err := bitwardenClient.Secrets().Get("secret_id") -``` - -#### Get Multiple Secrets by IDs - -```go -secrets, err := bitwardenClient.Secrets().GetByIDS([]string{"secret_ids"}) -``` - -#### Update a Secret - -```go -secret, err := bitwardenClient.Secrets().Update("secret_id", "new_key", "new_value", "new_note", "organization_id", []string{"project_id"}) -``` - -#### Delete Secrets - -```go -secret, err := bitwardenClient.Secrets().Delete([]string{"secret_id_1", "secret_id_2"}) -``` - -#### Secrets Sync - -```go -secretsSync, err := bitwardenClient.Secrets().Sync("organization_id", nil) - -lastSyncedDate := time.Now() -secretsSync, err = bitwardenClient.Secrets().Sync("organization_id", lastSyncedDate) -``` - ---- - -### Close Client - -To free up resources: - -```go -defer bitwardenClient.Close() -``` - ---- - -For more detailed information, refer to the code comments and method signatures. diff --git a/languages/go/bitwarden_client.go b/languages/go/bitwarden_client.go deleted file mode 100644 index 121eda0a..00000000 --- a/languages/go/bitwarden_client.go +++ /dev/null @@ -1,85 +0,0 @@ -package sdk - -import ( - "encoding/json" - - "github.com/bitwarden/sdk-go/internal/cinterface" -) - -type BitwardenClientInterface interface { - AccessTokenLogin(accessToken string, stateFile *string) error - Projects() ProjectsInterface - Secrets() SecretsInterface - Generators() GeneratorsInterface - Close() -} - -type BitwardenClient struct { - client cinterface.ClientPointer - lib cinterface.BitwardenLibrary - commandRunner CommandRunnerInterface - projects ProjectsInterface - secrets SecretsInterface - generators GeneratorsInterface -} - -func NewBitwardenClient(apiURL *string, identityURL *string) (BitwardenClientInterface, error) { - deviceType := DeviceType("SDK") - userAgent := "Bitwarden GOLANG-SDK" - clientSettings := ClientSettings{ - APIURL: apiURL, - IdentityURL: identityURL, - UserAgent: &userAgent, - DeviceType: &deviceType, - } - - settingsJSON, err := json.Marshal(clientSettings) - if err != nil { - return nil, err - } - - lib := cinterface.NewBitwardenLibrary() - client, err := lib.Init(string(settingsJSON)) - if err != nil { - return nil, err - } - runner := NewCommandRunner(client, lib) - - return &BitwardenClient{ - lib: lib, - client: client, - commandRunner: runner, - projects: NewProjects(runner), - secrets: NewSecrets(runner), - generators: NewGenerators(runner), - }, nil -} - -func (c *BitwardenClient) AccessTokenLogin(accessToken string, stateFile *string) error { - req := AccessTokenLoginRequest{AccessToken: accessToken, StateFile: stateFile} - command := Command{LoginAccessToken: &req} - - responseStr, err := c.commandRunner.RunCommand(command) - if err != nil { - return err - } - - var response APIKeyLoginResponse - return checkSuccessAndError(responseStr, &response) -} - -func (c *BitwardenClient) Projects() ProjectsInterface { - return c.projects -} - -func (c *BitwardenClient) Secrets() SecretsInterface { - return c.secrets -} - -func (c *BitwardenClient) Generators() GeneratorsInterface { - return c.generators -} - -func (c *BitwardenClient) Close() { - c.lib.FreeMem(c.client) -} diff --git a/languages/go/command_runner.go b/languages/go/command_runner.go deleted file mode 100644 index 1bbe09aa..00000000 --- a/languages/go/command_runner.go +++ /dev/null @@ -1,37 +0,0 @@ -package sdk - -import ( - "encoding/json" - - "github.com/bitwarden/sdk-go/internal/cinterface" -) - -type CommandRunnerInterface interface { - RunCommand(command Command) (string, error) -} - -type CommandRunner struct { - client cinterface.ClientPointer - lib cinterface.BitwardenLibrary -} - -func NewCommandRunner(client cinterface.ClientPointer, lib cinterface.BitwardenLibrary) *CommandRunner { - return &CommandRunner{ - client: client, - lib: lib, - } -} - -func (c *CommandRunner) RunCommand(command Command) (string, error) { - commandJSON, err := json.Marshal(command) - if err != nil { - return "", err - } - - responseStr, err := c.lib.RunCommand(string(commandJSON), c.client) - if err != nil { - return "", err - } - - return responseStr, nil -} diff --git a/languages/go/example/example.go b/languages/go/example/example.go deleted file mode 100644 index 06cfcd48..00000000 --- a/languages/go/example/example.go +++ /dev/null @@ -1,137 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "log" - "os" - - sdk "github.com/bitwarden/sdk-go" - "github.com/gofrs/uuid" -) - -func main() { - // Configuring the URLS is optional, set them to nil to use the default values - apiURL := os.Getenv("API_URL") - identityURL := os.Getenv("IDENTITY_URL") - - bitwardenClient, _ := sdk.NewBitwardenClient(&apiURL, &identityURL) - - accessToken := os.Getenv("ACCESS_TOKEN") - organizationIDStr := os.Getenv("ORGANIZATION_ID") - projectName := os.Getenv("PROJECT_NAME") - - // Configuring the stateFile is optional, pass nil - // in AccessTokenLogin() to not use state - stateFile := os.Getenv("STATE_FILE") - - if projectName == "" { - projectName = "NewTestProject" // default value - } - - err := bitwardenClient.AccessTokenLogin(accessToken, &stateFile) - if err != nil { - panic(err) - } - - organizationID, err := uuid.FromString(organizationIDStr) - if err != nil { - panic(err) - } - - project, err := bitwardenClient.Projects().Create(organizationID.String(), projectName) - if err != nil { - panic(err) - } - fmt.Println(project) - projectID := project.ID - fmt.Println(projectID) - - if _, err = bitwardenClient.Projects().List(organizationID.String()); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Projects().Get(projectID); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Projects().Update(projectID, organizationID.String(), projectName+"2"); err != nil { - panic(err) - } - - key := "key" - value := "value" - note := "note" - - secret, err := bitwardenClient.Secrets().Create(key, value, note, organizationID.String(), []string{projectID}) - if err != nil { - panic(err) - } - secretID := secret.ID - - if _, err = bitwardenClient.Secrets().List(organizationID.String()); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Secrets().Get(secretID); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Secrets().Update(secretID, key, value, note, organizationID.String(), []string{projectID}); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Secrets().Delete([]string{secretID}); err != nil { - panic(err) - } - - if _, err = bitwardenClient.Projects().Delete([]string{projectID}); err != nil { - panic(err) - } - - secretIdentifiers, err := bitwardenClient.Secrets().List(organizationID.String()) - if err != nil { - panic(err) - } - - // Get secrets with a list of IDs - secretIDs := make([]string, len(secretIdentifiers.Data)) - for i, identifier := range secretIdentifiers.Data { - secretIDs[i] = identifier.ID - } - - secrets, err := bitwardenClient.Secrets().GetByIDS(secretIDs) - if err != nil { - log.Fatalf("Error getting secrets: %v", err) - } - - jsonSecrets, err := json.MarshalIndent(secrets, "", " ") - if err != nil { - log.Fatalf("Error marshalling secrets to JSON: %v", err) - } - - fmt.Println(string(jsonSecrets)) - - // Generate a password which can be used as a secret value - request := sdk.PasswordGeneratorRequest{ - AvoidAmbiguous: true, - Length: 64, - Lowercase: true, - MinLowercase: new(int64), - MinNumber: new(int64), - MinSpecial: new(int64), - MinUppercase: new(int64), - Numbers: true, - Special: true, - Uppercase: true, - } - password, err := bitwardenClient.Generators().GeneratePassword(request) - - if err != nil { - panic(err) - } - - fmt.Println(*password) - - defer bitwardenClient.Close() -} diff --git a/languages/go/example/go.mod b/languages/go/example/go.mod deleted file mode 100644 index cb09b706..00000000 --- a/languages/go/example/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module example - -replace github.com/bitwarden/sdk-go => ../ - -go 1.21 - -require ( - github.com/bitwarden/sdk-go v0.0.0-00010101000000-000000000000 - github.com/gofrs/uuid v4.4.0+incompatible -) diff --git a/languages/go/example/go.sum b/languages/go/example/go.sum deleted file mode 100644 index c0ad6873..00000000 --- a/languages/go/example/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= diff --git a/languages/go/generators.go b/languages/go/generators.go deleted file mode 100644 index 8d72c9aa..00000000 --- a/languages/go/generators.go +++ /dev/null @@ -1,35 +0,0 @@ -package sdk - -type GeneratorsInterface interface { - GeneratePassword(request PasswordGeneratorRequest) (*string, error) -} - -type Generators struct { - CommandRunner CommandRunnerInterface -} - -func NewGenerators(commandRunner CommandRunnerInterface) *Generators { - return &Generators{CommandRunner: commandRunner} -} - -func (s *Generators) executeCommand(command Command, target interface{}) error { - responseStr, err := s.CommandRunner.RunCommand(command) - if err != nil { - return err - } - return checkSuccessAndError(responseStr, target) -} - -func (s *Generators) GeneratePassword(request PasswordGeneratorRequest) (*string, error) { - command := Command{ - Generators: &GeneratorsCommand{ - GeneratePassword: request, - }, - } - - var response string - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} diff --git a/languages/go/go.mod b/languages/go/go.mod deleted file mode 100644 index ae9f5011..00000000 --- a/languages/go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/bitwarden/sdk-go - -go 1.21 diff --git a/languages/go/go.sum b/languages/go/go.sum deleted file mode 100644 index e69de29b..00000000 diff --git a/languages/go/internal/cinterface/bitwarden_library.go b/languages/go/internal/cinterface/bitwarden_library.go deleted file mode 100644 index 69d75271..00000000 --- a/languages/go/internal/cinterface/bitwarden_library.go +++ /dev/null @@ -1,58 +0,0 @@ -package cinterface - -import ( - "fmt" - "unsafe" -) - -/* -#cgo LDFLAGS: -lbitwarden_c -#cgo linux,amd64 LDFLAGS: -L ./lib/linux-x64 -#cgo linux,arm64 LDFLAGS: -L ./lib/linux-arm64 -#cgo darwin,amd64 LDFLAGS: -L ./lib/darwin-x64 -framework Security -framework SystemConfiguration -#cgo darwin,arm64 LDFLAGS: -L ./lib/darwin-arm64 -framework Security -framework SystemConfiguration -#cgo windows,amd64 LDFLAGS: -L ./lib/windows-x64 -lbitwarden_c -ladvapi32 -lbcrypt -lcrypt32 -lcryptnet -lkernel32 -lncrypt -lntdll -luserenv -lws2_32 -lmsvcrt -loleaut32 -lruntimeobject -#include -typedef void* ClientPtr; -extern char* run_command(const char *command, ClientPtr client); -extern ClientPtr init(const char *clientSettings); -extern void free_mem(ClientPtr client); -*/ -import "C" - -type ClientPointer struct { - Pointer C.ClientPtr -} - -type BitwardenLibrary interface { - Init(clientSettings string) (ClientPointer, error) - FreeMem(client ClientPointer) - RunCommand(command string, client ClientPointer) (string, error) -} - -type BitwardenLibraryImpl struct{} - -func NewBitwardenLibrary() BitwardenLibrary { - return &BitwardenLibraryImpl{} -} - -func (b *BitwardenLibraryImpl) Init(clientSettings string) (ClientPointer, error) { - ptr := C.init(C.CString(clientSettings)) - if ptr == nil { - return ClientPointer{}, fmt.Errorf("initialization failed") - } - return ClientPointer{Pointer: ptr}, nil -} - -func (b *BitwardenLibraryImpl) FreeMem(client ClientPointer) { - C.free_mem(client.Pointer) -} - -func (b *BitwardenLibraryImpl) RunCommand(command string, client ClientPointer) (string, error) { - cstr := C.run_command(C.CString(command), client.Pointer) - if cstr == nil { - return "", fmt.Errorf("run command failed") - } - defer C.free(unsafe.Pointer(cstr)) - return C.GoString(cstr), nil -} diff --git a/languages/go/project.go b/languages/go/project.go deleted file mode 100644 index 24a30a7a..00000000 --- a/languages/go/project.go +++ /dev/null @@ -1,107 +0,0 @@ -package sdk - -type ProjectsInterface interface { - Create(organizationID string, name string) (*ProjectResponse, error) - List(organizationID string) (*ProjectsResponse, error) - Get(projectID string) (*ProjectResponse, error) - Update(projectID string, organizationID string, name string) (*ProjectResponse, error) - Delete(projectIDs []string) (*ProjectsDeleteResponse, error) -} - -type Projects struct { - CommandRunner CommandRunnerInterface -} - -func NewProjects(commandRunner CommandRunnerInterface) *Projects { - return &Projects{CommandRunner: commandRunner} -} - -func (p *Projects) Get(id string) (*ProjectResponse, error) { - command := Command{ - Projects: &ProjectsCommand{ - Get: &ProjectGetRequest{ - ID: id, - }, - }, - } - var response ProjectResponse - if err := p.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (p *Projects) Create(organizationID string, name string) (*ProjectResponse, error) { - command := Command{ - Projects: &ProjectsCommand{ - Create: &ProjectCreateRequest{ - OrganizationID: organizationID, - Name: name, - }, - }, - } - - var response ProjectResponse - if err := p.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (p *Projects) List(organizationID string) (*ProjectsResponse, error) { - command := Command{ - Projects: &ProjectsCommand{ - List: &ProjectsListRequest{ - OrganizationID: organizationID, - }, - }, - } - - var response ProjectsResponse - if err := p.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (p *Projects) Update(projectID, organizationID, name string) (*ProjectResponse, error) { - command := Command{ - Projects: &ProjectsCommand{ - Update: &ProjectPutRequest{ - ID: projectID, - OrganizationID: organizationID, - Name: name, - }, - }, - } - - var response ProjectResponse - if err := p.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (p *Projects) Delete(projectIDs []string) (*ProjectsDeleteResponse, error) { - command := Command{ - Projects: &ProjectsCommand{ - Delete: &ProjectsDeleteRequest{ - IDS: projectIDs, - }, - }, - } - - var response ProjectsDeleteResponse - if err := p.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (p *Projects) executeCommand(command Command, target interface{}) error { - responseStr, err := p.CommandRunner.RunCommand(command) - if err != nil { - return err - } - return checkSuccessAndError(responseStr, target) -} diff --git a/languages/go/secrets.go b/languages/go/secrets.go deleted file mode 100644 index 825a0f10..00000000 --- a/languages/go/secrets.go +++ /dev/null @@ -1,151 +0,0 @@ -package sdk - -import "time" - -type SecretsInterface interface { - Create(key, value, note string, organizationID string, projectIDs []string) (*SecretResponse, error) - List(organizationID string) (*SecretIdentifiersResponse, error) - Get(secretID string) (*SecretResponse, error) - GetByIDS(secretIDs []string) (*SecretsResponse, error) - Update(secretID string, key, value, note string, organizationID string, projectIDs []string) (*SecretResponse, error) - Delete(secretIDs []string) (*SecretsDeleteResponse, error) - Sync(organizationID string, lastSyncedDate *time.Time) (*SecretsSyncResponse, error) -} - -type Secrets struct { - CommandRunner CommandRunnerInterface -} - -func NewSecrets(commandRunner CommandRunnerInterface) *Secrets { - return &Secrets{CommandRunner: commandRunner} -} - -func (s *Secrets) executeCommand(command Command, target interface{}) error { - responseStr, err := s.CommandRunner.RunCommand(command) - if err != nil { - return err - } - return checkSuccessAndError(responseStr, target) -} - -func (s *Secrets) Create(key, value, note string, organizationID string, projectIDs []string) (*SecretResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - Create: &SecretCreateRequest{ - Key: key, - Value: value, - Note: note, - OrganizationID: organizationID, - ProjectIDS: projectIDs, - }, - }, - } - - var response SecretResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) List(organizationID string) (*SecretIdentifiersResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - List: &SecretIdentifiersRequest{ - OrganizationID: organizationID, - }, - }, - } - - var response SecretIdentifiersResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) Get(id string) (*SecretResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - Get: &SecretGetRequest{ - ID: id, - }, - }, - } - - var response SecretResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) GetByIDS(ids []string) (*SecretsResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - GetByIDS: &SecretsGetRequest{ - IDS: ids, - }, - }, - } - - var response SecretsResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) Update(id string, key, value, note string, organizationID string, projectIDs []string) (*SecretResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - Update: &SecretPutRequest{ - ID: id, - Key: key, - Value: value, - Note: note, - OrganizationID: organizationID, - ProjectIDS: projectIDs, - }, - }, - } - - var response SecretResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) Delete(ids []string) (*SecretsDeleteResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - Delete: &SecretsDeleteRequest{ - IDS: ids, - }, - }, - } - - var response SecretsDeleteResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} - -func (s *Secrets) Sync(organizationID string, lastSyncedDate *time.Time) (*SecretsSyncResponse, error) { - command := Command{ - Secrets: &SecretsCommand{ - Sync: &SecretsSyncRequest{ - OrganizationID: organizationID, - LastSyncedDate: lastSyncedDate, - }, - }, - } - - var response SecretsSyncResponse - if err := s.executeCommand(command, &response); err != nil { - return nil, err - } - return &response, nil -} diff --git a/languages/go/util.go b/languages/go/util.go deleted file mode 100644 index 01ab3578..00000000 --- a/languages/go/util.go +++ /dev/null @@ -1,33 +0,0 @@ -package sdk - -import ( - "encoding/json" - "fmt" -) - -func checkSuccessAndError(responseStr string, v interface{}) error { - var wrapper struct { - Success bool `json:"success"` - ErrorMessage *string `json:"errorMessage"` - Data *json.RawMessage `json:"data"` - } - - err := json.Unmarshal([]byte(responseStr), &wrapper) - if err != nil { - return fmt.Errorf("failed to unmarshal wrapper response: %v", err) - } - - if !wrapper.Success { - if wrapper.ErrorMessage != nil { - return fmt.Errorf("API error: %s", *wrapper.ErrorMessage) - } - return fmt.Errorf("API error: unknown") - } - - err = json.Unmarshal(*wrapper.Data, &v) - if err != nil { - return fmt.Errorf("failed to unmarshal response: %v", err) - } - - return nil -} diff --git a/languages/java/.gitignore b/languages/java/.gitignore deleted file mode 100644 index b5b6c569..00000000 --- a/languages/java/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -target -.gradle -src/main/resources diff --git a/languages/java/INSTALL.md b/languages/java/INSTALL.md deleted file mode 100644 index 73e47474..00000000 --- a/languages/java/INSTALL.md +++ /dev/null @@ -1,52 +0,0 @@ -# Java build - -## Introduction - -Gradle is used to build Java Bitwarden client library. - -The output of the build is placed in `build/libs` directory and should contain `BitwardenSDK.jar` file. - -## Prerequisites - -- JDK 17 installed. -- Bitwarden SDK native library build. See [SDK README.md](../../README.md) for instructions. - -## Build Commands - -```shell -./gradlew build -``` - -## Example - -### macOS - -#### Install Prerequisites - -Use brew to install JDK 17. - -```shell -brew install --cask temurin@17 -brew install jenv -export PATH="$HOME/.jenv/bin:$PATH" -eval "$(jenv init -)" -jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home -jenv shell 17 -``` - -#### Build Commands - -```shell -./gradlew build -``` - -## Example SDK Usage Project - -```shell -export ACCESS_TOKEN="" -export ORGANIZATION_ID="" -export API_URL="https://api.bitwarden.com" -export IDENTITY_URL="https://identity.bitwarden.com" - -./gradlew :example:run -``` diff --git a/languages/java/README.md b/languages/java/README.md deleted file mode 100644 index b4db4475..00000000 --- a/languages/java/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Bitwarden Secrets Manager SDK - -Java bindings for interacting with the [Bitwarden Secrets Manager]. This is a beta release and might be missing some -functionality. - -## Create access token - -Review the help documentation on [Access Tokens] - -## Usage code snippets - -### Create new Bitwarden client - -```java -import com.bitwarden.sdk.*; -import com.bitwarden.sdk.schema.*; - -import java.lang.System; -import java.util.UUID; -import java.time.OffsetDateTime; - -String stateFile = System.getenv("STATE_FILE"); - -BitwardenSettings bitwardenSettings = new BitwardenSettings(); -bitwardenSettings.setApiUrl("https://api.bitwarden.com"); -bitwardenSettings.setIdentityUrl("https://identity.bitwarden.com"); -BitwardenClient bitwardenClient = new BitwardenClient(bitwardenSettings); -bitwardenClient.auth().loginAccessToken("", stateFile); -``` - -### Create new project - -```java -UUID organizationId = UUID.fromString(""); -var projectResponse = bitwardenClient.projects().create(organizationId, "TestProject"); -UUID projectId = projectResponse.getID(); -``` - -### Get project - -```java -var projectResponse = bitwardenClient.projects().get(projectId); -``` - -### List all projects - -```java -var projectsResponse = bitwardenClient.projects().list(organizationId); -``` - -### Update project - -```java -var projectResponse = bitwardenClient.projects().update(organizationId, projectId, "TestProjectUpdated"); -``` - -### Add new secret - -```java -String key = "key"; -String value = "value"; -String note = "note"; -var secretResponse = bitwardenClient.secrets().create(organizationId, key, value, note, new UUID[]{projectId}); -UUID secretId = secretResponse.getID(); -``` - -### Get secret - -```java -var secretResponse = bitwardenClient.secrets().get(secretId); -``` - -### Get secrets by ids - -```java -SecretsResponse secretsByIds = bitwardenClient.secrets().getByIds(new UUID[]{secretId}); -for (SecretResponse sr : secretsByIds.getData()) { - System.out.println(sr.getKey()); -} -``` - -### Update secret - -```java -var secretResponse = bitwardenClient.secrets().update(organizationId, secretId, key2, value2, note2, new UUID[]{projectId}); -``` - -### List secrets - -```java -var secretIdentifiersResponse = bitwardenClient.secrets().list(organizationId); -``` - -### Secrets sync -```java -SecretsSyncResponse syncResponse = bitwardenClient.secrets().sync(organizationId, OffsetDateTime.now()); -System.out.println("Has changes: " + syncResponse.getHasChanges()); -``` - -### Delete secret or project - -```java -bitwardenClient.secrets().delete(new UUID[]{secretId}); -bitwardenClient.projects().delete(new UUID[]{projectId}); -``` - -[Access Tokens]: https://bitwarden.com/help/access-tokens/ -[Bitwarden Secrets Manager]: https://bitwarden.com/products/secrets-manager/ diff --git a/languages/java/build.gradle b/languages/java/build.gradle deleted file mode 100644 index 52337a44..00000000 --- a/languages/java/build.gradle +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -plugins { - id 'java-library' - id 'maven-publish' -} - -repositories { - mavenLocal() - maven { - url = uri('https://repo.maven.apache.org/maven2/') - } - - dependencies { - api 'com.fasterxml.jackson.core:jackson-core:2.9.10' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.10' - api 'net.java.dev.jna:jna-platform:5.12.1' - } - - description = 'Bitwarden Secrets Manager Java SDK' - java.sourceCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - groupId = 'com.bitwarden' - artifactId = 'sdk-secrets' - - // Determine the version from the git history. - // - // PRs: use the branch name. - // Main: Grab it from `crates/bitwarden/Cargo.toml` - - def branchName = "git branch --show-current".execute().text.trim() - - if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { - version = "1.0.0" - } else { - // branchName-SNAPSHOT - version = "${branchName.replaceAll('/', '-')}-SNAPSHOT" - } - - afterEvaluate { - from components.java - } - } - } - repositories { - maven { - name = "GitHubPackages" - url = "https://maven.pkg.github.com/bitwarden/sdk" - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } - maven { - name = "OSSRH" - url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") - } - } - } - } -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -tasks.withType(Javadoc) { - options.encoding = 'UTF-8' - failOnError = false -} - -java { - withJavadocJar() - withSourcesJar() -} - -jar { - // Copy native library to jar resources for local gradle build - if (System.getenv("GITHUB_TOKEN") == null) { - from('../../target/debug') { - include '*libbitwarden_c*.dylib' - into "darwin-x86-64" - } - from('../../target/debug') { - include '*libbitwarden_c*.dylib' - into "darwin-aarch64" - } - from('../../target/debug') { - include '*libbitwarden_c*.so' - into "linux-x86-64" - } - from('../../target/debug') { - include '*bitwarden_c*.dll' - into "win32-x86-64" - } - } -} - diff --git a/languages/java/example/Example.java b/languages/java/example/Example.java deleted file mode 100644 index cc34c2a2..00000000 --- a/languages/java/example/Example.java +++ /dev/null @@ -1,73 +0,0 @@ -import java.lang.System; -import java.util.UUID; -import java.time.OffsetDateTime; - -import com.bitwarden.sdk.*; -import com.bitwarden.sdk.schema.*; - -class Example { - public static void main(String[] args) { - if (!System.getenv().containsKey("ACCESS_TOKEN") || !System.getenv().containsKey("ORGANIZATION_ID")) { - System.err.println("Missing environment variable ACCESS_TOKEN or ORGANIZATION_ID"); - System.exit(1); - } - - String accessToken = System.getenv("ACCESS_TOKEN"); - UUID organizationId = UUID.fromString(System.getenv("ORGANIZATION_ID")); - - String apiUrl = System.getenv("API_URL"); - String identityUrl = System.getenv("IDENTITY_URL"); - String stateFile = System.getenv("STATE_FILE"); - - // Configuring the URLS is optional, remove them to use the default values - BitwardenSettings bitwardenSettings = new BitwardenSettings(); - bitwardenSettings.setApiUrl(apiUrl); - bitwardenSettings.setIdentityUrl(identityUrl); - - try (BitwardenClient client = new BitwardenClient(bitwardenSettings)) { - client.auth().loginAccessToken(accessToken, stateFile); - - ProjectResponse project = client.projects().create(organizationId, "Test Project from Java SDK"); - System.out.println("Project CREATE, id: " + project.getID()); - - project = client.projects().get(project.getID()); - System.out.println("Project GET, id: " + project.getID()); - - ProjectsResponse projects = client.projects().list(organizationId); - System.out.println("Projects LIST, count: " + projects.getData().length); - - client.projects().update(organizationId, project.getID(), "Updated Test Project"); - project = client.projects().get(project.getID()); - System.out.println("Project UPDATE, new name: " + project.getName()); - - SecretResponse secret = client.secrets().create(organizationId, "Secret Key", "Secret Value", "Secret Note", new UUID[]{project.getID()}); - System.out.println("Secret CREATE, id: " + secret.getID()); - - secret = client.secrets().get(secret.getID()); - System.out.println("Secret GET, id: " + secret.getID()); - - SecretIdentifiersResponse secrets = client.secrets().list(organizationId); - System.out.println("Secrets LIST, count: " + secrets.getData().length); - - client.secrets().update(organizationId, secret.getID(), "Updated Key", "Updated Value", "Updated Note", new UUID[]{project.getID()}); - secret = client.secrets().get(secret.getID()); - System.out.println("Secret UPDATE, new key: " + secret.getKey()); - - SecretsResponse secretsByIds = client.secrets().getByIds(new UUID[]{secret.getID()}); - System.out.println("Getting secrets by ids, here are the keys of the retrieved secrets..."); - for (SecretResponse sr : secretsByIds.getData()) { - System.out.println(" " + sr.getKey()); - } - - SecretsSyncResponse syncResponse = client.secrets().sync(organizationId, OffsetDateTime.now()); - System.out.println("Running a secrets sync request based on the current time..."); - System.out.println("Has changes: " + syncResponse.getHasChanges()); - - System.out.println("Deleting the created secret and project..."); - client.secrets().delete(new UUID[]{secret.getID()}); - client.projects().delete(new UUID[]{project.getID()}); - - System.out.println("Execution complete."); - } - } -} diff --git a/languages/java/example/build.gradle b/languages/java/example/build.gradle deleted file mode 100644 index 73025e50..00000000 --- a/languages/java/example/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'application' -} - -repositories { - mavenLocal() - mavenCentral() -} - -dependencies { - implementation rootProject -} - -application { - mainClass = 'Example' -} - -sourceSets { - main { - java.srcDirs += '.' - } -} - diff --git a/languages/java/gradle/wrapper/gradle-wrapper.jar b/languages/java/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7f93135c49b765f8051ef9d0a6055ff8e46073d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63721 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鯊%1Et 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⁢ zv5o9#E7!G0XmdzfsS{efPNi`1b44~SZ4Z8fuX!I}#8g+(wxzQwUT#Xb2(tbY1+EUhGKoT@KEU9Ktl>_0 z%bjDJg;#*gtJZv!-Zs`?^}v5eKmnbjqlvnSzE@_SP|LG_PJ6CYU+6zY6>92%E+ z=j@TZf-iW4(%U{lnYxQA;7Q!b;^brF8n0D>)`q5>|WDDXLrqYU_tKN2>=#@~OE7grMnNh?UOz-O~6 z6%rHy{#h9K0AT+lDC7q4{hw^|q6*Ry;;L%Q@)Ga}$60_q%D)rv(CtS$CQbpq9|y1e zRSrN4;$Jyl{m5bZw`$8TGvb}(LpY{-cQ)fcyJv7l3S52TLXVDsphtv&aPuDk1OzCA z4A^QtC(!11`IsNx_HnSy?>EKpHJWT^wmS~hc^p^zIIh@9f6U@I2 zC=Mve{j2^)mS#U$e{@Q?SO6%LDsXz@SY+=cK_QMmXBIU)j!$ajc-zLx3V60EXJ!qC zi<%2x8Q24YN+&8U@CIlN zrZkcT9yh%LrlGS9`G)KdP(@9Eo-AQz@8GEFWcb7U=a0H^ZVbLmz{+&M7W(nXJ4sN8 zJLR7eeK(K8`2-}j(T7JsO`L!+CvbueT%izanm-^A1Dn{`1Nw`9P?cq;7no+XfC`K(GO9?O^5zNIt4M+M8LM0=7Gz8UA@Z0N+lg+cX)NfazRu z5D)~HA^(u%w^cz+@2@_#S|u>GpB+j4KzQ^&Wcl9f z&hG#bCA(Yk0D&t&aJE^xME^&E-&xGHhXn%}psEIj641H+Nl-}boj;)Zt*t(4wZ5DN z@GXF$bL=&pBq-#vkTkh>7hl%K5|3 z{`Vn9b$iR-SoGENp}bn4;fR3>9sA%X2@1L3aE9yTra;Wb#_`xWwLSLdfu+PAu+o3| zGVnpzPr=ch{uuoHjtw7+_!L_2;knQ!DuDl0R`|%jr+}jFzXtrHIKc323?JO{l&;VF z*L1+}JU7%QJOg|5|Tc|D8fN zJORAg=_vsy{ak|o);@)Yh8Lkcg@$FG3k@ep36BRa^>~UmnRPziS>Z=`Jb2x*Q#`%A zU*i3&Vg?TluO@X0O;r2Jl6LKLUOVhSqg1*qOt^|8*c7 zo(298@+r$k_wQNGHv{|$tW(T8L+4_`FQ{kEW5Jgg{yf7ey4ss_(SNKfz(N9lx&a;< je(UuV8hP?p&}TPdm1I$XmG#(RzlD&B2izSj9sl%y5~4qc diff --git a/languages/java/gradle/wrapper/gradle-wrapper.properties b/languages/java/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index b82aa23a..00000000 --- a/languages/java/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/languages/java/gradlew b/languages/java/gradlew deleted file mode 100755 index 0adc8e1a..00000000 --- a/languages/java/gradlew +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/sh - -# -# Copyright Š 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions ÂĢ$varÂģ, ÂĢ${var}Âģ, ÂĢ${var:-default}Âģ, ÂĢ${var+SET}Âģ, -# ÂĢ${var#prefix}Âģ, ÂĢ${var%suffix}Âģ, and ÂĢ$( cmd )Âģ; -# * compound commands having a testable exit status, especially ÂĢcaseÂģ; -# * various built-in commands including ÂĢcommandÂģ, ÂĢsetÂģ, and ÂĢulimitÂģ. -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/languages/java/gradlew.bat b/languages/java/gradlew.bat deleted file mode 100644 index 6689b85b..00000000 --- a/languages/java/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/languages/java/settings.gradle b/languages/java/settings.gradle deleted file mode 100644 index bdf7a7ed..00000000 --- a/languages/java/settings.gradle +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -rootProject.name = 'BitwardenSDK' - -include "example" diff --git a/languages/java/src/main/java/com/bitwarden/sdk/AuthClient.java b/languages/java/src/main/java/com/bitwarden/sdk/AuthClient.java deleted file mode 100644 index b4c26eb7..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/AuthClient.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.bitwarden.sdk; - -import com.bitwarden.sdk.schema.*; - -import java.util.function.Function; - -public class AuthClient { - - private final CommandRunner commandRunner; - - AuthClient(CommandRunner commandRunner) { - this.commandRunner = commandRunner; - } - - public APIKeyLoginResponse loginAccessToken(String accessToken, String stateFile) { - Command command = new Command(); - AccessTokenLoginRequest accessTokenLoginRequest = new AccessTokenLoginRequest(); - accessTokenLoginRequest.setAccessToken(accessToken); - accessTokenLoginRequest.setStateFile(stateFile); - - command.setLoginAccessToken(accessTokenLoginRequest); - - ResponseForAPIKeyLoginResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForAPIKeyLoginResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Login failed"); - } - - return response.getData(); - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java b/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java deleted file mode 100644 index bed29982..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.bitwarden.sdk; - -import com.bitwarden.sdk.schema.*; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.sun.jna.Native; -import com.sun.jna.Pointer; - -import java.util.function.Function; - -public class BitwardenClient implements AutoCloseable { - - private final Pointer client; - - private final BitwardenLibrary library; - - private final CommandRunner commandRunner; - - private boolean isClientOpen; - - private final ProjectsClient projects; - - private final SecretsClient secrets; - - private final AuthClient auth; - - public BitwardenClient(BitwardenSettings bitwardenSettings) { - ClientSettings clientSettings = new ClientSettings(); - clientSettings.setAPIURL(bitwardenSettings.getApiUrl()); - clientSettings.setIdentityURL(bitwardenSettings.getIdentityUrl()); - clientSettings.setDeviceType(DeviceType.SDK); - clientSettings.setUserAgent("Bitwarden JAVA-SDK"); - - library = Native.load("bitwarden_c", BitwardenLibrary.class); - - try { - client = library.init(Converter.ClientSettingsToJsonString(clientSettings)); - } catch (JsonProcessingException e) { - throw new BitwardenClientException("Error while processing client settings"); - } - - commandRunner = new CommandRunner(library, client); - projects = new ProjectsClient(commandRunner); - secrets = new SecretsClient(commandRunner); - auth = new AuthClient(commandRunner); - isClientOpen = true; - } - - static Function throwingFunctionWrapper(ThrowingFunction throwingFunction) { - return i -> { - try { - return throwingFunction.accept(i); - } catch (Exception ex) { - throw new BitwardenClientException("Response failed", ex); - } - }; - } - - public ProjectsClient projects() { - return projects; - } - - public SecretsClient secrets() { - return secrets; - } - - public AuthClient auth() { - return auth; - } - - @Override - public void close() { - if (isClientOpen) { - library.free_mem(client); - isClientOpen = false; - } - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClientException.java b/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClientException.java deleted file mode 100644 index e1bc9d47..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenClientException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.bitwarden.sdk; - -public class BitwardenClientException extends RuntimeException { - - public BitwardenClientException(String message) { - super(message); - } - - public BitwardenClientException(String message, Exception ex) { - super(message, ex); - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenLibrary.java b/languages/java/src/main/java/com/bitwarden/sdk/BitwardenLibrary.java deleted file mode 100644 index 73d81452..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenLibrary.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.bitwarden.sdk; - -import com.sun.jna.Library; -import com.sun.jna.Pointer; - -public interface BitwardenLibrary extends Library { - - Pointer init(String clientSettings); - - void free_mem(Pointer client); - - String run_command(String command, Pointer client); -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenSettings.java b/languages/java/src/main/java/com/bitwarden/sdk/BitwardenSettings.java deleted file mode 100644 index 7112297b..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/BitwardenSettings.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.bitwarden.sdk; - -public class BitwardenSettings { - - private String apiUrl; - - private String identityUrl; - - public BitwardenSettings() { - } - - public BitwardenSettings(String apiUrl, String identityUrl) { - this.apiUrl = apiUrl; - this.identityUrl = identityUrl; - } - - public String getApiUrl() { - return apiUrl; - } - - public void setApiUrl(String apiUrl) { - this.apiUrl = apiUrl; - } - - public String getIdentityUrl() { - return identityUrl; - } - - public void setIdentityUrl(String identityUrl) { - this.identityUrl = identityUrl; - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/CommandRunner.java b/languages/java/src/main/java/com/bitwarden/sdk/CommandRunner.java deleted file mode 100644 index 11a10081..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/CommandRunner.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.bitwarden.sdk; - -import com.bitwarden.sdk.schema.Command; -import com.bitwarden.sdk.schema.Converter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.sun.jna.Pointer; - -import java.io.IOException; -import java.util.function.Function; - -class CommandRunner { - - private final BitwardenLibrary library; - - private final Pointer client; - - CommandRunner(BitwardenLibrary library, Pointer client) { - this.library = library; - this.client = client; - } - - T runCommand(Command command, Function deserializer) { - String response = null; - - try { - response = library.run_command(commandToString(command), client); - } catch (IOException e) { - throw new RuntimeException(e); - } - - return deserializer.apply(response); - } - - private String commandToString(Command command) throws IOException { - // Removes null properties from the generated converter output to avoid command errors - String inputJson = Converter.CommandToJsonString(command); - - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - - Object inputObject = mapper.readValue(inputJson, Object.class); - return mapper.writeValueAsString(inputObject); - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/ProjectsClient.java b/languages/java/src/main/java/com/bitwarden/sdk/ProjectsClient.java deleted file mode 100644 index eb96b828..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/ProjectsClient.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.bitwarden.sdk; - -import com.bitwarden.sdk.schema.*; - -import java.util.UUID; - -public class ProjectsClient { - - private final CommandRunner commandRunner; - - ProjectsClient(CommandRunner commandRunner) { - this.commandRunner = commandRunner; - } - - public ProjectResponse get(UUID id) { - Command command = new Command(); - ProjectsCommand projectsCommand = new ProjectsCommand(); - ProjectGetRequest projectGetRequest = new ProjectGetRequest(); - projectGetRequest.setID(id); - projectsCommand.setGet(projectGetRequest); - command.setProjects(projectsCommand); - - ResponseForProjectResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForProjectResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Project not found"); - } - - return response.getData(); - } - - public ProjectResponse create(UUID organizationId, String name) { - Command command = new Command(); - ProjectsCommand projectsCommand = new ProjectsCommand(); - ProjectCreateRequest projectCreateRequest = new ProjectCreateRequest(); - projectCreateRequest.setOrganizationID(organizationId); - projectCreateRequest.setName(name); - projectsCommand.setCreate(projectCreateRequest); - command.setProjects(projectsCommand); - - ResponseForProjectResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForProjectResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Project create failed"); - } - - return response.getData(); - } - - public ProjectResponse update(UUID organizationId, UUID id, String name) { - Command command = new Command(); - ProjectsCommand projectsCommand = new ProjectsCommand(); - ProjectPutRequest projectPutRequest = new ProjectPutRequest(); - projectPutRequest.setID(id); - projectPutRequest.setOrganizationID(organizationId); - projectPutRequest.setName(name); - projectsCommand.setUpdate(projectPutRequest); - command.setProjects(projectsCommand); - - ResponseForProjectResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForProjectResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Project update failed"); - } - - return response.getData(); - } - - public ProjectsDeleteResponse delete(UUID[] ids) { - Command command = new Command(); - ProjectsCommand projectsCommand = new ProjectsCommand(); - ProjectsDeleteRequest projectsDeleteRequest = new ProjectsDeleteRequest(); - projectsDeleteRequest.setIDS(ids); - projectsCommand.setDelete(projectsDeleteRequest); - command.setProjects(projectsCommand); - - ResponseForProjectsDeleteResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForProjectsDeleteResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? - response.getErrorMessage() : "Projects update failed"); - } - - return response.getData(); - } - - public ProjectsResponse list(UUID organizationId) { - Command command = new Command(); - ProjectsCommand projectsCommand = new ProjectsCommand(); - ProjectsListRequest projectsListRequest = new ProjectsListRequest(); - projectsListRequest.setOrganizationID(organizationId); - projectsCommand.setList(projectsListRequest); - command.setProjects(projectsCommand); - - ResponseForProjectsResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForProjectsResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? - response.getErrorMessage() : "No projects for given organization"); - } - - return response.getData(); - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java b/languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java deleted file mode 100644 index 63324449..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.bitwarden.sdk; - -import com.bitwarden.sdk.schema.*; - -import java.util.UUID; -import java.time.OffsetDateTime; - -public class SecretsClient { - - private final CommandRunner commandRunner; - - SecretsClient(CommandRunner commandRunner) { - this.commandRunner = commandRunner; - } - - public SecretResponse get(UUID id) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretGetRequest secretGetRequest = new SecretGetRequest(); - secretGetRequest.setID(id); - secretsCommand.setGet(secretGetRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secret not found"); - } - - return response.getData(); - } - - public SecretResponse create(UUID organizationId, String key, String value, String note, UUID[] projectIds) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretCreateRequest secretCreateRequest = new SecretCreateRequest(); - secretCreateRequest.setKey(key); - secretCreateRequest.setValue(value); - secretCreateRequest.setNote(note); - secretCreateRequest.setOrganizationID(organizationId); - secretCreateRequest.setProjectIDS(projectIds); - secretsCommand.setCreate(secretCreateRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secret create failed"); - } - - return response.getData(); - } - - public SecretResponse update(UUID organizationId, UUID id, String key, String value, String note, UUID[] projectIds) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretPutRequest secretPutRequest = new SecretPutRequest(); - secretPutRequest.setID(id); - secretPutRequest.setKey(key); - secretPutRequest.setValue(value); - secretPutRequest.setNote(note); - secretPutRequest.setOrganizationID(organizationId); - secretPutRequest.setProjectIDS(projectIds); - secretsCommand.setUpdate(secretPutRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secret update failed"); - } - - return response.getData(); - } - - public SecretsDeleteResponse delete(UUID[] ids) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretsDeleteRequest secretsDeleteRequest = new SecretsDeleteRequest(); - secretsDeleteRequest.setIDS(ids); - secretsCommand.setDelete(secretsDeleteRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretsDeleteResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretsDeleteResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secrets delete failed"); - } - - return response.getData(); - } - - public SecretIdentifiersResponse list(UUID organizationId) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretIdentifiersRequest secretIdentifiersRequest = new SecretIdentifiersRequest(); - secretIdentifiersRequest.setOrganizationID(organizationId); - secretsCommand.setList(secretIdentifiersRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretIdentifiersResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretIdentifiersResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? - response.getErrorMessage() : "No secrets for given organization"); - } - - return response.getData(); - } - - public SecretsResponse getByIds(UUID[] ids) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretsGetRequest secretsGetRequest = new SecretsGetRequest(); - secretsGetRequest.setIDS(ids); - secretsCommand.setGetByIDS(secretsGetRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretsResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretsResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secret(s) not found"); - } - - return response.getData(); - } - - public SecretsSyncResponse sync(UUID organizationId, OffsetDateTime lastSyncedDate) { - Command command = new Command(); - SecretsCommand secretsCommand = new SecretsCommand(); - SecretsSyncRequest secretsSyncRequest = new SecretsSyncRequest(); - secretsSyncRequest.setOrganizationID(organizationId); - secretsSyncRequest.setLastSyncedDate(lastSyncedDate); - secretsCommand.setSync(secretsSyncRequest); - command.setSecrets(secretsCommand); - - ResponseForSecretsSyncResponse response = commandRunner.runCommand(command, - BitwardenClient.throwingFunctionWrapper(Converter::ResponseForSecretsSyncResponseFromJsonString)); - - if (response == null || !response.getSuccess()) { - throw new BitwardenClientException(response != null ? response.getErrorMessage() : "Secrets sync failed"); - } - - return response.getData(); - } -} diff --git a/languages/java/src/main/java/com/bitwarden/sdk/ThrowingFunction.java b/languages/java/src/main/java/com/bitwarden/sdk/ThrowingFunction.java deleted file mode 100644 index cab5b104..00000000 --- a/languages/java/src/main/java/com/bitwarden/sdk/ThrowingFunction.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.bitwarden.sdk; - -@FunctionalInterface -public interface ThrowingFunction { - - R accept(T t) throws E; -} diff --git a/languages/js/example/index.js b/languages/js/example/index.js deleted file mode 100644 index 8da3fc58..00000000 --- a/languages/js/example/index.js +++ /dev/null @@ -1,32 +0,0 @@ -const { BitwardenClient: BitwardenClientWasm, LogLevel } = require("@bitwarden/sdk-wasm"); -const sdk = require("@bitwarden/sdk-client"); - -async function main() { - const settings = { - apiUrl: process.env.API_URL, - identityUrl: process.env.IDENTITY_URL, - }; - - const client = new sdk.BitwardenClient( - new BitwardenClientWasm(JSON.stringify(settings), LogLevel.Debug), - ); - - const organization_id = process.env.ORGANIZATION_ID; - await client.accessTokenLogin(process.env.ACCESS_TOKEN); - - const project = await client.projects().create("test", organization_id); - const projects = await client.projects().list(organization_id); - console.log(projects.data); - - const secret = await client - .secrets() - .create("test-secret", "My secret!", "This is my secret", [project.id], organization_id); - const secrets = await client.secrets().list(organization_id); - console.log(secrets.data); - - console.log(project, secret); - - await client.projects().delete([project.id]); - await client.secrets().delete([secret.id]); -} -main(); diff --git a/languages/js/example/package-lock.json b/languages/js/example/package-lock.json deleted file mode 100644 index 2b701695..00000000 --- a/languages/js/example/package-lock.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "sdk-example", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "sdk-example", - "dependencies": { - "@bitwarden/sdk-client": "../sdk-client", - "@bitwarden/sdk-wasm": "../wasm" - } - }, - "../sdk-client": { - "name": "@bitwarden/sdk-client", - "devDependencies": { - "@types/node": "^20.0.0", - "rimraf": "^6.0.0", - "typescript": "^5.0.3" - } - }, - "../wasm": { - "name": "@bitwarden/sdk-wasm", - "version": "0.1.0" - }, - "node_modules/@bitwarden/sdk-client": { - "resolved": "../sdk-client", - "link": true - }, - "node_modules/@bitwarden/sdk-wasm": { - "resolved": "../wasm", - "link": true - } - } -} diff --git a/languages/js/example/package.json b/languages/js/example/package.json deleted file mode 100644 index 836e5308..00000000 --- a/languages/js/example/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "sdk-example", - "main": "index.js", - "scripts": { - "start": "node index.js" - }, - "dependencies": { - "@bitwarden/sdk-client": "../sdk-client", - "@bitwarden/sdk-wasm": "../wasm" - } -} diff --git a/languages/js/sdk-client/.gitignore b/languages/js/sdk-client/.gitignore deleted file mode 100644 index 29f7d8b5..00000000 --- a/languages/js/sdk-client/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -pkg diff --git a/languages/js/sdk-client/package-lock.json b/languages/js/sdk-client/package-lock.json deleted file mode 100644 index 5911a333..00000000 --- a/languages/js/sdk-client/package-lock.json +++ /dev/null @@ -1,574 +0,0 @@ -{ - "name": "@bitwarden/sdk-client", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@bitwarden/sdk-client", - "devDependencies": { - "@types/node": "^20.0.0", - "rimraf": "^6.0.0", - "typescript": "^5.0.3" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@types/node": { - "version": "20.16.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", - "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", - "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/lru-cache": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", - "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true, - "license": "MIT" - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - } - } -} diff --git a/languages/js/sdk-client/package.json b/languages/js/sdk-client/package.json deleted file mode 100644 index 17269acc..00000000 --- a/languages/js/sdk-client/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@bitwarden/sdk-client", - "exports": { - ".": { - "types": "./dist/src/lib.d.ts", - "default": "./dist/src/lib.js" - } - }, - "main": "dist/src/lib.js", - "types": "dist/src/lib.d.ts", - "scripts": { - "build": "npm run clean && tsc", - "clean": "rimraf dist" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "rimraf": "^6.0.0", - "typescript": "^5.0.3" - } -} diff --git a/languages/js/sdk-client/src/client.ts b/languages/js/sdk-client/src/client.ts deleted file mode 100644 index 0f06889c..00000000 --- a/languages/js/sdk-client/src/client.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { - Convert, - ProjectResponse, - ProjectsDeleteResponse, - ProjectsResponse, - SecretIdentifiersResponse, - SecretResponse, - SecretsDeleteResponse, -} from "./schemas"; - -interface BitwardenSDKClient { - run_command(js_input: string): Promise; -} - -function handleResponse(response: { success: boolean; errorMessage?: string; data?: T }): T { - if (!response.success) { - throw new Error(response.errorMessage); - } - return response.data as T; -} - -export class BitwardenClient { - client: BitwardenSDKClient; - - constructor(client: BitwardenSDKClient) { - this.client = client; - } - - async accessTokenLogin(accessToken: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - accessTokenLogin: { - accessToken, - }, - }), - ); - - handleResponse(Convert.toResponseForAccessTokenLoginResponse(response)); - } - - secrets(): SecretsClient { - return new SecretsClient(this.client); - } - - projects(): ProjectsClient { - return new ProjectsClient(this.client); - } -} - -export class SecretsClient { - client: BitwardenSDKClient; - - constructor(client: BitwardenSDKClient) { - this.client = client; - } - - async get(id: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - secrets: { - get: { id }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async create( - key: string, - value: string, - note: string, - projectIds: string[], - organizationId: string, - ): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - secrets: { - create: { key, value, note, projectIds, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async list(organizationId: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - secrets: { - list: { organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretIdentifiersResponse(response)); - } - - async update( - id: string, - key: string, - value: string, - note: string, - projectIds: string[], - organizationId: string, - ): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - secrets: { - update: { id, key, value, note, projectIds, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretResponse(response)); - } - - async delete(ids: string[]): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - secrets: { - delete: { ids }, - }, - }), - ); - - return handleResponse(Convert.toResponseForSecretsDeleteResponse(response)); - } -} - -export class ProjectsClient { - client: BitwardenSDKClient; - - constructor(client: BitwardenSDKClient) { - this.client = client; - } - - async get(id: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - projects: { - get: { id }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async create(name: string, organizationId: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - projects: { - create: { name, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async list(organizationId: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - projects: { - list: { organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectsResponse(response)); - } - - async update(id: string, name: string, organizationId: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - projects: { - update: { id, name, organizationId }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectResponse(response)); - } - - async delete(ids: string[]): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - projects: { - delete: { ids }, - }, - }), - ); - - return handleResponse(Convert.toResponseForProjectsDeleteResponse(response)); - } -} diff --git a/languages/js/sdk-client/src/lib.ts b/languages/js/sdk-client/src/lib.ts deleted file mode 100644 index 7fd93ce8..00000000 --- a/languages/js/sdk-client/src/lib.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client"; -export * from "./schemas"; diff --git a/languages/js/sdk-client/tsconfig.json b/languages/js/sdk-client/tsconfig.json deleted file mode 100644 index 987e8d67..00000000 --- a/languages/js/sdk-client/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist/", - "module": "commonjs", - "target": "es5", - "moduleResolution": "node", - "sourceMap": true, - "composite": true, - "declarationMap": true - }, - "include": ["./src/**/*"], -} diff --git a/languages/js/wasm/.gitignore b/languages/js/wasm/.gitignore deleted file mode 100644 index c4f6a47f..00000000 --- a/languages/js/wasm/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -bitwarden_wasm_bg.js -bitwarden_wasm_bg.wasm -bitwarden_wasm_bg.wasm.d.ts -bitwarden_wasm_bg.wasm.js -bitwarden_wasm.d.ts -bitwarden_wasm.js diff --git a/languages/js/wasm/index.js b/languages/js/wasm/index.js deleted file mode 100644 index c2b51200..00000000 --- a/languages/js/wasm/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// https://stackoverflow.com/a/47880734 -const supported = (() => { - try { - if (typeof WebAssembly === "object" - && typeof WebAssembly.instantiate === "function") { - const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)); - if (module instanceof WebAssembly.Module) - return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; - } - } catch (e) { - } - return false; -})(); - -let wasm; - -if (supported) { - wasm = await import('./bitwarden_wasm_bg.wasm'); -} else { - wasm = await import('./bitwarden_wasm_bg.wasm.js'); -} - -import { __wbg_set_wasm } from "./bitwarden_wasm_bg.js"; -__wbg_set_wasm(wasm); -export * from "./bitwarden_wasm_bg.js"; diff --git a/languages/js/wasm/package.json b/languages/js/wasm/package.json deleted file mode 100644 index eadbb5fb..00000000 --- a/languages/js/wasm/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@bitwarden/sdk-wasm", - "version": "0.1.0", - "files": [ - "bitwarden_wasm_bg.js", - "bitwarden_wasm_bg.wasm", - "bitwarden_wasm_bg.wasm.d.ts", - "bitwarden_wasm_bg.wasm.js", - "bitwarden_wasm.d.ts", - "bitwarden_wasm.js", - "index.js", - "node/bitwarden_wasm_bg.wasm", - "node/bitwarden_wasm_bg.wasm.d.ts", - "node/bitwarden_wasm.d.ts", - "node/bitwarden_wasm.js" - ], - "main": "node/bitwarden_wasm.js", - "module": "index.js", - "types": "bitwarden_wasm.d.ts", - "scripts": {}, - "sideEffects": [ - "./bitwarden_wasm.js", - "./snippets/*" - ] -} diff --git a/languages/php/.gitignore b/languages/php/.gitignore deleted file mode 100644 index 5d6ed424..00000000 --- a/languages/php/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -vendor -src/lib/ -src/Schemas/ diff --git a/languages/php/INSTALL.md b/languages/php/INSTALL.md deleted file mode 100644 index 29905338..00000000 --- a/languages/php/INSTALL.md +++ /dev/null @@ -1,56 +0,0 @@ -# PHP Installation - -## Introduction - -Composer is used to build the PHP Bitwarden client library. - -## Prerequisites - -- PHP >= 8.0 -- FFI extension enabled in PHP configuration -- Composer -- Bitwarden SDK native library. - - Expected in one of below locations, depending on the OS and architecture. - The `src` is relative path to the [src](./src) directory. - - Windows x86_64: `src\lib\windows-x64\bitwarden_c.dll` - - Linux x86_64: `src/lib/linux-x64/libbitwarden_c.so` - - macOS x86_64: `src/lib/macos-x64/libbitwarden_c.dylib` - - macOS aarch64: `src/lib/macos-arm64/libbitwarden_c.dylib` - - If you prefer to build the SDK yourself, see the [SDK README.md](../../README.md) for instructions. - -## Build Commands - -```shell -composer install -``` - -## Example - -### macOS - -#### Install Prerequisites - -Use brew Composer and PHP - -```shell -brew install php -brew install composer -``` - -#### Build Commands - -```shell -composer install -``` - -## Example SDK Usage Project - -```shell -export ACCESS_TOKEN="" -export STATE_FILE="" -export ORGANIZATION_ID="" -export API_URL="https://api.bitwarden.com" -export IDENTITY_URL="https://identity.bitwarden.com" - -php example.php -``` diff --git a/languages/php/README.md b/languages/php/README.md deleted file mode 100644 index 61991bd0..00000000 --- a/languages/php/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# Bitwarden Secrets Manager SDK wrapper for PHP - -PHP bindings for interacting with the [Bitwarden Secrets Manager]. This is a beta release and might be missing some functionality. - -## Installation - -See the [installation instructions](./INSTALL.md) - -## Usage - -### Create access token - -To interact with the client first you need to obtain the access token from Bitwarden. -Review the help documentation on [Access Tokens]. - -### Create new Bitwarden client - -```php -require_once 'vendor/autoload.php'; - -$access_token = ""; -$state_file = ""; -$organization_id = ""; -$api_url = "https://api.bitwarden.com"; -$identity_url = "https://identity.bitwarden.com"; - -$bitwarden_settings = new \Bitwarden\Sdk\BitwardenSettings($api_url, $identity_url); - -$bitwarden_client = new \Bitwarden\Sdk\BitwardenClient($bitwarden_settings); -$bitwarden_client->auth->login_access_token($access_token, $state_file); -``` - -Initialize `BitwardenSettings` by passing `$api_url` and `$identity_url` or set to null to use the defaults. -The default for `api_url` is `https://api.bitwarden.com` and for `identity_url` is `https://identity.bitwarden.com`. - -### Create new project - -```php -$name = "PHP project"; -$res = $bitwarden_client->projects->create($organization_id, $name); -$project_id = $res->id; -``` - -### Get project - -```php -$res = $bitwarden_client->projects->get($project_id); -``` - -### List all projects - -```php -$res = $bitwarden_client->projects->list($organization_id); -``` - -### Update project - -```php -$name = "Updated PHP project"; -$res = $bitwarden_client->projects->update($organization_id, $project_id, $name); -``` - -### Delete project - -```php -$res = $bitwarden_client->projects->delete([$project_id]); -``` - -### Create new secret - -```php -$key = "Secret key"; -$note = "Secret note"; -$value = "Secret value"; -$res = $bitwarden_client->secrets->create($organization_id, $key, $value, $note, [$project_id]); -$secret_id = $res->id; -``` - -### Get secret - -```php -$res = $bitwarden_client->secrets->get($secret_id); -``` - -### Get multiple secrets - -```php -$res = $bitwarden_client->secrets->get_by_ids([$secret_id]); -``` - -### List all secrets - -```php -$res = $bitwarden_client->secrets->list($organization_id); -``` - -### Update secret - -```php -$key = "Updated key"; -$note = "Updated note"; -$value = "Updated value"; -$res = $bitwarden_client->secrets->update($organization_id, $secret_id, $key, $value, $note, [$project_id]); -``` - -### Sync secrets - -```php -$last_synced_date = "2024-09-01T00:00:00Z"; -$res = $bitwarden_client->secrets->sync($organization_id, $last_synced_date); -``` - -### Delete secret - -```php -$res = $bitwarden_client->secrets->delete([$secret_id]); -``` - -[Access Tokens]: https://bitwarden.com/help/access-tokens/ - -[Bitwarden Secrets Manager]: https://bitwarden.com/products/secrets-manager/ diff --git a/languages/php/composer.json b/languages/php/composer.json deleted file mode 100644 index 6df44ed0..00000000 --- a/languages/php/composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "bitwarden/sdk-secrets", - "description": "PHP bindings for interacting with the Bitwarden Secrets Manager. This is a beta release and might be missing some functionality.", - "type": "library", - "keywords": ["bitwarden","sdk","password-manager"], - "homepage": "https://github.com/bitwarden/sdk", - "version": "1.0.0", - "require": { - "php": "^8.0", - "ext-ffi": "*" - }, - "autoload": { - "psr-4": { - "Bitwarden\\Sdk\\": "src/" - }, - "files": ["src/Schemas/Schemas.php"] - }, - "authors": [ - { - "name": "Bitwarden Inc." - } - ] -} diff --git a/languages/php/composer.lock b/languages/php/composer.lock deleted file mode 100644 index 18751130..00000000 --- a/languages/php/composer.lock +++ /dev/null @@ -1,21 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "1769eb8cdcb42d17f993aa0ef123895b", - "packages": [], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^8.0", - "ext-ffi": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/languages/php/example.php b/languages/php/example.php deleted file mode 100644 index 864a4ca2..00000000 --- a/languages/php/example.php +++ /dev/null @@ -1,103 +0,0 @@ -auth->login_access_token($access_token, $state_file); - - // create project - print("Projects:\n"); - $res = $bitwarden_client->projects->create($organization_id, 'php project'); - $project_id = $res->id; - print("\tcreate: '" . $project_id . "'\n\n"); - - // get project - $res = $bitwarden_client->projects->get($project_id); - print("\tget: '" . $res->name . "'\n\n"); - - // list projects - $res = $bitwarden_client->projects->list($organization_id); - print("\tlist:\n"); - foreach ($res->data as $project) { - print("\t\tID: '" . $project->id . "', Name: '" . $project->name . "'\n"); - } - print("\n"); - - // update project - $res = $bitwarden_client->projects->update($organization_id, $project_id, 'php test project'); - print("\tupdate: '" . $res->name . "'\n\n"); - - // sync secrets - print("Secrets:\n"); - print("\tSyncing secrets...\n"); - $res = $bitwarden_client->secrets->sync($organization_id, null); - $now = new DateTime(); - $now_string = $now->format('Y-m-d\TH:i:s.u\Z'); - print("\t\tSync has changes: " . ($res->hasChanges ? 'true' : 'false') . "\n\n"); - - print("\tSyncing again to ensure no changes since last sync...\n"); - $res = $bitwarden_client->secrets->sync($organization_id, $now_string); - print("\t\tSync has changes: " . ($res->hasChanges ? 'true' : 'false') . "\n\n"); - - // create secret - $res = $bitwarden_client->secrets->create($organization_id, "New Key", "New value", "New note", [$project_id]); - $secret_id = $res->id; - print("\tcreate: '" . $secret_id . "'\n\n"); - - // get secret - $res = $bitwarden_client->secrets->get($secret_id); - print("\tget: '" . $res->key . "'\n\n"); - - // get multiple secrets by ids - $res = $bitwarden_client->secrets->get_by_ids([$secret_id]); - print("\tget_by_ids:\n"); - foreach ($res->data as $secret) { - print("\t\tID: '" . $secret->id . "', Key: '" . $secret->key . "'\n"); - } - print("\n"); - - // list secrets - $res = $bitwarden_client->secrets->list($organization_id); - print("\tlist:\n"); - foreach ($res->data as $secret) { - print("\t\tID: '" . $secret->id . "', Key: '" . $secret->key . "'\n"); - } - print("\n"); - - // update secret - $res = $bitwarden_client->secrets->update($organization_id, $secret_id, "Updated key", "Updated value", "Updated note", [$project_id]); - print("\tupdate: '" . $res->key . "'\n\n"); - - // delete secret - print("Cleaning up secrets and projects:\n"); - $res = $bitwarden_client->secrets->delete([$secret_id]); - print("\tdelete:\n"); - foreach ($res->data as $secret) { - print("\t\tdeleted secret: '" . $secret->id . "'\n"); - } - print("\n"); - - // delete project - $res = $bitwarden_client->projects->delete([$project_id]); - print("\tdelete:\n"); - foreach ($res->data as $project) { - print("\t\tdeleted project: '" . $project->id . "'\n"); - } - print("\n"); - -} catch (Exception $e) { - print("Error: " . $e->getMessage() . "\n"); - exit(1); -} diff --git a/languages/php/src/AuthClient.php b/languages/php/src/AuthClient.php deleted file mode 100644 index 449c7690..00000000 --- a/languages/php/src/AuthClient.php +++ /dev/null @@ -1,35 +0,0 @@ -commandRunner = $commandRunner; - } - - /** - * @throws Exception - */ - public function login_access_token(string $access_token, ?string $state_file): void - { - $access_token_request = new AccessTokenLoginRequest($access_token, $state_file); - $command = new Command(passwordLogin: null, apiKeyLogin: null, loginAccessToken: $access_token_request, - getUserApiKey: null, fingerprint: null, sync: null, secrets: null, projects: null, generators: null); - try { - $result = $this->commandRunner->run($command); - if (!isset($result->authenticated) || !$result->authenticated) { - throw new Exception("Unauthorized"); - } - } catch (Exception $exception) { - throw new Exception("Authorization error: " . $exception->getMessage()); - } - } -} diff --git a/languages/php/src/BitwardenClient.php b/languages/php/src/BitwardenClient.php deleted file mode 100644 index c125b6aa..00000000 --- a/languages/php/src/BitwardenClient.php +++ /dev/null @@ -1,45 +0,0 @@ -clientSettings = new ClientSettings(apiUrl: $bitwardenSettings->get_api_url(), - deviceType: DeviceType::$SDK, identityUrl: $bitwardenSettings->get_identity_url(), - userAgent: "Bitwarden PHP-SDK"); - - $this->bitwarden_lib = new BitwardenLib(); - $this->bitwarden_lib->init($this->clientSettings); - - $this->commandRunner = new CommandRunner($this->bitwarden_lib); - $this->projects = new ProjectsClient($this->commandRunner); - $this->secrets = new SecretsClient($this->commandRunner); - $this->auth = new AuthClient($this->commandRunner); - } - - public function __destruct() - { - $this->bitwarden_lib->free_mem(); - } -} diff --git a/languages/php/src/BitwardenLib.php b/languages/php/src/BitwardenLib.php deleted file mode 100644 index 53be3299..00000000 --- a/languages/php/src/BitwardenLib.php +++ /dev/null @@ -1,112 +0,0 @@ -ffi = FFI::cdef(' - void* init(const char* param); - char* run_command(void* c_str_ptr, void* client_ptr); - void free_mem(void* client_ptr);', - $lib_file - ); - } - - /** - * @throws JsonException - * @throws Exception - */ - public function init(ClientSettings $client_settings): FFI\CData - { - $encoded_json = $this::json_encode_sdk_format($client_settings->to()); - $this->handle = $this->ffi->init($encoded_json); - return $this->handle; - } - - /** - * @throws JsonException - * @throws Exception - */ - public function run_command(Command $command): stdClass - { - $encoded_json = $this::json_encode_sdk_format($command->to()); - try { - $result = $this->ffi->run_command($encoded_json, $this->handle); - return json_decode(FFI::string($result)); - } catch (FFI\Exception $e) { - throw new RuntimeException('Error occurred during FFI operation: ' . $e->getMessage()); - } - } - - public function free_mem(): void - { - $this->ffi->free_mem($this->handle); - } - - /** - * @throws JsonException - */ - private static function json_encode_sdk_format($object): string - { - $withoutNull = function ($a) use (&$withoutNull) { - if (is_object($a)) { - $a = array_filter((array)$a); - foreach ($a as $k => $v) { - $a[$k] = $withoutNull($v); - } - - return (object)$a; - } - - return $a; - }; - - $object_no_nulls = $withoutNull($object); - - return json_encode($object_no_nulls, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES); - } -} diff --git a/languages/php/src/BitwardenSettings.php b/languages/php/src/BitwardenSettings.php deleted file mode 100644 index b3d62bc2..00000000 --- a/languages/php/src/BitwardenSettings.php +++ /dev/null @@ -1,26 +0,0 @@ -api_url = $api_url; - $this->identity_url = $identity_url; - } - - public function get_api_url(): ?string - { - return $this->api_url; - } - - public function get_identity_url(): ?string - { - return $this->identity_url; - } -} diff --git a/languages/php/src/CommandRunner.php b/languages/php/src/CommandRunner.php deleted file mode 100644 index 532b9625..00000000 --- a/languages/php/src/CommandRunner.php +++ /dev/null @@ -1,33 +0,0 @@ -bitwardenLib = $bitwardenLib; - } - - /** - * @throws Exception - */ - public function run(Command $command): stdClass - { - $result = $this->bitwardenLib->run_command($command); - if ($result->success) { - return $result->data; - } - - if (isset($result->errorMessage)) { - throw new Exception($result->errorMessage); - } - throw new Exception("Unknown error occurred"); - } -} diff --git a/languages/php/src/ProjectsClient.php b/languages/php/src/ProjectsClient.php deleted file mode 100644 index cca44f1e..00000000 --- a/languages/php/src/ProjectsClient.php +++ /dev/null @@ -1,94 +0,0 @@ -commandRunner = $commandRunner; - } - - /** - * @throws Exception - */ - public function get(string $project_id): stdClass - { - $project_get_request = new ProjectGetRequest($project_id); - $project_get_request->validate(); - $project_command = new ProjectsCommand(get: $project_get_request, create: null, list: null, update: null, - delete: null); - return $this->run_project_command($project_command); - } - - /** - * @throws Exception - */ - public function list(string $organization_id): stdClass - { - $project_list_request = new ProjectsListRequest($organization_id); - $project_list_request->validate(); - $project_command = new ProjectsCommand(get: null, create: null, list: $project_list_request, update: null, - delete: null); - return $this->run_project_command($project_command); - } - - /** - * @throws Exception - */ - public function create(string $organization_id, string $project_name): stdClass - { - $project_create_request = new ProjectCreateRequest(name: $project_name, organizationId: $organization_id); - $project_create_request->validate(); - $project_command = new ProjectsCommand(get: null, create: $project_create_request, list: null, update: null, - delete: null); - return $this->run_project_command($project_command); - } - - /** - * @throws Exception - */ - public function update(string $organization_id, string $project_id, string $project_name): stdClass - { - $project_put_request = new ProjectPutRequest(id: $project_id, name: $project_name, - organizationId: $organization_id); - $project_put_request->validate(); - $project_command = new ProjectsCommand(get: null, create: null, list: null, update: $project_put_request, - delete: null); - return $this->run_project_command($project_command); - } - - /** - * @throws Exception - */ - public function delete(array $ids): stdClass - { - $projects_delete_request = new ProjectsDeleteRequest($ids); - $projects_delete_request->validate(); - $project_command = new ProjectsCommand(get: null, create: null, list: null, update: null, - delete: $projects_delete_request); - return $this->run_project_command($project_command); - } - - /** - * @throws Exception - */ - public function run_project_command($projectCommand): stdClass - { - $command = new Command(passwordLogin: null, apiKeyLogin: null, loginAccessToken: null, getUserApiKey: null, - fingerprint: null, sync: null, secrets: null, projects: $projectCommand, generators: null); - return $this->commandRunner->run($command); - } -} diff --git a/languages/php/src/SecretsClient.php b/languages/php/src/SecretsClient.php deleted file mode 100644 index 85bc334d..00000000 --- a/languages/php/src/SecretsClient.php +++ /dev/null @@ -1,125 +0,0 @@ -commandRunner = $commandRunner; - } - - /** - * @throws Exception - */ - public function get(string $secret_id): stdClass - { - $secret_get_request = new SecretGetRequest($secret_id); - $secret_get_request->validate(); - $secrets_command = new SecretsCommand(get: $secret_get_request, getByIds: null, create: null, list: null, - update: null, delete: null, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function get_by_ids(array $secret_ids): stdClass - { - $project_get_by_ids_request = new SecretsGetRequest($secret_ids); - $project_get_by_ids_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: $project_get_by_ids_request, create: null, list: null, - update: null, delete: null, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function list(string $organization_id): stdClass - { - $secrets_list_request = new SecretIdentifiersRequest($organization_id); - $secrets_list_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: null, create: null, list: $secrets_list_request, - update: null, delete: null, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function create(string $organization_id, string $key, string $value, string $note, array $project_ids): stdClass - { - $secrets_create_request = new SecretCreateRequest(key: $key, note: $note, organizationId: $organization_id, - projectIds: $project_ids, value: $value); - $secrets_create_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: null, create: $secrets_create_request, list: null, - update: null, delete: null, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function update(string $organization_id, string $id, string $key, string $value, string $note, array $project_ids): stdClass - { - $secrets_put_request = new SecretPutRequest(id: $id, key: $key, note: $note, organizationId: $organization_id, - projectIds: $project_ids, value: $value); - $secrets_put_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: null, create: null, list: null, - update: $secrets_put_request, delete: null, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function delete(array $secrets_ids): stdClass - { - $secrets_delete_request = new SecretsDeleteRequest($secrets_ids); - $secrets_delete_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: null, create: null, list: null, - update: null, delete: $secrets_delete_request, sync: null); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function sync(string $organization_id, ?string $last_synced_date): stdClass - { - if (empty($last_synced_date)) { - $last_synced_date = "1970-01-01T00:00:00.000Z"; - } - - $secrets_sync_request = new SecretsSyncRequest(lastSyncedDate: $last_synced_date, organizationId: $organization_id); - $secrets_sync_request->validate(); - $secrets_command = new SecretsCommand(get: null, getByIds: null, create: null, list: null, - update: null, delete: null, sync: $secrets_sync_request); - return $this->run_secret_command($secrets_command); - } - - /** - * @throws Exception - */ - public function run_secret_command($secretsCommand): stdClass - { - $command = new Command(passwordLogin: null, apiKeyLogin: null, loginAccessToken: null, getUserApiKey: null, - fingerprint: null, sync: null, secrets: $secretsCommand, projects: null, generators: null); - return $this->commandRunner->run($command); - } -} diff --git a/languages/python/.gitignore b/languages/python/.gitignore deleted file mode 100644 index 495f6296..00000000 --- a/languages/python/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.egg-info -bitwarden_py*.so -__pycache__ -.venv diff --git a/languages/python/README.md b/languages/python/README.md deleted file mode 100644 index 29f3f97f..00000000 --- a/languages/python/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Build locally -## Requirements - -- Python 3 -- Rust -- `maturin` (install with `pip install maturin`) -- `npm` - -## Build - -```bash -npm install -npm run schemas # generate schemas.py - -cd languages/python/ -``` - -You will need to build and run the script using a virtual environment. -This will be slightly different depending on the OS you are using: - -```bash -# --- Linux/macOS --- -python3 -m venv .venv -source .venv/bin/activate - -# --- Windows --- -python -m venv venv - -venv\Scripts\activate.bat # cmd.exe -venv\Scripts\Activate.ps1 # Powershell -``` - -## Run - -```bash -maturin develop -python3 ./example.py - -deactivate # run this to close the virtual session -``` - -You can now import `BitwardenClient` in your Python code with: -```python -from bitwarden_sdk import BitwardenClient -``` - -# Use without building locally - -```bash -pip install bitwarden-sdk -``` - -# Run - -Set the `ORGANIZATION_ID` and `ACCESS_TOKEN` environment variables to your organization ID and access token, respectively. - -```bash -python3 ./example.py -``` diff --git a/languages/python/bitwarden_sdk/__init__.py b/languages/python/bitwarden_sdk/__init__.py deleted file mode 100644 index f1712c77..00000000 --- a/languages/python/bitwarden_sdk/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -"""The official Bitwarden client library for Python.""" - -__version__ = "1.0.0" - -from .bitwarden_client import * -from .schemas import * - -__doc__ = bitwarden_client.__doc__ -if hasattr(bitwarden_client, "__all__"): - __all__ = bitwarden_client.__all__ - -if hasattr(schemas, "__all__"): - __all__ += schemas.__all__ diff --git a/languages/python/bitwarden_sdk/bitwarden_client.py b/languages/python/bitwarden_sdk/bitwarden_client.py deleted file mode 100644 index ac51e8dd..00000000 --- a/languages/python/bitwarden_sdk/bitwarden_client.py +++ /dev/null @@ -1,170 +0,0 @@ -import json -from typing import Any, List, Optional -from uuid import UUID -import bitwarden_py - -from .schemas import (ClientSettings, Command, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, - ResponseForSecretsResponse, ResponseForSecretsDeleteResponse, SecretCreateRequest, - SecretGetRequest, SecretsGetRequest, SecretIdentifiersRequest, SecretPutRequest, - SecretsCommand, SecretsDeleteRequest, SecretsSyncRequest, AccessTokenLoginRequest, - ResponseForSecretsSyncResponse, ResponseForAccessTokenLoginResponse, - ResponseForProjectResponse, ProjectsCommand, ProjectCreateRequest, ProjectGetRequest, - ProjectPutRequest, ProjectsListRequest, ResponseForProjectsResponse, - ResponseForProjectsDeleteResponse, ProjectsDeleteRequest) - - -class BitwardenClient: - def __init__(self, settings: ClientSettings = None): - if settings is None: - self.inner = bitwarden_py.BitwardenClient(None) - else: - settings_json = json.dumps(settings.to_dict()) - self.inner = bitwarden_py.BitwardenClient(settings_json) - - def auth(self): - return AuthClient(self) - - def secrets(self): - return SecretsClient(self) - - def projects(self): - return ProjectsClient(self) - - def _run_command(self, command: Command) -> Any: - response_json = self.inner.run_command(json.dumps(command.to_dict())) - response = json.loads(response_json) - - if response["success"] == False: - raise Exception(response["errorMessage"]) - - return response - - -class AuthClient: - def __init__(self, client: BitwardenClient): - self.client = client - - def login_access_token(self, access_token: str, - state_file: str = None) -> ResponseForAccessTokenLoginResponse: - result = self.client._run_command( - Command(login_access_token=AccessTokenLoginRequest(access_token, state_file)) - ) - return ResponseForAccessTokenLoginResponse.from_dict(result) - - -class SecretsClient: - def __init__(self, client: BitwardenClient): - self.client = client - - def get(self, id: str) -> ResponseForSecretResponse: - result = self.client._run_command( - Command(secrets=SecretsCommand(get=SecretGetRequest(id))) - ) - return ResponseForSecretResponse.from_dict(result) - - def get_by_ids(self, ids: List[UUID]) -> ResponseForSecretsResponse: - result = self.client._run_command( - Command(secrets=SecretsCommand( - get_by_ids=SecretsGetRequest(ids)) - )) - return ResponseForSecretsResponse.from_dict(result) - - def create( - self, - organization_id: UUID, - key: str, - value: str, - note: Optional[str], - project_ids: Optional[List[UUID]] = None, - ) -> ResponseForSecretResponse: - if note is None: - # secrets api does not accept empty notes - note = "" - result = self.client._run_command( - Command(secrets=SecretsCommand( - create=SecretCreateRequest(key, note, organization_id, value, project_ids))) - ) - return ResponseForSecretResponse.from_dict(result) - - def list(self, organization_id: str) -> ResponseForSecretIdentifiersResponse: - result = self.client._run_command( - Command(secrets=SecretsCommand( - list=SecretIdentifiersRequest(organization_id))) - ) - return ResponseForSecretIdentifiersResponse.from_dict(result) - - def update( - self, - organization_id: str, - id: str, - key: str, - value: str, - note: Optional[str], - project_ids: Optional[List[UUID]] = None, - ) -> ResponseForSecretResponse: - if note is None: - # secrets api does not accept empty notes - note = "" - result = self.client._run_command( - Command(secrets=SecretsCommand(update=SecretPutRequest( - id, key, note, organization_id, value, project_ids))) - ) - return ResponseForSecretResponse.from_dict(result) - - def delete(self, ids: List[str]) -> ResponseForSecretsDeleteResponse: - result = self.client._run_command( - Command(secrets=SecretsCommand(delete=SecretsDeleteRequest(ids))) - ) - return ResponseForSecretsDeleteResponse.from_dict(result) - - def sync(self, organization_id: str, last_synced_date: Optional[str]) -> ResponseForSecretsSyncResponse: - result = self.client._run_command( - Command(secrets=SecretsCommand(sync=SecretsSyncRequest(organization_id, last_synced_date))) - ) - return ResponseForSecretsSyncResponse.from_dict(result) - - -class ProjectsClient: - def __init__(self, client: BitwardenClient): - self.client = client - - def get(self, id: str) -> ResponseForProjectResponse: - result = self.client._run_command( - Command(projects=ProjectsCommand(get=ProjectGetRequest(id))) - ) - return ResponseForProjectResponse.from_dict(result) - - def create(self, - organization_id: str, - name: str, - ) -> ResponseForProjectResponse: - result = self.client._run_command( - Command(projects=ProjectsCommand( - create=ProjectCreateRequest(name, organization_id))) - ) - return ResponseForProjectResponse.from_dict(result) - - def list(self, organization_id: str) -> ResponseForProjectsResponse: - result = self.client._run_command( - Command(projects=ProjectsCommand( - list=ProjectsListRequest(organization_id))) - ) - return ResponseForProjectsResponse.from_dict(result) - - def update( - self, - organization_id: str, - id: str, - name: str, - ) -> ResponseForProjectResponse: - result = self.client._run_command( - Command(projects=ProjectsCommand(update=ProjectPutRequest( - id, name, organization_id))) - ) - return ResponseForProjectResponse.from_dict(result) - - def delete(self, ids: List[str]) -> ResponseForProjectsDeleteResponse: - result = self.client._run_command( - Command(projects=ProjectsCommand(delete=ProjectsDeleteRequest(ids))) - ) - return ResponseForProjectsDeleteResponse.from_dict(result) diff --git a/languages/python/example.py b/languages/python/example.py deleted file mode 100755 index ee3690dd..00000000 --- a/languages/python/example.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 -import logging -import os -from datetime import datetime, timezone - -from bitwarden_sdk import BitwardenClient, DeviceType, client_settings_from_dict - -# Create the BitwardenClient, which is used to interact with the SDK -client = BitwardenClient( - client_settings_from_dict( - { - "apiUrl": os.getenv("API_URL", "http://localhost:4000"), - "deviceType": DeviceType.SDK, - "identityUrl": os.getenv("IDENTITY_URL", "http://localhost:33656"), - "userAgent": "Python", - } - ) -) - -# Add some logging & set the org id -logging.basicConfig(level=logging.DEBUG) -organization_id = os.getenv("ORGANIZATION_ID") - -# Set the state file location -# Note: the path must exist, the file will be created & managed by the sdk -state_path = os.getenv("STATE_FILE") - -# Attempt to authenticate with the Secrets Manager Access Token -client.auth().login_access_token(os.getenv("ACCESS_TOKEN"), state_path) - -# -- Example Project Commands -- - -project = client.projects().create(organization_id, "ProjectName") -project2 = client.projects().create(organization_id, "AnotherProject") -updated_project = client.projects().update( - organization_id, project.data.id, "Cool New Project Name" -) -get_that_project = client.projects().get(project.data.id) - -input("Press Enter to delete the project...") -client.projects().delete([project.data.id]) - -print(client.projects().list(organization_id)) - -# -- Example Secret Commands -- - -if client.secrets().sync(organization_id, None).data.has_changes is True: - print("There are changes to sync") -else: - print("No changes to sync") - -last_synced_date = datetime.now(tz=timezone.utc) -print(client.secrets().sync(organization_id, last_synced_date)) - -secret = client.secrets().create( - organization_id, - "TEST_SECRET", - "This is a test secret", - "Secret1234!", - [project2.data.id], -) -secret2 = client.secrets().create( - organization_id, - "ANOTHER_SECRET", - "Secret1234!", - None, - [project2.data.id], -) -secret_updated = client.secrets().update( - organization_id, - secret.data.id, - "TEST_SECRET_UPDATED", - "This as an updated test secret", - "Secret1234!_updated", - [project2.data.id], -) -secrets_retrieved = client.secrets().get_by_ids([secret.data.id, secret2.data.id]) - -# cleanup -input("Press Enter to cleanup secrets and projects...") -client.secrets().delete([secret.id for secret in secrets_retrieved.data.data]) - -client.projects().delete([project2.data.id]) diff --git a/languages/python/openapitools.json b/languages/python/openapitools.json deleted file mode 100644 index 92036ec7..00000000 --- a/languages/python/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "6.0.0" - } -} diff --git a/languages/python/pyproject.toml b/languages/python/pyproject.toml deleted file mode 100644 index a4ab1f69..00000000 --- a/languages/python/pyproject.toml +++ /dev/null @@ -1,29 +0,0 @@ -[build-system] -build-backend = "maturin" -requires = ["maturin>=1.0,<2.0", "setuptools_rust>=1.8.1"] - -[project] -authors = [{ name = "Bitwarden", email = "support@bitwarden.com" }] -classifiers = [ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: Other/Proprietary License", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Rust", - "Topic :: Security", -] -dependencies = ["dateutils >= 0.6.6"] -description = "A Bitwarden Client for python" -name = "bitwarden_sdk" -readme = "README.md" -requires-python = ">=3.0" -version = "1.0.0" - -[tool.maturin] -bindings = "pyo3" -compatibility = "2_28" -include = [ - { path = "bitwarden_sdk/*.py", format = ["sdist", "wheel"] } -] -manifest-path = "../../crates/bitwarden-py/Cargo.toml" -python-packages = ["bitwarden_sdk"] diff --git a/languages/ruby/.gitignore b/languages/ruby/.gitignore deleted file mode 100644 index 92b76b42..00000000 --- a/languages/ruby/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.lock -*.gem -bitwarden_sdk_secrets/lib/schemas.rb -bitwarden_sdk_secrets/pkg diff --git a/languages/ruby/CHANGELOG.md b/languages/ruby/CHANGELOG.md deleted file mode 100644 index 0c842ecb..00000000 --- a/languages/ruby/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -## [Unreleased] - -## [0.1.0] - 2024-02-23 - -- Initial release - diff --git a/languages/ruby/README.md b/languages/ruby/README.md deleted file mode 100644 index 790008b3..00000000 --- a/languages/ruby/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# Bitwarden Secrets Manager SDK - -Ruby bindings for interacting with the [Bitwarden Secrets Manager]. This is a beta release and might -be missing some functionality. - -## Installation - -Requirements: Ruby >= 3.0 - -Install gem: `gem install bitwarden-sdk-secrets` - -Import it: `require 'bitwarden-sdk-secrets'` - -## Usage - -To interact with client first you need to obtain access token from Bitwarden. Client will be -initialized with default client settings if they are not provided via env variables. - -```ruby -require 'bitwarden-sdk-secrets' - -# then you can initialize BitwardenSettings: -bitwarden_settings = BitwardenSDK::BitwardenSettings.new( - 'https://api.bitwarden.com', - 'https://identity.bitwarden.com' -) - -# By passing these setting you can initialize BitwardenClient - -bw_client = BitwardenSDK::BitwardenClient.new(bitwarden_settings) -response = bw_client.auth.login_access_token(token, state_file) -puts response -``` - -After successful authorization you can interact with client to manage your projects and secrets. - -```ruby - -# CREATE project -project_name = 'Test project 1' -response = bw_client.projects.create(organization_id, project_name) -puts response -project_id = response['id'] - -# GET project -response = bw_client.projects.get(project_id) -puts response - -# LIST projects -response = bw_client.projects.list(organization_id) -puts response - -# UPDATE projects -name = 'Updated test project 1' -response = bw_client.projects.update(organization_id, project_id, name) -puts response - -# DELETE project -response = bw_client.projects.delete_projects([project_id]) -puts response -``` - -Similarly, you interact with secrets: - -```ruby -# CREATE secret -key = 'AWS-SES' -note = 'Private account' -value = '8t27.dfj;' -response = bw_client.secrets.create(organization_id, key, value, note, [project_id]) -puts response -secret_id = response['id'] - -# GET secret -response = bw_client.secrets.get(secret_id) -puts response - -# GET secret by ids -response = bw_client.secrets.get_by_ids([secret_id]) -puts response - -# LIST secrets -response = bw_client.secrets.list(organization_id) -puts response - -# SYNC secrets -response = bw_client.secrets.sync(organization_id, nil) -last_synced_date = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%6NZ') -puts response - -response = bw_client.secrets.sync(organization_id, last_synced_date) -puts response - -# UPDATE secret -note = 'updated password' -value = '7I.ert10AjK' -response = bw_client.secrets.update(organization_id, secret_id, key, value, note, [project_id]) -puts response - -# DELETE secret -response = bw_client.secrets.delete([secret_id]) -puts response -``` - -## Development - -Prerequisites: - -- Ruby >= 3.0 installed -- Generate schemas `npm run schemas` - -```bash -# Navigate to the ruby language folder -cd languages/ruby - -# Make the binary folder if it doesn't exist already -mkdir -p ./bitwarden_sdk_secrets/lib/macos-arm64 - -# Build and copy the bitwarden-c library -cargo build --package bitwarden-c -cp ../../target/debug/libbitwarden_c.dylib ./bitwarden_sdk_secrets/lib/macos-arm64/libbitwarden_c.dylib - -# Install ruby dependencies -cd ./bitwarden_sdk_secrets -bundle install - -# Install the gem -bundle exec rake install - -## Run example tests -cd .. -export ACCESS_TOKEN="" -export ORGANIZATION_ID="" - -export API_URL=http://localhost:4000 -export IDENTITY_URL=http://localhost:33656 -ruby examples/example.rb -``` - -[Bitwarden Secrets Manager]: https://bitwarden.com/products/secrets-manager/ diff --git a/languages/ruby/bitwarden_sdk_secrets/Gemfile b/languages/ruby/bitwarden_sdk_secrets/Gemfile deleted file mode 100644 index 0f396348..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/Gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -# Specify your gem's dependencies in exmp.gemspec -gemspec - -gem "rake", "~> 13.0" -gem "rspec", "~> 3.0" -gem "rubocop", "~> 1.21" diff --git a/languages/ruby/bitwarden_sdk_secrets/Rakefile b/languages/ruby/bitwarden_sdk_secrets/Rakefile deleted file mode 100644 index 30550c5d..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/Rakefile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -require "bundler/gem_tasks" -require "rubocop/rake_task" -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new - -RuboCop::RakeTask.new - -task default: :rubocop diff --git a/languages/ruby/bitwarden_sdk_secrets/bitwarden-sdk-secrets.gemspec b/languages/ruby/bitwarden_sdk_secrets/bitwarden-sdk-secrets.gemspec deleted file mode 100644 index 457e60a3..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/bitwarden-sdk-secrets.gemspec +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative 'lib/version' - -Gem::Specification.new do |spec| - spec.name = 'bitwarden-sdk-secrets' - spec.version = BitwardenSDKSecrets::VERSION - spec.authors = ['Bitwarden Inc.'] - spec.email = ['hello@bitwarden_sdk.com'] - - spec.summary = 'Bitwarden Secrets Manager SDK.' - spec.description = 'Ruby wrapper for Bitwarden secrets manager SDK.' - spec.homepage = 'https://bitwarden.com/products/secrets-manager/' - spec.required_ruby_version = '>= 3.0.0' - - spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/bitwarden/sdk' - spec.metadata['changelog_uri'] = 'https://github.com/bitwarden/sdk/blob/main/languages/ruby/CHANGELOG.md' - - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(__dir__) do - `git ls-files -z`.split("\x0").reject do |f| - (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git Gemfile]) - end - end - - spec.files += Dir.glob('lib/linux-x64/**/*') - spec.files += Dir.glob('lib/macos-x64/**/*') - spec.files += Dir.glob('lib/windows-x64/**/*') - spec.files += Dir.glob('lib/macos-arm64/**/*') - spec.files += Dir.glob('lib/schemas.rb') - - spec.bindir = 'exe' - spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } - spec.require_paths = ['lib'] - - # Uncomment to register a new dependency of your gem - # spec.add_dependency "example-gem", "~> 1.0" - spec.add_dependency 'dry-struct', '~> 1.6' - spec.add_dependency 'dry-types', '~> 1.7' - spec.add_dependency 'ffi', '~> 1.15' - spec.add_dependency 'json', '~> 2.6' - spec.add_dependency 'rake', '~> 13.0' - spec.add_dependency 'rubocop', '~> 1.21' - -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/auth.rb b/languages/ruby/bitwarden_sdk_secrets/lib/auth.rb deleted file mode 100644 index 481f3025..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/auth.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true -require_relative 'bitwarden_error' - -module BitwardenSDKSecrets - class AuthClient - def initialize(command_runner) - @command_runner = command_runner - end - - def login_access_token(access_token, state_file = nil) - access_token_request = AccessTokenLoginRequest.new(access_token: access_token, state_file: state_file) - @command_runner.run(SelectiveCommand.new(login_access_token: access_token_request)) - nil - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden-sdk-secrets.rb b/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden-sdk-secrets.rb deleted file mode 100644 index 4cd1c259..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden-sdk-secrets.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'dry-types' - -require_relative 'schemas' -require_relative 'extended_schemas/schemas' -require_relative 'command_runner' -require_relative 'bitwarden_lib' -require_relative 'bitwarden_error' -require_relative 'projects' -require_relative 'secrets' -require_relative 'auth' - -module BitwardenSDKSecrets - class BitwardenSettings - attr_accessor :api_url, :identity_url - - def initialize(api_url, identity_url) - # if api_url.nil? || identity_url.nil? - # raise ArgumentError, "api_url and identity_url cannot be nil" - # end - - @api_url = api_url - @identity_url = identity_url - end - end - - class BitwardenClient - attr_reader :bitwarden, :projects, :secrets, :auth - - def initialize(bitwarden_settings) - client_settings = ClientSettings.new( - api_url: bitwarden_settings.api_url, - identity_url: bitwarden_settings.identity_url, - user_agent: 'Bitwarden RUBY-SDK', - device_type: nil - ) - - @bitwarden = BitwardenLib - @handle = @bitwarden.init(client_settings.to_dynamic.compact.to_json) - @command_runner = CommandRunner.new(@bitwarden, @handle) - @projects = ProjectsClient.new(@command_runner) - @secrets = SecretsClient.new(@command_runner) - @auth = AuthClient.new(@command_runner) - end - - def free_mem - @bitwarden.free_mem(@handle) - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_error.rb b/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_error.rb deleted file mode 100644 index b2239e29..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_error.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module BitwardenSDKSecrets - class BitwardenError < StandardError - def initialize(message = 'Error getting response') - super(message) - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_lib.rb b/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_lib.rb deleted file mode 100644 index 05ab5142..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/bitwarden_lib.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'ffi' - -module BitwardenSDKSecrets - module BitwardenLib - extend FFI::Library - - def self.mac_with_intel? - `uname -m`.strip == 'x86_64' - end - - ffi_lib case RUBY_PLATFORM - when /darwin/ - local_file = if mac_with_intel? - File.expand_path('macos-x64/libbitwarden_c.dylib', __dir__) - else - File.expand_path('macos-arm64/libbitwarden_c.dylib', __dir__) - end - File.exist?(local_file) ? local_file : File.expand_path('../../../../target/debug/libbitwarden_c.dylib', __dir__) - when /linux/ - local_file = File.expand_path('linux-x64/libbitwarden_c.so', __dir__) - File.exist?(local_file) ? local_file : File.expand_path('../../../../target/debug/libbitwarden_c.so', __dir__) - when /mswin|mingw/ - local_file = File.expand_path('windows-x64/bitwarden_c.dll', __dir__) - File.exist?(local_file) ? local_file : File.expand_path('../../../../target/debug/bitwarden_c.dll', __dir__) - else - raise "Unsupported platform: #{RUBY_PLATFORM}" - end - - attach_function :init, [:string], :pointer - attach_function :run_command, %i[string pointer], :string - attach_function :free_mem, [:pointer], :void - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/command_runner.rb b/languages/ruby/bitwarden_sdk_secrets/lib/command_runner.rb deleted file mode 100644 index 80e846a8..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/command_runner.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module BitwardenSDKSecrets - class CommandRunner - def initialize(bitwarden_sdk, handle) - @bitwarden_sdk = bitwarden_sdk - @handle = handle - end - - # @param [Dry-Struct] cmd - def run(cmd) - @bitwarden_sdk.run_command(cmd.to_json, @handle) - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/extended_schemas/schemas.rb b/languages/ruby/bitwarden_sdk_secrets/lib/extended_schemas/schemas.rb deleted file mode 100644 index bcdfa5e5..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/extended_schemas/schemas.rb +++ /dev/null @@ -1,78 +0,0 @@ - -module BitwardenSDKSecrets - class SelectiveCommand < Command - attribute :password_login, PasswordLoginRequest.optional.default(nil) - attribute :api_key_login, APIKeyLoginRequest.optional.default(nil) - attribute :login_access_token, AccessTokenLoginRequest.optional.default(nil) - attribute :get_user_api_key, SecretVerificationRequest.optional.default(nil) - attribute :fingerprint, FingerprintRequest.optional.default(nil) - attribute :sync, SyncRequest.optional.default(nil) - attribute :secrets, SecretsCommand.optional.default(nil) - attribute :projects, ProjectsCommand.optional.default(nil) - attribute :generators, GeneratorsCommand.optional.default(nil) - - def to_dynamic - { - "passwordLogin" => password_login&.to_dynamic, - "apiKeyLogin" => api_key_login&.to_dynamic, - "loginAccessToken" => login_access_token&.to_dynamic, - "getUserApiKey" => get_user_api_key&.to_dynamic, - "fingerprint" => fingerprint&.to_dynamic, - "sync" => sync&.to_dynamic, - "secrets" => secrets&.to_dynamic, - "projects" => projects&.to_dynamic, - "generators" => generators&.to_dynamic, - }.compact - end - end - - class SelectiveProjectsCommand < ProjectsCommand - attribute :get, ProjectGetRequest.optional.default(nil) - attribute :create, ProjectCreateRequest.optional.default(nil) - attribute :list, ProjectsListRequest.optional.default(nil) - attribute :update, ProjectPutRequest.optional.default(nil) - attribute :delete, ProjectsDeleteRequest.optional.default(nil) - - def to_dynamic - { - "get" => get&.to_dynamic, - "create" => create&.to_dynamic, - "list" => list&.to_dynamic, - "update" => update&.to_dynamic, - "delete" => delete&.to_dynamic, - }.compact - end - end - - class SelectiveSecretsCommand < SecretsCommand - attribute :get, SecretGetRequest.optional.default(nil) - attribute :get_by_ids, SecretsGetRequest.optional.default(nil) - attribute :create, SecretCreateRequest.optional.default(nil) - attribute :list, SecretIdentifiersRequest.optional.default(nil) - attribute :update, SecretPutRequest.optional.default(nil) - attribute :delete, SecretsDeleteRequest.optional.default(nil) - attribute :sync, SecretsSyncRequest.optional.default(nil) - - def to_dynamic - { - "get" => get&.to_dynamic, - "getByIds" => get_by_ids&.to_dynamic, - "create" => create&.to_dynamic, - "list" => list&.to_dynamic, - "update" => update&.to_dynamic, - "delete" => delete&.to_dynamic, - "sync" => sync&.to_dynamic, - }.compact - end - end - - class SelectiveGeneratorsCommand < GeneratorsCommand - attribute :generate_password, PasswordGeneratorRequest.optional.default(nil) - - def to_dynamic - { - "generate_password" => generate_password&.to_dynamic, - }.compact - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/projects.rb b/languages/ruby/bitwarden_sdk_secrets/lib/projects.rb deleted file mode 100644 index bf4e903c..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/projects.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -require_relative 'bitwarden_error' - -module BitwardenSDKSecrets - class ProjectsClient - def initialize(command_runner) - @command_runner = command_runner - end - - def create(organization_id, project_name) - project_create_request = ProjectCreateRequest.new( - project_create_request_name: project_name, - organization_id: organization_id - ) - command = create_command( - create: project_create_request - ) - response = parse_response(command) - - projects_response = ResponseForProjectResponse.from_json!(response).to_dynamic - - if projects_response.key?('success') && projects_response['success'] == true && - projects_response.key?('data') - return projects_response['data'] - end - - error_response(projects_response) - end - - def get(project_id) - project_get_request = ProjectGetRequest.new(id: project_id) - command = create_command(get: project_get_request) - response = parse_response(command) - - projects_response = ResponseForProjectResponse.from_json!(response).to_dynamic - - if projects_response.key?('success') && projects_response['success'] == true && - projects_response.key?('data') - return projects_response['data'] - end - - error_response(projects_response) - end - - def list(organization_id) - project_list_request = ProjectsListRequest.new(organization_id: organization_id) - command = create_command(list: project_list_request) - response = parse_response(command) - - projects_response = ResponseForProjectsResponse.from_json!(response).to_dynamic - - if projects_response.key?('success') && projects_response['success'] == true && - projects_response.key?('data') && projects_response['data'].key?('data') - return projects_response['data']['data'] - end - - error_response(projects_response) - end - - def update(organization_id, id, project_put_request_name) - project_put_request = ProjectPutRequest.new( - id: id, - project_put_request_name: project_put_request_name, - organization_id: organization_id - ) - command = create_command( - update: project_put_request - ) - response = parse_response(command) - - projects_response = ResponseForProjectResponse.from_json!(response).to_dynamic - - if projects_response.key?('success') && projects_response['success'] == true && - projects_response.key?('data') - return projects_response['data'] - end - - error_response(projects_response) - end - - def delete(ids) - project_delete_request = ProjectsDeleteRequest.new(ids: ids) - command = create_command(delete: project_delete_request) - response = parse_response(command) - - projects_response = ResponseForProjectsDeleteResponse.from_json!(response).to_dynamic - - if projects_response.key?('success') && projects_response['success'] == true && - projects_response.key?('data') && projects_response['data'].key?('data') - return projects_response['data']['data'] - end - - error_response(projects_response) - end - - private - - def error_response(response) - raise BitwardenError, response['errorMessage'] if response.key?('errorMessage') - - raise BitwardenError, 'Error while getting response' - end - - def create_command(commands) - SelectiveCommand.new(projects: SelectiveProjectsCommand.new(commands)) - end - - def parse_response(command) - response = @command_runner.run(command) - raise BitwardenError, 'Error getting response' if response.nil? - - response - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/secrets.rb b/languages/ruby/bitwarden_sdk_secrets/lib/secrets.rb deleted file mode 100644 index 5dda9883..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/secrets.rb +++ /dev/null @@ -1,140 +0,0 @@ -# frozen_string_literal: true - -require 'json' - -module BitwardenSDKSecrets - class SecretsClient - def initialize(command_runner) - @command_runner = command_runner - end - - def get(id) - command = create_command(get: SecretGetRequest.new(id: id)) - response = run_command(command) - - secrets_response = ResponseForSecretResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') - return secrets_response['data'] - end - - error_response(secrets_response) - end - - def get_by_ids(ids) - command = create_command(get_by_ids: SecretsGetRequest.new(ids: ids)) - response = run_command(command) - - secrets_response = ResponseForSecretIdentifiersResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') && secrets_response['data'].key?('data') - return secrets_response['data']['data'] - end - - error_response(secrets_response) - end - - def sync(organization_id, last_synced_date) - command = create_command( - sync: SecretsSyncRequest.new(organization_id: organization_id, last_synced_date: last_synced_date) - ) - response = run_command(command) - - secrets_response = ResponseForSecretsSyncResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') - return secrets_response['data'] - end - - error_response(secrets_response) - end - - def create(organization_id, key, value, note, project_ids) - command = create_command( - create: SecretCreateRequest.new( - key: key, note: note, organization_id: organization_id, project_ids: project_ids, value: value - ) - ) - response = run_command(command) - - secrets_response = ResponseForSecretResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') - return secrets_response['data'] - end - - error_response(secrets_response) - end - - def list(organization_id) - command = create_command(list: SecretIdentifiersRequest.new(organization_id: organization_id)) - response = run_command(command) - - secrets_response = ResponseForSecretIdentifiersResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') && secrets_response['data'].key?('data') - return secrets_response['data']['data'] - end - - error_response(secrets_response) - end - - def update(organization_id, id, key, value, note, project_ids) - command = create_command( - update: SecretPutRequest.new( - id: id, key: key, note: note, organization_id: organization_id, project_ids: project_ids, value: value - ) - ) - response = run_command(command) - - secrets_response = ResponseForSecretResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') - return secrets_response['data'] - end - - error_response(secrets_response) - end - - def delete(ids) - command = create_command(delete: SecretsDeleteRequest.new(ids: ids)) - response = run_command(command) - - secrets_response = ResponseForSecretsDeleteResponse.from_json!(response).to_dynamic - - if secrets_response.key?('success') && secrets_response['success'] == true && - secrets_response.key?('data') && secrets_response['data'].key?('data') - return secrets_response['data']['data'] - end - - error_response(secrets_response) - end - - private - - def error_response(response) - if response['errorMessage'] - raise BitwardenError, response['errorMessage'] if response.key?('errorMessage') - else - raise BitwardenError, 'Error while getting response' - end - end - - def create_command(commands) - SelectiveCommand.new(secrets: SelectiveSecretsCommand.new(commands)) - end - - def run_command(command) - response = @command_runner.run(command) - raise BitwardenError, 'Error getting response' if response.nil? - - response - end - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/lib/version.rb b/languages/ruby/bitwarden_sdk_secrets/lib/version.rb deleted file mode 100644 index 39b47b47..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/lib/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -module BitwardenSDKSecrets - VERSION = '1.0.0' -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/auth.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/auth.rbs deleted file mode 100644 index 4e75cf4c..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/auth.rbs +++ /dev/null @@ -1,9 +0,0 @@ -module BitwardenSDKSecrets - class AuthClient - @command_runner: untyped - - def initialize: (untyped command_runner) -> void - - def login_access_token: (untyped access_token, ?untyped? state_file) -> nil - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden-sdk-secrets.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden-sdk-secrets.rbs deleted file mode 100644 index ffca59e6..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden-sdk-secrets.rbs +++ /dev/null @@ -1,39 +0,0 @@ -module BitwardenSDKSecrets - class BitwardenSettings - @api_url: untyped - - @identity_url: untyped - - attr_accessor api_url: untyped - - attr_accessor identity_url: untyped - - def initialize: (untyped api_url, untyped identity_url) -> void - end - - class BitwardenClient - @bitwarden: untyped - - @handle: untyped - - @command_runner: untyped - - @projects: untyped - - @secrets: untyped - - @auth: untyped - - attr_reader bitwarden: untyped - - attr_reader projects: untyped - - attr_reader secrets: untyped - - attr_reader auth: untyped - - def initialize: (untyped bitwarden_settings) -> void - - def free_mem: () -> untyped - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_error.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_error.rbs deleted file mode 100644 index 99c60f48..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_error.rbs +++ /dev/null @@ -1,5 +0,0 @@ -module BitwardenSDKSecrets - class BitwardenError < StandardError - def initialize: (?::String message) -> void - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_lib.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_lib.rbs deleted file mode 100644 index 6038fbf0..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/bitwarden_lib.rbs +++ /dev/null @@ -1,7 +0,0 @@ -module BitwardenSDKSecrets - module BitwardenLib - extend FFI::Library - - def self.mac_with_intel?: () -> untyped - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/command_runner.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/command_runner.rbs deleted file mode 100644 index 48367907..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/command_runner.rbs +++ /dev/null @@ -1,12 +0,0 @@ -module BitwardenSDKSecrets - class CommandRunner - @bitwarden_sdk: untyped - - @handle: untyped - - def initialize: (untyped bitwarden_sdk, untyped handle) -> void - - # @param [Dry-Struct] cmd - def run: (untyped cmd) -> untyped - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/projects.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/projects.rbs deleted file mode 100644 index e68df3d5..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/projects.rbs +++ /dev/null @@ -1,25 +0,0 @@ -module BitwardenSDKSecrets - class ProjectsClient - @command_runner: untyped - - def initialize: (untyped command_runner) -> void - - def create: (untyped organization_id, untyped project_name) -> untyped - - def get: (untyped project_id) -> untyped - - def list: (untyped organization_id) -> untyped - - def update: (untyped organization_id, untyped id, untyped project_put_request_name) -> untyped - - def delete: (untyped ids) -> untyped - - private - - def error_response: (untyped response) -> untyped - - def create_command: (untyped commands) -> untyped - - def parse_response: (untyped command) -> untyped - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/secrets.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/secrets.rbs deleted file mode 100644 index 8590fd82..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/secrets.rbs +++ /dev/null @@ -1,29 +0,0 @@ -module BitwardenSDKSecrets - class SecretsClient - @command_runner: untyped - - def initialize: (untyped command_runner) -> void - - def get: (untyped id) -> untyped - - def get_by_ids: (untyped ids) -> untyped - - def sync: (untyped organization_id, untyped last_synced_date) -> untyped - - def create: (untyped organization_id, untyped key, untyped value, untyped note, untyped project_ids) -> untyped - - def list: (untyped organization_id) -> untyped - - def update: (untyped organization_id, untyped id, untyped key, untyped value, untyped note, untyped project_ids) -> untyped - - def delete: (untyped ids) -> untyped - - private - - def error_response: (untyped response) -> (untyped | nil | untyped) - - def create_command: (untyped commands) -> untyped - - def run_command: (untyped command) -> untyped - end -end diff --git a/languages/ruby/bitwarden_sdk_secrets/sig/version.rbs b/languages/ruby/bitwarden_sdk_secrets/sig/version.rbs deleted file mode 100644 index 869b679d..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/sig/version.rbs +++ /dev/null @@ -1,3 +0,0 @@ -module BitwardenSDKSecrets - VERSION: "0.2.0" -end diff --git a/languages/ruby/bitwarden_sdk_secrets/spec/settings_spec.rb b/languages/ruby/bitwarden_sdk_secrets/spec/settings_spec.rb deleted file mode 100644 index 9db0e340..00000000 --- a/languages/ruby/bitwarden_sdk_secrets/spec/settings_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'schemas' -require 'extended_schemas/schemas' - -describe ClientSettings do - it "test" do - client_settings = ClientSettings.new( - api_url: nil, - identity_url: nil, - user_agent: 'Bitwarden RUBY-SDK', - device_type: nil - ) - - expect(client_settings.to_dynamic.compact.to_json).to eq('{"userAgent":"Bitwarden RUBY-SDK"}') - end -end diff --git a/languages/ruby/examples/example.rb b/languages/ruby/examples/example.rb deleted file mode 100644 index 29a68670..00000000 --- a/languages/ruby/examples/example.rb +++ /dev/null @@ -1,77 +0,0 @@ -# NOTE - for example purpose only - import gem instead -require 'bitwarden-sdk-secrets' - -token = ENV['ACCESS_TOKEN'] -organization_id = ENV['ORGANIZATION_ID'] -state_file = ENV['STATE_FILE'] - -# Configuring the URLS is optional, set them to nil to use the default values -api_url = ENV['API_URL'] -identity_url = ENV['IDENTITY_URL'] - -bitwarden_settings = BitwardenSDKSecrets::BitwardenSettings.new(api_url, identity_url) - -bw_client = BitwardenSDKSecrets::BitwardenClient.new(bitwarden_settings) -response = bw_client.auth.login_access_token(token, state_file) -puts response - -# CREATE project -project_name = 'Test project 1' -response = bw_client.projects.create(organization_id, project_name) -puts response -project_id = response['id'] - -# GET project -response = bw_client.projects.get(project_id) -puts response - -# LIST projects -response = bw_client.projects.list(organization_id) -puts response - -# UPDATE projects -name = 'Updated test project 1' -response = bw_client.projects.update(organization_id, project_id, name) -puts response - -# CREATE secret -key = 'AWS-SES' -note = 'Private account' -value = '8t27.dfj;' -response = bw_client.secrets.create(organization_id, key, value, note, [project_id]) -puts response -secret_id = response['id'] - -# GET secret -response = bw_client.secrets.get(secret_id) -puts response - -# GET secret by ids -response = bw_client.secrets.get_by_ids([secret_id]) -puts response - -# LIST secrets -response = bw_client.secrets.list(organization_id) -puts response - -# SYNC secrets -response = bw_client.secrets.sync(organization_id, nil) -last_synced_date = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%6NZ') -puts response - -response = bw_client.secrets.sync(organization_id, last_synced_date) -puts response - -# UPDATE secret -note = 'updated password' -value = '7I.ert10AjK' -response = bw_client.secrets.update(organization_id, secret_id, key, value, note, [project_id]) -puts response - -# DELETE secret -response = bw_client.secrets.delete([secret_id]) -puts response - -# DELETE project -response = bw_client.projects.delete([project_id]) -puts response diff --git a/languages/ruby/gen_ruby_typedefs.sh b/languages/ruby/gen_ruby_typedefs.sh deleted file mode 100755 index acd2bcc3..00000000 --- a/languages/ruby/gen_ruby_typedefs.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# shellcheck disable=SC3044,SC3020 - -# bail if rbs is not installed -if ! command -v rbs &>/dev/null; then - echo "rbs could not be found" - exit -fi - -# use consistent repository root to avoid relative paths -REPO_ROOT="$(git rev-parse --show-toplevel)" -pushd "$REPO_ROOT"/languages/ruby || exit - -# delete existing typedefs -rm -rf bitwarden_sdk_secrets/sig/* -mkdir -p bitwarden_sdk_secrets/sig - -# generate typedefs -RUBY_LIB_FILES="$(find bitwarden_sdk_secrets/lib -name "*.rb")" - -for file in $RUBY_LIB_FILES; do - rbs prototype rb "$file" >bitwarden_sdk_secrets/sig/"$(basename "$file" .rb).rbs" - rm -f bitwarden_sdk_secrets/sig/schemas.rbs -done - -popd || exit diff --git a/package-lock.json b/package-lock.json index 894ec74e..6dc40fe9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,16 @@ { - "name": "@bitwarden/sdk", + "name": "@bitwarden/sdk-internal", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@bitwarden/sdk", + "name": "@bitwarden/sdk-internal", "version": "0.0.0", "license": "SEE LICENSE IN LICENSE", "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.4", - "prettier": "3.3.3", - "quicktype-core": "23.0.170", - "rimraf": "6.0.1", - "ts-node": "10.9.2", - "typescript": "5.5.4" + "prettier": "3.3.3" } }, "node_modules/@babel/runtime": { @@ -22,7 +18,6 @@ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", "dev": true, - "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -30,163 +25,11 @@ "node": ">=6.9.0" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@glideapps/ts-necessities": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@glideapps/ts-necessities/-/ts-necessities-2.2.3.tgz", - "integrity": "sha512-gXi0awOZLHk3TbW55GZLCPP6O+y/b5X1pBXKBVckFONSwF1z1E5ND2BGJsghQFah+pW7pkkyFb2VhUQI2qhL5w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@lukeed/csprng": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -196,7 +39,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", "dev": true, - "license": "MIT", "peerDependencies": { "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", "axios": "^1.3.1", @@ -208,7 +50,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", "dev": true, - "license": "MIT", "dependencies": { "iterare": "1.2.1", "tslib": "2.6.2", @@ -239,7 +80,6 @@ "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", @@ -277,7 +117,6 @@ "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.0", "consola": "^2.15.0", @@ -297,7 +136,6 @@ "integrity": "sha512-4JKyrk55ohQK2FcuZbPdNvxdyXD14jjOIvE8hYjJ+E1cHbRbfXQXbYnjTODFE52Gx8eAxz8C9icuhDYDLn7nww==", "dev": true, "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { "@nestjs/axios": "3.0.2", "@nestjs/common": "10.3.0", @@ -329,90 +167,11 @@ "url": "https://opencollective.com/openapi_generator" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/agent-base": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -425,7 +184,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -441,7 +199,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -451,7 +208,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -462,26 +218,17 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true, - "license": "MIT" - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/axios": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dev": true, - "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -492,8 +239,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -513,15 +259,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, - "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -533,19 +277,11 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/browser-or-node": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-3.0.0.tgz", - "integrity": "sha512-iczIdVJzGEYhP5DqQxYM9Hh7Ztpqqi+CXZpSmX8ALFs9ecXkQIeqRyM6TfxEfMVpwhl3dSuDvxdzzo9sUOIVBQ==", - "dev": true, - "license": "MIT" - }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -565,7 +301,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -576,7 +311,6 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -592,15 +326,13 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, - "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" }, @@ -613,7 +345,6 @@ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -626,7 +357,6 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, - "license": "ISC", "engines": { "node": ">= 10" } @@ -636,7 +366,6 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -648,7 +377,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -666,24 +394,15 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8" } }, - "node_modules/collection-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collection-utils/-/collection-utils-1.0.1.tgz", - "integrity": "sha512-LA2YTIlR7biSpXkKYwwuzGjwL5rjWEZVOSnvdUc7gObvWe4WkjxOpfrdhoP7Hs09YWDVfg0Mal9BpAqLfVEzQg==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -695,15 +414,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -716,7 +433,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, - "license": "MIT", "engines": { "node": ">= 12" } @@ -725,22 +441,19 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/concurrently": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", "integrity": "sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.0", "date-fns": "^2.16.1", @@ -763,7 +476,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "tslib": "^1.9.0" }, @@ -776,7 +488,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -791,22 +502,19 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true, - "license": "0BSD" + "dev": true }, "node_modules/consola": { "version": "2.15.3", "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/console.table": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", "dev": true, - "license": "MIT", "dependencies": { "easy-table": "1.1.0" }, @@ -814,44 +522,11 @@ "node": "> 0.10" } }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.21.0" }, @@ -868,7 +543,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -886,7 +560,6 @@ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, - "license": "MIT", "dependencies": { "clone": "^1.0.2" }, @@ -899,34 +572,15 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, "node_modules/easy-table": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", "dev": true, - "license": "MIT", "optionalDependencies": { "wcwidth": ">=1.0.1" } @@ -935,15 +589,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -953,37 +605,15 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, - "license": "MIT", "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", @@ -997,15 +627,13 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -1027,7 +655,6 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -1037,42 +664,11 @@ } } }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -1087,7 +683,6 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1101,15 +696,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1120,7 +713,6 @@ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1140,15 +732,13 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1158,7 +748,6 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -1172,7 +761,6 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -1198,8 +786,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/inflight": { "version": "1.0.6", @@ -1207,7 +794,6 @@ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1217,15 +803,13 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/inquirer": { "version": "8.2.6", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", "dev": true, - "license": "MIT", "dependencies": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.1", @@ -1252,7 +836,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1262,7 +845,6 @@ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1272,7 +854,6 @@ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -1280,59 +861,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, "node_modules/iterare": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", "dev": true, - "license": "ISC", "engines": { "node": ">=6" } }, - "node_modules/jackspeak": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", - "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/js-base64": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", - "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -1344,15 +886,13 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -1364,29 +904,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", - "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true, - "license": "ISC" - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1396,7 +918,6 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -1409,7 +930,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -1419,7 +939,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1427,36 +946,23 @@ "node": "*" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -1477,7 +983,6 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } @@ -1487,7 +992,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -1503,7 +1007,6 @@ "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, - "license": "MIT", "dependencies": { "bl": "^4.1.0", "chalk": "^4.1.0", @@ -1527,85 +1030,30 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true, - "license": "(MIT AND Zlib)" - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/path-to-regexp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", - "dev": true, - "license": "MIT" - }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } + "dev": true }, "node_modules/prettier": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -1616,94 +1064,17 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true, - "license": "MIT" - }, - "node_modules/quicktype-core": { - "version": "23.0.170", - "resolved": "https://registry.npmjs.org/quicktype-core/-/quicktype-core-23.0.170.tgz", - "integrity": "sha512-ZsjveG0yJUIijUx4yQshzyQ5EAXKbFSBTQJHnJ+KoSZVxcS+m3GcmDpzrdUIRYMhgLaF11ZGvLSYi5U0xcwemw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@glideapps/ts-necessities": "2.2.3", - "browser-or-node": "^3.0.0", - "collection-utils": "^1.0.1", - "cross-fetch": "^4.0.0", - "is-url": "^1.2.4", - "js-base64": "^3.7.7", - "lodash": "^4.17.21", - "pako": "^1.0.6", - "pluralize": "^8.0.0", - "readable-stream": "4.5.2", - "unicode-properties": "^1.4.1", - "urijs": "^1.19.1", - "wordwrap": "^1.0.0", - "yaml": "^2.4.1" - } - }, - "node_modules/quicktype-core/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/quicktype-core/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } + "dev": true }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1717,22 +1088,19 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", - "dev": true, - "license": "Apache-2.0" + "dev": true }, "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1742,7 +1110,6 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, - "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -1751,82 +1118,11 @@ "node": ">=8" } }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1836,7 +1132,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } @@ -1859,45 +1154,19 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "license": "MIT" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "dev": true }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/spawn-command": { "version": "0.0.2", @@ -1910,7 +1179,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } @@ -1920,23 +1188,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1951,21 +1202,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1978,7 +1214,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1990,22 +1225,13 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tiny-inflate": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", - "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, - "license": "MIT", "dependencies": { "os-tmpdir": "~1.0.2" }, @@ -2017,76 +1243,28 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, - "license": "MIT", "bin": { "tree-kill": "cli.js" } }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true, - "license": "0BSD" + "dev": true }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2094,26 +1272,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/uid": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", "dev": true, - "license": "MIT", "dependencies": { "@lukeed/csprng": "^1.0.0" }, @@ -2121,80 +1284,26 @@ "node": ">=8" } }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/unicode-properties": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", - "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", - "dev": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.0", - "unicode-trie": "^2.0.0" - } - }, - "node_modules/unicode-trie": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", - "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "pako": "^0.2.5", - "tiny-inflate": "^1.0.0" - } - }, - "node_modules/unicode-trie/node_modules/pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", - "dev": true, - "license": "MIT" - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 10.0.0" } }, - "node_modules/urijs": { - "version": "1.19.11", - "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz", - "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", - "dev": true, - "license": "MIT" - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, - "license": "MIT", "dependencies": { "defaults": "^1.0.3" } @@ -2203,49 +1312,23 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true, - "license": "BSD-2-Clause" + "dev": true }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, - "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "license": "MIT" - }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2255,61 +1338,26 @@ "node": ">=8" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } }, - "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, - "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -2328,20 +1376,9 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } } } } diff --git a/package.json b/package.json index e7e41946..cc269591 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "@bitwarden/sdk", + "name": "@bitwarden/sdk-internal", "version": "0.0.0", "description": "", - "homepage": "https://github.com/bitwarden/sdk#readme", + "homepage": "https://github.com/bitwarden/sdk-internal#readme", "bugs": { - "url": "https://github.com/bitwarden/sdk/issues" + "url": "https://github.com/bitwarden/sdk-internal/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/bitwarden/sdk.git" + "url": "git+https://github.com/bitwarden/sdk-internal.git" }, "license": "SEE LICENSE IN LICENSE", "author": "Bitwarden Inc. (https://bitwarden.com)", @@ -16,15 +16,10 @@ "scripts": { "lint": "prettier --check .", "prettier": "prettier --write .", - "schemas": "rimraf ./support/schemas && cargo run --bin sdk-schemas --all-features && ts-node ./support/scripts/schemas.ts", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.13.4", - "prettier": "3.3.3", - "quicktype-core": "23.0.170", - "rimraf": "6.0.1", - "ts-node": "10.9.2", - "typescript": "5.5.4" + "prettier": "3.3.3" } } diff --git a/sig/bitwarden_sdk/bitwarden_client.rbs b/sig/bitwarden_sdk/bitwarden_client.rbs deleted file mode 100644 index 1ff97eb9..00000000 --- a/sig/bitwarden_sdk/bitwarden_client.rbs +++ /dev/null @@ -1,5 +0,0 @@ -module BitwardenSDK - class BitwardenClient - attr_reader project_client: ProjectsClient - end -end diff --git a/support/scripts/schemas.ts b/support/scripts/schemas.ts deleted file mode 100644 index 873a9de7..00000000 --- a/support/scripts/schemas.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { - quicktype, - quicktypeMultiFile, - InputData, - JSONSchemaInput, - FetchingJSONSchemaStore, -} from "quicktype-core"; - -import fs from "fs"; - -async function main() { - const schemaInput = new JSONSchemaInput(new FetchingJSONSchemaStore()); - const inputData = new InputData(); - inputData.addInput(schemaInput); - inputData.addSource( - "schema", - { - name: "SchemaTypes", - uris: ["support/schemas/schema_types/SchemaTypes.json#/definitions/"], - }, - () => new JSONSchemaInput(new FetchingJSONSchemaStore()), - ); - - const ts = await quicktype({ - inputData, - lang: "typescript", - rendererOptions: {}, - }); - - writeToFile("./languages/js/sdk-client/src/schemas.ts", ts.lines); - writeToFile("./crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts", ts.lines); - - const python = await quicktype({ - inputData, - lang: "python", - rendererOptions: { - "python-version": "3.7", - }, - }); - - writeToFile("./languages/python/bitwarden_sdk/schemas.py", python.lines); - - const ruby = await quicktype({ - inputData, - lang: "ruby", - rendererOptions: { - "ruby-version": "3.0", - }, - }); - - writeToFile("./languages/ruby/bitwarden_sdk_secrets/lib/schemas.rb", ruby.lines); - - const csharp = await quicktype({ - inputData, - lang: "csharp", - rendererOptions: { - namespace: "Bitwarden.Sdk", - framework: "SystemTextJson", - "csharp-version": "6", - }, - }); - - writeToFile("./languages/csharp/Bitwarden.Sdk/schemas.cs", csharp.lines); - - const cpp = await quicktype({ - inputData, - lang: "cpp", - rendererOptions: { - namespace: "Bitwarden::Sdk", - "include-location": "global-include", - }, - }); - - cpp.lines.forEach((line, idx) => { - // Replace DOMAIN for URI_DOMAIN, because DOMAIN is an already defined macro - cpp.lines[idx] = line.replace(/DOMAIN/g, "URI_DOMAIN"); - }); - - writeToFile("./languages/cpp/include/schemas.hpp", cpp.lines); - - const go = await quicktype({ - inputData, - lang: "go", - rendererOptions: { - package: "sdk", - "omit-empty": true, - }, - }); - - writeToFile("./languages/go/schema.go", go.lines); - - const java = await quicktypeMultiFile({ - inputData, - lang: "java", - rendererOptions: { - package: "com.bitwarden.sdk.schema", - "java-version": "8", - }, - }); - - const javaDir = "./languages/java/src/main/java/com/bitwarden/sdk/schema/"; - if (!fs.existsSync(javaDir)) { - fs.mkdirSync(javaDir); - } - java.forEach((file, path) => { - writeToFile(javaDir + path, file.lines); - }); - - const php = await quicktype({ - inputData, - lang: "php", - inferUuids: false, - inferDateTimes: false, - rendererOptions: { - "acronym-style": "camel", - "with-get": false, - }, - }); - - const phpDir = "./languages/php/src/Schemas/"; - if (!fs.existsSync(phpDir)) { - fs.mkdirSync(phpDir); - } - - php.lines.splice(1, 0, "namespace Bitwarden\\Sdk\\Schemas;", "use stdClass;", "use Exception;"); - - writeToFile("./languages/php/src/Schemas/Schemas.php", php.lines); -} - -main(); - -function writeToFile(filename: string, lines: string[]) { - const output = fs.createWriteStream(filename); - lines.forEach((line) => { - output.write(line + "\n"); - }); - output.close(); -} From 43e5ae9165732ffb0b79a9fa6b9866b679d881f0 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 11 Oct 2024 15:32:44 +0200 Subject: [PATCH 09/39] Remove direct dependency to bitwarden in wasm-internal (#1131) In preparation for the bitwarden crate being removes we can stop depending on it in wasm-internal. --- Cargo.lock | 2 +- crates/bitwarden-wasm-internal/Cargo.toml | 2 +- crates/bitwarden-wasm-internal/src/client.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6ca566f..9f8552b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,7 @@ dependencies = [ name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ - "bitwarden", + "bitwarden-core", "console_error_panic_hook", "console_log", "js-sys", diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index b18e412c..e943daca 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -15,7 +15,7 @@ keywords.workspace = true crate-type = ["cdylib"] [dependencies] -bitwarden = { workspace = true, features = ["wasm"] } +bitwarden-core = { workspace = true, features = ["wasm", "internal"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 994af1fc..8f2fa80d 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -1,7 +1,7 @@ extern crate console_error_panic_hook; use std::rc::Rc; -use bitwarden::{Client, ClientSettings}; +use bitwarden_core::{Client, ClientSettings}; use log::{set_max_level, Level}; use wasm_bindgen::prelude::*; From 639667c81f4ffef96f6c4bf40aa25bbb4349a990 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:38:29 +0200 Subject: [PATCH 10/39] [deps]: Lock file maintenance (#1139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. đŸ‘ģ **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 52 +++++++++++++++++++++++------------------------ package-lock.json | 6 +++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f8552b6..678c86e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -784,9 +784,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -855,9 +855,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -2210,9 +2210,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2383,9 +2383,9 @@ dependencies = [ [[package]] name = "napi" -version = "2.16.11" +version = "2.16.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53575dfa17f208dd1ce3a2da2da4659aae393b256a472f2738a8586a6c4107fd" +checksum = "3a84fdaf64da2b2d86b1be5db1b81963353bf00f7bef4b9e2668bbe6f72e8eb3" dependencies = [ "bitflags 2.6.0", "ctor", @@ -2917,9 +2917,9 @@ source = "git+https://github.com/bitwarden/passkey-rs?rev=ff757604cd7b4e8f321ed1 [[package]] name = "pyo3" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" +checksum = "00e89ce2565d6044ca31a3eb79a334c3a79a841120a98f64eea9f579564cb691" dependencies = [ "cfg-if", "indoc", @@ -2935,9 +2935,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" +checksum = "d8afbaf3abd7325e08f35ffb8deb5892046fcb2608b703db6a583a5ba4cea01e" dependencies = [ "once_cell", "target-lexicon", @@ -2945,9 +2945,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" +checksum = "ec15a5ba277339d04763f4c23d85987a5b08cbb494860be141e6a10a8eb88022" dependencies = [ "libc", "pyo3-build-config", @@ -2966,9 +2966,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" +checksum = "15e0f01b5364bcfbb686a52fc4181d412b708a68ed20c330db9fc8d2c2bf5a43" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -2978,9 +2978,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" +checksum = "a09b550200e1e5ed9176976d0060cbc2ea82dc8515da07885e7b8153a85caacb" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4531,9 +4531,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4572,9 +4572,9 @@ checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93d2a9ae98f1af8953f6415397299d808cce0a24f6d7c613d27bd83edf98da8" +checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" dependencies = [ "console_error_panic_hook", "js-sys", @@ -4587,9 +4587,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8b294691f640bad8f2bb35a11bb28272701b1d687bd5fd661a27684e894d4d" +checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", @@ -4598,9 +4598,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/package-lock.json b/package-lock.json index 894ec74e..e41dd2a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2292,9 +2292,9 @@ } }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", "dev": true, "license": "ISC", "bin": { From a0f45304563e6c02471012801f5a9bd7f70c1f2c Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 14 Oct 2024 14:44:31 +0200 Subject: [PATCH 11/39] [PM-11764] Implement account switching and sdk initialization (#1116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking ## 📔 Objective - Expose crypto client - Add error handling ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- Cargo.lock | 6 ++++ crates/bitwarden-core/src/mobile/crypto.rs | 6 ++++ crates/bitwarden-crypto/Cargo.toml | 3 ++ .../src/enc_string/asymmetric.rs | 7 +++- .../src/enc_string/symmetric.rs | 6 ++++ .../bitwarden-crypto/src/keys/master_key.rs | 3 ++ crates/bitwarden-vault/Cargo.toml | 3 ++ crates/bitwarden-vault/src/folder.rs | 4 +++ crates/bitwarden-wasm-internal/Cargo.toml | 2 ++ crates/bitwarden-wasm-internal/src/client.rs | 12 ++++++- crates/bitwarden-wasm-internal/src/crypto.rs | 33 +++++++++++++++++++ .../src/custom_types.rs | 22 +++++++++++++ crates/bitwarden-wasm-internal/src/error.js | 13 ++++++++ crates/bitwarden-wasm-internal/src/error.rs | 27 +++++++++++++++ crates/bitwarden-wasm-internal/src/lib.rs | 8 +++++ .../src/vault/folders.rs | 24 ++++++++++++++ .../bitwarden-wasm-internal/src/vault/mod.rs | 24 ++++++++++++++ languages/js/sdk-internal/.gitignore | 1 + 18 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 crates/bitwarden-wasm-internal/src/crypto.rs create mode 100644 crates/bitwarden-wasm-internal/src/custom_types.rs create mode 100644 crates/bitwarden-wasm-internal/src/error.js create mode 100644 crates/bitwarden-wasm-internal/src/error.rs create mode 100644 crates/bitwarden-wasm-internal/src/vault/folders.rs create mode 100644 crates/bitwarden-wasm-internal/src/vault/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 678c86e5..e9b7646b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -475,8 +475,10 @@ dependencies = [ "sha2", "subtle", "thiserror", + "tsify-next", "uniffi", "uuid", + "wasm-bindgen", "zeroize", ] @@ -656,8 +658,10 @@ dependencies = [ "sha2", "thiserror", "tokio", + "tsify-next", "uniffi", "uuid", + "wasm-bindgen", ] [[package]] @@ -682,6 +686,8 @@ name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ "bitwarden-core", + "bitwarden-crypto", + "bitwarden-vault", "console_error_panic_hook", "console_log", "js-sys", diff --git a/crates/bitwarden-core/src/mobile/crypto.rs b/crates/bitwarden-core/src/mobile/crypto.rs index 2aae903c..1b027df4 100644 --- a/crates/bitwarden-core/src/mobile/crypto.rs +++ b/crates/bitwarden-core/src/mobile/crypto.rs @@ -6,6 +6,8 @@ use bitwarden_crypto::{ }; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use crate::{ client::{encryption_settings::EncryptionSettingsError, LoginMethod, UserLoginMethod}, @@ -16,6 +18,7 @@ use crate::{ #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct InitUserCryptoRequest { /// The user's KDF parameters, as received from the prelogin request pub kdf_params: Kdf, @@ -30,6 +33,7 @@ pub struct InitUserCryptoRequest { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum InitUserCryptoMethod { Password { /// The user's master password @@ -73,6 +77,7 @@ pub enum InitUserCryptoMethod { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum AuthRequestMethod { UserKey { /// User Key protected by the private key provided in `AuthRequestResponse`. @@ -185,6 +190,7 @@ pub async fn initialize_user_crypto( #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct InitOrgCryptoRequest { /// The encryption keys for all the organizations the user is a part of pub organization_keys: HashMap, diff --git a/crates/bitwarden-crypto/Cargo.toml b/crates/bitwarden-crypto/Cargo.toml index 3254640f..7671a776 100644 --- a/crates/bitwarden-crypto/Cargo.toml +++ b/crates/bitwarden-crypto/Cargo.toml @@ -15,6 +15,7 @@ keywords.workspace = true [features] default = [] +wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support uniffi = ["dep:uniffi"] # Uniffi bindings no-memory-hardening = [] # Disable memory hardening features @@ -42,8 +43,10 @@ sha1 = ">=0.10.5, <0.11" sha2 = ">=0.10.6, <0.11" subtle = ">=2.5.0, <3.0" thiserror = { workspace = true } +tsify-next = { workspace = true, optional = true } uniffi = { workspace = true, optional = true } uuid = { workspace = true } +wasm-bindgen = { workspace = true, optional = true } zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] } [dev-dependencies] diff --git a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs index f9bda838..9d4f0d63 100644 --- a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs @@ -11,11 +11,16 @@ use crate::{ rsa::encrypt_rsa2048_oaep_sha1, AsymmetricCryptoKey, AsymmetricEncryptable, KeyDecryptable, }; - // This module is a workaround to avoid deprecated warnings that come from the ZeroizeOnDrop // macro expansion #[allow(deprecated)] mod internal { + #[cfg(feature = "wasm")] + #[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] + const TS_CUSTOM_TYPES: &'static str = r#" + export type AsymmetricEncString = string; + "#; + /// # Encrypted string primitive /// /// [AsymmetricEncString] is a Bitwarden specific primitive that represents an asymmetrically diff --git a/crates/bitwarden-crypto/src/enc_string/symmetric.rs b/crates/bitwarden-crypto/src/enc_string/symmetric.rs index 1fc9b3a9..69711f74 100644 --- a/crates/bitwarden-crypto/src/enc_string/symmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/symmetric.rs @@ -11,6 +11,12 @@ use crate::{ KeyDecryptable, KeyEncryptable, LocateKey, SymmetricCryptoKey, }; +#[cfg(feature = "wasm")] +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +const TS_CUSTOM_TYPES: &'static str = r#" +export type EncString = string; +"#; + /// # Encrypted string primitive /// /// [EncString] is a Bitwarden specific primitive that represents a symmetrically encrypted string. diff --git a/crates/bitwarden-crypto/src/keys/master_key.rs b/crates/bitwarden-crypto/src/keys/master_key.rs index fc9762c3..7a1e4959 100644 --- a/crates/bitwarden-crypto/src/keys/master_key.rs +++ b/crates/bitwarden-crypto/src/keys/master_key.rs @@ -5,6 +5,8 @@ use generic_array::{typenum::U32, GenericArray}; use rand::Rng; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use super::utils::{derive_kdf_key, stretch_kdf_key}; use crate::{util, CryptoError, EncString, KeyDecryptable, Result, SymmetricCryptoKey, UserKey}; @@ -16,6 +18,7 @@ use crate::{util, CryptoError, EncString, KeyDecryptable, Result, SymmetricCrypt #[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum Kdf { PBKDF2 { iterations: NonZeroU32, diff --git a/crates/bitwarden-vault/Cargo.toml b/crates/bitwarden-vault/Cargo.toml index 4c41e139..3c7757e2 100644 --- a/crates/bitwarden-vault/Cargo.toml +++ b/crates/bitwarden-vault/Cargo.toml @@ -19,6 +19,7 @@ uniffi = [ "bitwarden-crypto/uniffi", "dep:uniffi", ] # Uniffi bindings +wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support [dependencies] base64 = ">=0.22.1, <0.23" @@ -38,6 +39,8 @@ sha2 = ">=0.10.6, <0.11" thiserror = { workspace = true } uniffi = { version = "=0.28.1", optional = true } uuid = { workspace = true } +tsify-next = { workspace = true, optional = true } +wasm-bindgen = { workspace = true, optional = true } [dev-dependencies] tokio = { workspace = true, features = ["rt"] } diff --git a/crates/bitwarden-vault/src/folder.rs b/crates/bitwarden-vault/src/folder.rs index c5ab1401..f57b8ee1 100644 --- a/crates/bitwarden-vault/src/folder.rs +++ b/crates/bitwarden-vault/src/folder.rs @@ -7,12 +7,15 @@ use chrono::{DateTime, Utc}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use uuid::Uuid; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use crate::VaultParseError; #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct Folder { id: Option, name: EncString, @@ -22,6 +25,7 @@ pub struct Folder { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct FolderView { pub id: Option, pub name: String, diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index e943daca..33f8128e 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -16,6 +16,8 @@ crate-type = ["cdylib"] [dependencies] bitwarden-core = { workspace = true, features = ["wasm", "internal"] } +bitwarden-crypto = { workspace = true, features = ["wasm"] } +bitwarden-vault = { workspace = true, features = ["wasm"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 8f2fa80d..ac7779b2 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -5,6 +5,8 @@ use bitwarden_core::{Client, ClientSettings}; use log::{set_max_level, Level}; use wasm_bindgen::prelude::*; +use crate::{vault::ClientVault, ClientCrypto}; + #[wasm_bindgen] pub enum LogLevel { Trace, @@ -27,7 +29,7 @@ fn convert_level(level: LogLevel) -> Level { // Rc<...> is to avoid needing to take ownership of the Client during our async run_command // function https://github.com/rustwasm/wasm-bindgen/issues/2195#issuecomment-799588401 #[wasm_bindgen] -pub struct BitwardenClient(Rc); +pub struct BitwardenClient(pub(crate) Rc); #[wasm_bindgen] impl BitwardenClient { @@ -54,4 +56,12 @@ impl BitwardenClient { res.text().await.map_err(|e| e.to_string()) } + + pub fn crypto(&self) -> ClientCrypto { + ClientCrypto::new(self.0.clone()) + } + + pub fn vault(&self) -> ClientVault { + ClientVault::new(self.0.clone()) + } } diff --git a/crates/bitwarden-wasm-internal/src/crypto.rs b/crates/bitwarden-wasm-internal/src/crypto.rs new file mode 100644 index 00000000..f1b58196 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/crypto.rs @@ -0,0 +1,33 @@ +use std::rc::Rc; + +use bitwarden_core::{ + mobile::crypto::{InitOrgCryptoRequest, InitUserCryptoRequest}, + Client, +}; +use wasm_bindgen::prelude::*; + +use crate::error::Result; + +#[wasm_bindgen] +pub struct ClientCrypto(Rc); + +impl ClientCrypto { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientCrypto { + /// Initialization method for the user crypto. Needs to be called before any other crypto + /// operations. + pub async fn initialize_user_crypto(&self, req: InitUserCryptoRequest) -> Result<()> { + Ok(self.0.crypto().initialize_user_crypto(req).await?) + } + + /// Initialization method for the organization crypto. Needs to be called after + /// `initialize_user_crypto` but before any other crypto operations. + pub async fn initialize_org_crypto(&self, req: InitOrgCryptoRequest) -> Result<()> { + Ok(self.0.crypto().initialize_org_crypto(req).await?) + } +} diff --git a/crates/bitwarden-wasm-internal/src/custom_types.rs b/crates/bitwarden-wasm-internal/src/custom_types.rs new file mode 100644 index 00000000..8d20bf85 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/custom_types.rs @@ -0,0 +1,22 @@ +/// This file contains custom TypeScript for types defined by external crates. +/// Everything in the string below is appended to the generated TypeScript definition file. +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +const TS_CUSTOM_TYPES: &'static str = r#" +export type Uuid = string; + +/** + * RFC3339 compliant date-time string. + * @typeParam T - Not used in JavaScript. + */ +export type DateTime = string; + +/** + * UTC date-time string. Not used in JavaScript. + */ +export type Utc = unknown; + +/** + * An integer that is known not to equal zero. + */ +export type NonZeroU32 = number; +"#; diff --git a/crates/bitwarden-wasm-internal/src/error.js b/crates/bitwarden-wasm-internal/src/error.js new file mode 100644 index 00000000..cd3d3a34 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/error.js @@ -0,0 +1,13 @@ +/** + * Error thrown by the WASM module. + * @param {string} message - Error message. + * @extends Error + */ +class WasmError extends Error { + constructor(message) { + super(message); + this.name = "WasmError"; + } +} + +exports.WasmError = WasmError; diff --git a/crates/bitwarden-wasm-internal/src/error.rs b/crates/bitwarden-wasm-internal/src/error.rs new file mode 100644 index 00000000..2750d262 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/error.rs @@ -0,0 +1,27 @@ +use wasm_bindgen::prelude::*; + +// Importing an error class defined in JavaScript instead of defining it in Rust +// allows us to extend the `Error` class. It also provides much better console output. +#[wasm_bindgen(module = "/src/error.js")] +extern "C" { + type WasmError; + + #[wasm_bindgen(constructor)] + fn new(message: String) -> WasmError; +} + +pub type Result = std::result::Result; + +pub struct GenericError(pub String); + +impl From for GenericError { + fn from(error: T) -> Self { + GenericError(error.to_string()) + } +} + +impl From for JsValue { + fn from(error: GenericError) -> Self { + WasmError::new(error.0).into() + } +} diff --git a/crates/bitwarden-wasm-internal/src/lib.rs b/crates/bitwarden-wasm-internal/src/lib.rs index b79c47fc..6367ff31 100644 --- a/crates/bitwarden-wasm-internal/src/lib.rs +++ b/crates/bitwarden-wasm-internal/src/lib.rs @@ -1 +1,9 @@ mod client; +mod crypto; +mod custom_types; +mod error; +mod vault; + +pub use client::BitwardenClient; +pub use crypto::ClientCrypto; +pub use vault::{folders::ClientFolders, ClientVault}; diff --git a/crates/bitwarden-wasm-internal/src/vault/folders.rs b/crates/bitwarden-wasm-internal/src/vault/folders.rs new file mode 100644 index 00000000..65289269 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/vault/folders.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; + +use bitwarden_core::Client; +use bitwarden_vault::{ClientVaultExt, Folder, FolderView}; +use wasm_bindgen::prelude::*; + +use crate::error::Result; + +#[wasm_bindgen] +pub struct ClientFolders(Rc); + +impl ClientFolders { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientFolders { + /// Decrypt folder + pub fn decrypt(&self, folder: Folder) -> Result { + Ok(self.0.vault().folders().decrypt(folder)?) + } +} diff --git a/crates/bitwarden-wasm-internal/src/vault/mod.rs b/crates/bitwarden-wasm-internal/src/vault/mod.rs new file mode 100644 index 00000000..11db0e13 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/vault/mod.rs @@ -0,0 +1,24 @@ +pub mod folders; + +use std::rc::Rc; + +use bitwarden_core::Client; +use wasm_bindgen::prelude::*; + +use crate::ClientFolders; + +#[wasm_bindgen] +pub struct ClientVault(Rc); + +impl ClientVault { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientVault { + pub fn folders(&self) -> ClientFolders { + ClientFolders::new(self.0.clone()) + } +} diff --git a/languages/js/sdk-internal/.gitignore b/languages/js/sdk-internal/.gitignore index ef69b9de..99cddcd2 100644 --- a/languages/js/sdk-internal/.gitignore +++ b/languages/js/sdk-internal/.gitignore @@ -1,3 +1,4 @@ +**/snippets/**/*.js bitwarden_wasm_internal_bg.js bitwarden_wasm_internal_bg.wasm bitwarden_wasm_internal_bg.wasm.d.ts From d094901a8badd3f84e1173440839c58639c3bbe6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:37:12 +0200 Subject: [PATCH 12/39] [deps]: Update @openapitools/openapi-generator-cli to v2.14.0 (#1007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@openapitools/openapi-generator-cli](https://redirect.github.com/OpenAPITools/openapi-generator-cli) | [`2.13.4` -> `2.14.0`](https://renovatebot.com/diffs/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@openapitools%2fopenapi-generator-cli/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@openapitools%2fopenapi-generator-cli/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
OpenAPITools/openapi-generator-cli (@​openapitools/openapi-generator-cli) ### [`v2.14.0`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.14.0) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.13...v2.14.0) ##### Features - **config schema:** add openapi-normalizer generator property ([#​830](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/830)) ([c91d116](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/c91d116a1fe4b8ed9270c4546447173b0af1e6ab)) ### [`v2.13.13`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.13) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.12...v2.13.13) ##### Bug Fixes - update `glob` package ([#​828](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/828)) ([4d88fe2](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/4d88fe2c1c9c23097b197cbb1161fcf827a81770)) ### [`v2.13.12`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.12) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.11...v2.13.12) ##### Bug Fixes - **deps:** update dependency axios to v1.7.7 ([#​817](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/817)) ([f5b3ede](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/f5b3eded0a6b7b4a5761deb6dec6287fb670d014)) ### [`v2.13.11`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.11) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.10...v2.13.11) ##### Bug Fixes - **deps:** update dependency tslib to v2.7.0 ([#​810](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/810)) ([d800f75](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/d800f75d9b4c77f78e8f3e7cf082ed3f36add0bd)) ### [`v2.13.10`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.10) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.9...v2.13.10) ##### Bug Fixes - **deps:** update dependency https-proxy-agent to v7.0.5 ([#​800](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/800)) ([e8226d8](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/e8226d8e2f92da5649e5e679dcd155f69464205c)) ### [`v2.13.9`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.9) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.8...v2.13.9) ##### Bug Fixes - **[#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802):** better error handling ([#​812](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/812)) ([1879a1e](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/1879a1eda21a7757ce0eab748d381d985e52d792)), closes [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) ### [`v2.13.8`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.8) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.7...v2.13.8) ##### Bug Fixes - **[#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802):** add fallback to default versions if search returns errors ([#​811](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/811)) ([129c002](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/129c00259d9f842f42b1772cc6baf1eef73ac797)), closes [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) ### [`v2.13.7`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.7) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.6...v2.13.7) ##### Bug Fixes - **deps:** update nest dependencies to v10.4.2 ([#​801](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/801)) ([fff1d32](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/fff1d32a1f313781fe17eedf3d21d4052d8b09e9)) ### [`v2.13.6`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.6) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.5...v2.13.6) ##### Bug Fixes - **deps:** update dependency [@​nestjs/axios](https://redirect.github.com/nestjs/axios) to v3.0.3 ([#​799](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/799)) ([868d55e](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/868d55eb989111296a068d1c521e45f5a13889b0)) ### [`v2.13.5`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.5) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.4...v2.13.5) ##### Bug Fixes - **deps:** update dependency axios to v1.7.4 \[security] ([#​789](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/789)) ([18abce4](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/18abce41f5fac12e574977e175adf32a42f8b5a6))
--- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 215 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 102 insertions(+), 115 deletions(-) diff --git a/package-lock.json b/package-lock.json index e41dd2a8..bdf9b485 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "SEE LICENSE IN LICENSE", "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.4", + "@openapitools/openapi-generator-cli": "2.14.0", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", @@ -192,9 +192,9 @@ } }, "node_modules/@nestjs/axios": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", - "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", + "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -204,14 +204,14 @@ } }, "node_modules/@nestjs/common": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", - "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.3.tgz", + "integrity": "sha512-4hbLd3XIJubHSylYd/1WSi4VQvG68KM/ECYpMDqA3k3J1/T17SAg40sDoq3ZoO5OZgU0xuNyjuISdOTjs11qVg==", "dev": true, "license": "MIT", "dependencies": { "iterare": "1.2.1", - "tslib": "2.6.2", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -221,7 +221,7 @@ "peerDependencies": { "class-transformer": "*", "class-validator": "*", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -234,9 +234,9 @@ } }, "node_modules/@nestjs/core": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", - "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.3.tgz", + "integrity": "sha512-6OQz+5C8mT8yRtfvE5pPCq+p6w5jDot+oQku1KzQ24ABn+lay1KGuJwcKZhdVNuselx+8xhdMxknZTA8wrGLIg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -244,8 +244,8 @@ "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.6.2", + "path-to-regexp": "3.3.0", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -257,7 +257,7 @@ "@nestjs/microservices": "^10.0.0", "@nestjs/platform-express": "^10.0.0", "@nestjs/websockets": "^10.0.0", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -292,37 +292,37 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.13.4", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.4.tgz", - "integrity": "sha512-4JKyrk55ohQK2FcuZbPdNvxdyXD14jjOIvE8hYjJ+E1cHbRbfXQXbYnjTODFE52Gx8eAxz8C9icuhDYDLn7nww==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.14.0.tgz", + "integrity": "sha512-k+ioQLtXLXgNbhQbp1UOxtaUnnYTWwAPev88hP5qauFA+eq4NyeQGNojknFssXg2x0VT0TUGmU3PZ2DiQ70IVg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "3.0.2", - "@nestjs/common": "10.3.0", - "@nestjs/core": "10.3.0", + "@nestjs/axios": "3.0.3", + "@nestjs/common": "10.4.3", + "@nestjs/core": "10.4.3", "@nuxtjs/opencollective": "0.3.2", - "axios": "1.6.8", + "axios": "1.7.7", "chalk": "4.1.2", "commander": "8.3.0", "compare-versions": "4.1.4", "concurrently": "6.5.1", "console.table": "0.10.0", "fs-extra": "10.1.0", - "glob": "7.2.3", - "https-proxy-agent": "7.0.4", + "glob": "9.3.5", + "https-proxy-agent": "7.0.5", "inquirer": "8.2.6", "lodash": "4.17.21", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "tslib": "2.6.2" + "tslib": "2.7.0" }, "bin": { "openapi-generator-cli": "main.js" }, "engines": { - "node": ">=10.0.0" + "node": ">=16" }, "funding": { "type": "opencollective", @@ -477,9 +477,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dev": true, "license": "MIT", "dependencies": { @@ -529,14 +529,13 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/browser-or-node": { @@ -728,13 +727,6 @@ "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/concurrently": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", @@ -1115,27 +1107,68 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob/node_modules/minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -1154,9 +1187,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "license": "MIT", "dependencies": { @@ -1201,18 +1234,6 @@ ], "license": "BSD-3-Clause" }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1415,16 +1436,19 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minipass": { @@ -1472,16 +1496,6 @@ } } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -1546,16 +1560,6 @@ "dev": true, "license": "(MIT AND Zlib)" }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1584,9 +1588,9 @@ } }, "node_modules/path-to-regexp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", - "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", "dev": true, "license": "MIT" }, @@ -1771,16 +1775,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/rimraf/node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -2075,9 +2069,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true, "license": "0BSD" }, @@ -2274,13 +2268,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index e7e41946..fada308d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.4", + "@openapitools/openapi-generator-cli": "2.14.0", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", From c22c2165804307c4ca5ed9de0afd9e9c06e9e5f6 Mon Sep 17 00:00:00 2001 From: Bitwarden DevOps <106330231+bitwarden-devops-bot@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:54:46 -0600 Subject: [PATCH 13/39] Bump java-sdk version to 1.0.1 (#1141) ## Type of change - [ ] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [X] Other ## Objective Automated java-sdk version bump to 1.0.1 --- languages/java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/java/build.gradle b/languages/java/build.gradle index 52337a44..b9789d19 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -36,7 +36,7 @@ repositories { def branchName = "git branch --show-current".execute().text.trim() if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { - version = "1.0.0" + version = "1.0.1" } else { // branchName-SNAPSHOT version = "${branchName.replaceAll('/', '-')}-SNAPSHOT" From 8b44f55c82270d70ff2db5f7ccde905395a273c1 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 14 Oct 2024 17:53:31 +0200 Subject: [PATCH 14/39] Remove usage of snippet and just return a vanilla error (#1140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we'll have to look into proper error handling anyways, so I'm just quickfixing this until then ## 🎟ī¸ Tracking ## 📔 Objective Snippets are not properly uploaded to npmjs. Bypassing the issue by not using snippets until we figure out error handling properly ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden-wasm-internal/src/client.rs | 4 ++++ crates/bitwarden-wasm-internal/src/error.js | 13 ------------- crates/bitwarden-wasm-internal/src/error.rs | 11 ++++++----- 3 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 crates/bitwarden-wasm-internal/src/error.js diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index ac7779b2..0a5ce27d 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -49,6 +49,10 @@ impl BitwardenClient { msg } + pub fn throw(&self, msg: String) -> Result<(), crate::error::GenericError> { + Err(crate::error::GenericError(msg)) + } + /// Test method, calls http endpoint pub async fn http_get(&self, url: String) -> Result { let client = self.0.internal.get_http_client(); diff --git a/crates/bitwarden-wasm-internal/src/error.js b/crates/bitwarden-wasm-internal/src/error.js deleted file mode 100644 index cd3d3a34..00000000 --- a/crates/bitwarden-wasm-internal/src/error.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Error thrown by the WASM module. - * @param {string} message - Error message. - * @extends Error - */ -class WasmError extends Error { - constructor(message) { - super(message); - this.name = "WasmError"; - } -} - -exports.WasmError = WasmError; diff --git a/crates/bitwarden-wasm-internal/src/error.rs b/crates/bitwarden-wasm-internal/src/error.rs index 2750d262..237ee494 100644 --- a/crates/bitwarden-wasm-internal/src/error.rs +++ b/crates/bitwarden-wasm-internal/src/error.rs @@ -2,12 +2,13 @@ use wasm_bindgen::prelude::*; // Importing an error class defined in JavaScript instead of defining it in Rust // allows us to extend the `Error` class. It also provides much better console output. -#[wasm_bindgen(module = "/src/error.js")] +#[wasm_bindgen] extern "C" { - type WasmError; + #[wasm_bindgen(js_name = Error)] + type JsError; - #[wasm_bindgen(constructor)] - fn new(message: String) -> WasmError; + #[wasm_bindgen(constructor, js_class = Error)] + fn new(message: String) -> JsError; } pub type Result = std::result::Result; @@ -22,6 +23,6 @@ impl From for GenericError { impl From for JsValue { fn from(error: GenericError) -> Self { - WasmError::new(error.0).into() + JsError::new(error.0).into() } } From 8aea2e9011936b1a2023f008d74f5cc4f4fe3733 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Tue, 15 Oct 2024 11:41:39 -0400 Subject: [PATCH 15/39] Update the Changelogs for the 1.0 Releases (#1122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📔 Objective Update the changelogs for the 1.0 releases of `bitwarden` and `bws`. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden/CHANGELOG.md | 2 ++ crates/bws/CHANGELOG.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/crates/bitwarden/CHANGELOG.md b/crates/bitwarden/CHANGELOG.md index 5d3eefa9..f43c14ff 100644 --- a/crates/bitwarden/CHANGELOG.md +++ b/crates/bitwarden/CHANGELOG.md @@ -7,6 +7,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.0.0] - 2024-09-26 + ### Added - Support for secrets sync (#678) diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index 2690c14f..ba7818f9 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -7,13 +7,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.0.0] - 2024-09-26 + ### Added - The ability to edit unassigned secrets with direct permissions. (#906) +- The `run` command, to run commands with secrets (#621) ### Changed - Updated MSRV `1.75.0` (#980) +- Use state files by default. You can opt out of this behavior with the new `state_opt_out` key. + (#930) ### Removed From 37b22fef050fb7b6556c66846e318812c4c88fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ch=C4=99ci=C5=84ski?= Date: Thu, 17 Oct 2024 16:15:54 +0200 Subject: [PATCH 16/39] [BRE-101] Remove dept-devops from CODEOWNERS (#826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/BRE-101 ## 📔 Objective Remove dept-devops from CODEOWNERS and add `bitwarden/dept-bre` for all release workflows. ## 📸 Screenshots ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com> Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com> --- .github/CODEOWNERS | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e4fbb97b..2698af85 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,9 +4,43 @@ # # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +# BRE for publish workflow changes +.github/workflows/publish-*.yml @bitwarden/dept-bre + +# Shared workflows ownership + +## BRE & SM teams shared ownership +.github/workflows/build-cli-docker.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-cli.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-cpp.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-dotnet.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-go.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-java.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-napi.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-python-wheels.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-ruby.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-bws.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-cpp.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-dotnet.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-go.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-java.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-napi.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-python.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-ruby.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev + +## Multiple owners +.github/workflows/build-android.yml +.github/workflows/build-rust-crates.yml +.github/workflows/build-rust-cross-platform.yml +.github/workflows/build-swift.yml +.github/workflows/build-wasm-internal.yml +.github/workflows/build-wasm.yml +.github/workflows/release-rust-crates.yml +.github/workflows/release-swift.yml +.github/workflows/release-wasm.yml +.github/workflows/version-bump.yml + -# DevOps for Actions and other workflow changes. -.github/workflows @bitwarden/dept-devops # Secrets Manager team crates/bitwarden-sm @bitwarden/team-secrets-manager-dev @@ -16,3 +50,9 @@ crates/bws @bitwarden/team-secrets-manager-dev crates/bws/Cargo.toml crates/bws/scripts/install.ps1 crates/bws/scripts/install.sh + +## Docker files have shared ownership ## +**/Dockerfile +**/*.Dockerfile +**/.dockerignore +**/entrypoint.sh From 1a523e9a0f95a13d91972b77c47e3ad15907c1a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:45:06 -0400 Subject: [PATCH 17/39] [deps]: Update gh minor (#1136) --- .github/workflows/build-android.yml | 12 +++---- .github/workflows/build-cli-docker.yml | 6 ++-- .github/workflows/build-cli.yml | 36 +++++++++---------- .github/workflows/build-cpp.yml | 4 +-- .github/workflows/build-dotnet.yml | 6 ++-- .github/workflows/build-go.yaml | 4 +-- .github/workflows/build-java.yml | 8 ++--- .github/workflows/build-napi.yml | 6 ++-- .github/workflows/build-python-wheels.yml | 10 +++--- .github/workflows/build-ruby.yml | 6 ++-- .github/workflows/build-rust-crates.yml | 8 ++--- .../workflows/build-rust-cross-platform.yml | 8 ++--- .github/workflows/build-swift.yml | 10 +++--- .github/workflows/build-wasm-internal.yml | 6 ++-- .github/workflows/build-wasm.yml | 6 ++-- .github/workflows/cloc.yml | 2 +- .github/workflows/direct-minimal-versions.yml | 4 +-- .github/workflows/generate_schemas.yml | 20 +++++------ .github/workflows/lint.yml | 6 ++-- .github/workflows/memory-testing.yml | 4 +-- .github/workflows/minimum-rust-version.yml | 4 +-- .github/workflows/publish-bws.yml | 12 +++---- .github/workflows/publish-dotnet.yml | 2 +- .github/workflows/publish-internal.yml | 6 ++-- .github/workflows/publish-java.yml | 4 +-- .github/workflows/publish-napi.yml | 6 ++-- .github/workflows/publish-php.yml | 10 +++--- .github/workflows/publish-python.yml | 4 +-- .github/workflows/publish-ruby.yml | 4 +-- .github/workflows/publish-rust-crates.yml | 6 ++-- .github/workflows/publish-wasm.yml | 6 ++-- .github/workflows/release-bws.yml | 2 +- .github/workflows/release-cpp.yml | 2 +- .github/workflows/release-dotnet.yml | 4 +-- .github/workflows/release-go.yml | 6 ++-- .github/workflows/release-java.yml | 4 +-- .github/workflows/release-napi.yml | 4 +-- .github/workflows/release-python.yml | 4 +-- .github/workflows/release-ruby.yml | 4 +-- .github/workflows/release-rust-crates.yml | 2 +- .github/workflows/release-swift.yml | 6 ++-- .github/workflows/release-wasm.yml | 4 +-- .github/workflows/rust-test.yml | 14 ++++---- .github/workflows/rustdoc.yml | 2 +- .github/workflows/scan.yml | 10 +++--- .github/workflows/version-bump.yml | 6 ++-- 46 files changed, 155 insertions(+), 155 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 7607d530..e49fc0d6 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -25,7 +25,7 @@ jobs: - target: i686-linux-android steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -33,7 +33,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo @@ -46,7 +46,7 @@ jobs: run: cross build -p bitwarden-uniffi --release --target=${{ matrix.settings.target }} - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: android-${{ matrix.settings.target }} path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.so @@ -57,14 +57,14 @@ jobs: needs: build steps: - name: Checkout repo (PR) - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 if: github.event_name == 'pull_request' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - name: Checkout repo (Push) - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 if: github.event_name == 'push' with: fetch-depth: 0 @@ -75,7 +75,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-combine-cache diff --git a/.github/workflows/build-cli-docker.yml b/.github/workflows/build-cli-docker.yml index 83daabf2..65e16480 100644 --- a/.github/workflows/build-cli-docker.yml +++ b/.github/workflows/build-cli-docker.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check Branch to Publish id: publish-branch-check @@ -33,7 +33,7 @@ jobs: uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 ########## Login to Docker registries ########## - name: Login to Azure - Prod Subscription @@ -87,7 +87,7 @@ jobs: fi - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: crates/bws/Dockerfile diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 9ffb3bde..648291eb 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -21,7 +21,7 @@ jobs: sign: ${{ steps.sign.outputs.sign }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -56,7 +56,7 @@ jobs: target: aarch64-pc-windows-msvc steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -65,7 +65,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -121,7 +121,7 @@ jobs: run: 7z a ./bws-${{ matrix.settings.target }}-%_PACKAGE_VERSION%.zip ./target/${{ matrix.settings.target }}/release/bws.exe - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -145,7 +145,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -154,7 +154,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -230,7 +230,7 @@ jobs: xcrun notarytool submit ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -259,7 +259,7 @@ jobs: target: aarch64-unknown-linux-gnu steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -273,7 +273,7 @@ jobs: version: 0.12.0 - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -289,7 +289,7 @@ jobs: run: zip -j ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip ./target/${{ matrix.settings.target }}/release/bws - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -305,7 +305,7 @@ jobs: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download x86_64-apple-darwin artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -394,7 +394,7 @@ jobs: xcrun notarytool submit ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip path: ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip @@ -407,7 +407,7 @@ jobs: - setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -415,7 +415,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-cli-about @@ -429,7 +429,7 @@ jobs: sed -i.bak 's/\$NAME\$/Bitwarden Secrets Manager CLI/g' THIRDPARTY.html - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: THIRDPARTY.html path: ./crates/bws/THIRDPARTY.html @@ -441,7 +441,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -449,7 +449,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-cli-manpage @@ -460,7 +460,7 @@ jobs: mv $OUT_DIR/manpages . - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: manpages path: ./manpages/* diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 68636936..2cd9991a 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: install dependencies linux if: runner.os == 'Linux' @@ -152,7 +152,7 @@ jobs: fi - name: Upload C++ package for ${{ matrix.settings.target }} - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_cpp-${{ matrix.settings.target }} path: languages/cpp/build/artifacts diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index bb5d56b6..974c7e58 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -23,7 +23,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install xmllint run: sudo apt-get install -y libxml2-utils @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download C# schemas artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -92,7 +92,7 @@ jobs: working-directory: languages/csharp/Bitwarden.Sdk - name: Upload NuGet package - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: Bitwarden.Sdk.${{ needs.version.outputs.version }}.nupkg path: | diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index ffb4d669..0a84e72a 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Go environment uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 @@ -27,7 +27,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Cache dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml index 6994a5a6..761ba5ce 100644 --- a/.github/workflows/build-java.yml +++ b/.github/workflows/build-java.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download Java schemas artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -67,21 +67,21 @@ jobs: working-directory: languages/java - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: build path: ${{ github.workspace }}/languages/java/build if-no-files-found: error - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: resources path: ${{ github.workspace }}/languages/java/src/main/resources if-no-files-found: error - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas path: languages/java/src/main/java/bit/sdk/schema diff --git a/.github/workflows/build-napi.yml b/.github/workflows/build-napi.yml index 41ed1d17..f9ebbc7a 100644 --- a/.github/workflows/build-napi.yml +++ b/.github/workflows/build-napi.yml @@ -51,7 +51,7 @@ jobs: strip *.node steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -67,7 +67,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -84,7 +84,7 @@ jobs: run: ${{ matrix.settings.build }} - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-bitwarden-napi-${{ matrix.settings.target }} path: ${{ github.workspace }}/crates/bitwarden-napi/sdk-napi.*.node diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index b3919567..60c6e4b2 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -26,7 +26,7 @@ jobs: package_version: ${{ steps.retrieve-version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -77,7 +77,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -109,14 +109,14 @@ jobs: working-directory: ${{ github.workspace }}/languages/python - name: Upload wheels - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-${{ matrix.settings.target }} path: ${{ github.workspace }}/target/wheels/bitwarden_sdk*.whl - name: Upload sdists if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} # we only need one sdist - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-sdist path: ${{ github.workspace }}/target/wheels/bitwarden_sdk-*.tar.gz diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 5a3f1a01..559c161c 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Ruby - uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0 + uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0 with: ruby-version: 3.2 @@ -89,7 +89,7 @@ jobs: working-directory: languages/ruby/bitwarden_sdk_secrets - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: path: bitwarden-sdk-secrets-*.gem name: bitwarden-sdk-secrets diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index 8400fcbf..115be589 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -42,7 +42,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Build run: cargo build -p ${{ matrix.package }} --release @@ -56,7 +56,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -64,7 +64,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release diff --git a/.github/workflows/build-rust-cross-platform.yml b/.github/workflows/build-rust-cross-platform.yml index 1748661b..7014bf95 100644 --- a/.github/workflows/build-rust-cross-platform.yml +++ b/.github/workflows/build-rust-cross-platform.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -46,7 +46,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 if: ${{ contains(matrix.settings.target, 'musl') }} @@ -83,13 +83,13 @@ jobs: run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_c_files-${{ matrix.settings.target }} path: target/${{ matrix.settings.target }}/release/*bitwarden_c* - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_c_files-${{ matrix.settings.target }} path: target/${{ matrix.settings.target }}/release-windows/*bitwarden_c* diff --git a/.github/workflows/build-swift.yml b/.github/workflows/build-swift.yml index 37224134..94b730e8 100644 --- a/.github/workflows/build-swift.yml +++ b/.github/workflows/build-swift.yml @@ -17,7 +17,7 @@ jobs: package_version: ${{ steps.retrieve-version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -33,7 +33,7 @@ jobs: _VERSION: ${{ needs.version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -41,7 +41,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: sdk-swift-cargo @@ -67,14 +67,14 @@ jobs: cp -rf languages/swift/BitwardenFFI.xcframework artifacts - name: Upload BitwardenFFI.xcframework artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: BitwardenFFI-${{ env._VERSION }}-${{ steps.build.outputs.short-sha }}.xcframework path: artifacts if-no-files-found: error - name: Upload BitwardenSdk sources - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: BitwardenSdk-${{ env._VERSION }}-${{ steps.build.outputs.short-sha }}-sources path: languages/swift/Sources/BitwardenSdk diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 0be6b29c..6e0e28b9 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -41,7 +41,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: wasm-cargo-cache @@ -52,7 +52,7 @@ jobs: run: ./build.sh -r - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-internal path: ${{ github.workspace }}/languages/js/sdk-internal/* diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 117bbf2c..f3a57f06 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -41,7 +41,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: wasm-cargo-cache @@ -52,7 +52,7 @@ jobs: run: ./build.sh -r - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-bitwarden-wasm path: ${{ github.workspace }}/languages/js/wasm/* diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml index 644dc0bf..c78c2855 100644 --- a/.github/workflows/cloc.yml +++ b/.github/workflows/cloc.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up cloc run: | diff --git a/.github/workflows/direct-minimal-versions.yml b/.github/workflows/direct-minimal-versions.yml index 22feb04c..7b3820c7 100644 --- a/.github/workflows/direct-minimal-versions.yml +++ b/.github/workflows/direct-minimal-versions.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -45,7 +45,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: dmv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} diff --git a/.github/workflows/generate_schemas.yml b/.github/workflows/generate_schemas.yml index 434174c7..66e6f450 100644 --- a/.github/workflows/generate_schemas.yml +++ b/.github/workflows/generate_schemas.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -37,61 +37,61 @@ jobs: run: npm ci - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: NPM Schemas run: npm run schemas - name: Upload ts schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.ts path: ${{ github.workspace }}/languages/js/sdk-client/src/schemas.ts if-no-files-found: error - name: Upload c# schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.cs path: ${{ github.workspace }}/languages/csharp/Bitwarden.Sdk/schemas.cs if-no-files-found: error - name: Upload python schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.py path: ${{ github.workspace }}/languages/python/bitwarden_sdk/schemas.py if-no-files-found: error - name: Upload ruby schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.rb path: ${{ github.workspace }}/languages/ruby/bitwarden_sdk_secrets/lib/schemas.rb if-no-files-found: error - name: Upload json schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-json path: ${{ github.workspace }}/support/schemas/* if-no-files-found: error - name: Upload Go schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.go path: ${{ github.workspace }}/languages/go/schema.go - name: Upload java schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-java path: ${{ github.workspace }}/languages/java/src/main/java/com/bitwarden/sdk/schema/* if-no-files-found: error - name: Upload cpp schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-cpp path: ${{ github.workspace }}/languages/cpp/include/schemas.hpp diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a12e263c..a8d14a69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -30,7 +30,7 @@ jobs: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Cargo fmt run: cargo +nightly fmt --check @@ -45,7 +45,7 @@ jobs: RUSTFLAGS: "-D warnings" - name: Upload Clippy results to GitHub - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: clippy_result.sarif diff --git a/.github/workflows/memory-testing.yml b/.github/workflows/memory-testing.yml index 41b15853..527121ba 100644 --- a/.github/workflows/memory-testing.yml +++ b/.github/workflows/memory-testing.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up gdb run: | @@ -35,7 +35,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: memtest-cargo diff --git a/.github/workflows/minimum-rust-version.yml b/.github/workflows/minimum-rust-version.yml index fa95eb0b..deaca3c1 100644 --- a/.github/workflows/minimum-rust-version.yml +++ b/.github/workflows/minimum-rust-version.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -38,7 +38,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: msrv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} diff --git a/.github/workflows/publish-bws.yml b/.github/workflows/publish-bws.yml index dc939a5d..d4dc445c 100644 --- a/.github/workflows/publish-bws.yml +++ b/.github/workflows/publish-bws.yml @@ -32,7 +32,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -80,7 +80,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.release-tag }} steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Login to Azure uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 @@ -101,7 +101,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release @@ -119,7 +119,7 @@ jobs: needs: setup steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} @@ -142,7 +142,7 @@ jobs: uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 ########## Login to Docker registries ########## - name: Login to Azure - Prod Subscription @@ -172,7 +172,7 @@ jobs: azure-keyvault-name: "bitwarden-ci" - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: crates/bws/Dockerfile diff --git a/.github/workflows/publish-dotnet.yml b/.github/workflows/publish-dotnet.yml index 1e2fc06f..624cf944 100644 --- a/.github/workflows/publish-dotnet.yml +++ b/.github/workflows/publish-dotnet.yml @@ -28,7 +28,7 @@ jobs: version: ${{ steps.version-output.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 13f3a9d9..62ffc9e4 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,10 +45,10 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 002a61ee..c6266a1a 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -35,7 +35,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -69,7 +69,7 @@ jobs: needs: validate steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.validate.outputs.tag_name }} diff --git a/.github/workflows/publish-napi.yml b/.github/workflows/publish-napi.yml index 6a284d4a..0caec400 100644 --- a/.github/workflows/publish-napi.yml +++ b/.github/workflows/publish-napi.yml @@ -31,7 +31,7 @@ jobs: tag-name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -68,7 +68,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.tag-name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} @@ -84,7 +84,7 @@ jobs: task: release - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 18 cache: "npm" diff --git a/.github/workflows/publish-php.yml b/.github/workflows/publish-php.yml index 986923ab..fc82c6bc 100644 --- a/.github/workflows/publish-php.yml +++ b/.github/workflows/publish-php.yml @@ -25,7 +25,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1 @@ -76,7 +76,7 @@ jobs: _PKG_VERSION: ${{ needs.validate.outputs.version }} steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -93,7 +93,7 @@ jobs: secrets: "github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sm-sdk-php path: sm-sdk-php @@ -255,7 +255,7 @@ jobs: packagist-key" - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sm-sdk-php path: sm-sdk-php diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 7e339509..76b06a43 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -31,7 +31,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -65,7 +65,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.tag_name }} diff --git a/.github/workflows/publish-ruby.yml b/.github/workflows/publish-ruby.yml index 875def06..827377c2 100644 --- a/.github/workflows/publish-ruby.yml +++ b/.github/workflows/publish-ruby.yml @@ -30,7 +30,7 @@ jobs: tag-name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -67,7 +67,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.tag-name }} steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} diff --git a/.github/workflows/publish-rust-crates.yml b/.github/workflows/publish-rust-crates.yml index bb79aad2..156aedb0 100644 --- a/.github/workflows/publish-rust-crates.yml +++ b/.github/workflows/publish-rust-crates.yml @@ -29,7 +29,7 @@ jobs: release-tag: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -63,7 +63,7 @@ jobs: needs: setup steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.release-tag }} @@ -85,7 +85,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml index 95a86a0c..b8bd637f 100644 --- a/.github/workflows/publish-wasm.yml +++ b/.github/workflows/publish-wasm.yml @@ -31,7 +31,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -67,12 +67,12 @@ jobs: _VERSION: ${{ needs.setup.outputs.release-version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.tag_name }} - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 18 cache: "npm" diff --git a/.github/workflows/release-bws.yml b/.github/workflows/release-bws.yml index 92a8544b..aec83741 100644 --- a/.github/workflows/release-bws.yml +++ b/.github/workflows/release-bws.yml @@ -22,7 +22,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index 47199a99..77bc8940 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -24,7 +24,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-dotnet.yml b/.github/workflows/release-dotnet.yml index dc853927..f968ebac 100644 --- a/.github/workflows/release-dotnet.yml +++ b/.github/workflows/release-dotnet.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -48,7 +48,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download NuGet package uses: bitwarden/gh-actions/download-artifacts@main diff --git a/.github/workflows/release-go.yml b/.github/workflows/release-go.yml index f88e52af..4138c722 100644 --- a/.github/workflows/release-go.yml +++ b/.github/workflows/release-go.yml @@ -26,7 +26,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -55,7 +55,7 @@ jobs: steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -72,7 +72,7 @@ jobs: secrets: "github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-Go repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sdk-go path: sdk-go diff --git a/.github/workflows/release-java.yml b/.github/workflows/release-java.yml index 6898932d..863a8986 100644 --- a/.github/workflows/release-java.yml +++ b/.github/workflows/release-java.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,7 +45,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Create release if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml index 761515c7..b47f51f5 100644 --- a/.github/workflows/release-napi.yml +++ b/.github/workflows/release-napi.yml @@ -28,7 +28,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -55,7 +55,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 5be1a12f..6d246270 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -22,7 +22,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -46,7 +46,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/release-ruby.yml b/.github/workflows/release-ruby.yml index 9c3e82b7..9fb3349c 100644 --- a/.github/workflows/release-ruby.yml +++ b/.github/workflows/release-ruby.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,7 +45,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download ruby artifact uses: bitwarden/gh-actions/download-artifacts@main diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index 54845e14..abf48a50 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -21,7 +21,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index 351581a7..38f247cc 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -42,7 +42,7 @@ jobs: swift_checksum: ${{ steps.calculate-swift-checksum.outputs.checksum }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get version id: version @@ -114,7 +114,7 @@ jobs: _BUILD_RUN_ID: ${{ needs.validate.outputs.run_id }} steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -142,7 +142,7 @@ jobs: github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-Swift repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sdk-swift path: sdk-swift diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index 97b2c34d..c53d3081 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -26,7 +26,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -53,7 +53,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 5e7703e8..a313970b 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -42,7 +42,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Test # Termporarily exclude NAPI due to a test error on windows @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -63,7 +63,7 @@ jobs: components: llvm-tools - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-llvm-cov run: cargo install cargo-llvm-cov --version 0.5.38 @@ -72,7 +72,7 @@ jobs: run: cargo llvm-cov --all-features --lcov --output-path lcov.info --ignore-filename-regex "crates/bitwarden-api-" - name: Upload to codecov.io - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -83,7 +83,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -92,7 +92,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Check run: cargo check -p bitwarden-wasm --target wasm32-unknown-unknown diff --git a/.github/workflows/rustdoc.yml b/.github/workflows/rustdoc.yml index 45ab6d07..afa12fd5 100644 --- a/.github/workflows/rustdoc.yml +++ b/.github/workflows/rustdoc.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 193c9fcf..f337e17a 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -26,12 +26,12 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ github.event.pull_request.head.sha }} - name: Scan with Checkmarx - uses: checkmarx/ast-github-action@9fda5a4a2c297608117a5a56af424502a9192e57 # 2.0.34 + uses: checkmarx/ast-github-action@f0869bd1a37fddc06499a096101e6c900e815d81 # 2.0.36 env: INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}" with: @@ -46,7 +46,7 @@ jobs: --output-path . ${{ env.INCREMENTAL }} - name: Upload Checkmarx results to GitHub - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: cx_result.sarif @@ -60,13 +60,13 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - name: Scan with SonarCloud - uses: sonarsource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0.0 + uses: sonarsource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # v3.1.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 7053181e..9cd716eb 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -39,7 +39,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-edit --locked @@ -59,7 +59,7 @@ jobs: github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout Branch - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: main repository: bitwarden/sdk @@ -236,7 +236,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Branch - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: main From 6babf9e21a1ef7e3f61331f59af1a063295bbe3a Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:50:08 -0400 Subject: [PATCH 18/39] BRE-367 - Update regex in Publish Java workflow (#1143) --- .github/workflows/publish-java.yml | 4 ++-- languages/java/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index c6266a1a..7f461c19 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -51,8 +51,8 @@ jobs: id: version-output run: | if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') + TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -rc '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) + VERSION=$(echo $TAG_NAME | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') echo "Latest Released Version: $VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT diff --git a/languages/java/build.gradle b/languages/java/build.gradle index b9789d19..a28a7445 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -35,7 +35,7 @@ repositories { def branchName = "git branch --show-current".execute().text.trim() - if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { + if (branchName == "main") { version = "1.0.1" } else { // branchName-SNAPSHOT From f9757b1454e4674d4f119ce2b3c79fc584d8f048 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Thu, 17 Oct 2024 12:04:52 -0400 Subject: [PATCH 19/39] Add opt out docs link to the bws changelog (#1142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📔 Objective As discussed in PR https://github.com/bitwarden/sdk/pull/1122, add a link to our docs about the opt out change. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bws/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index ba7818f9..19b1010f 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -19,6 +19,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Updated MSRV `1.75.0` (#980) - Use state files by default. You can opt out of this behavior with the new `state_opt_out` key. (#930) + - Opt out documentation can be found + [here](https://bitwarden.com/help/secrets-manager-cli/#config-state) ### Removed From 6460db27b098bf58983632430380c0a2886d3796 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:41:57 -0400 Subject: [PATCH 20/39] BRE-367 - Update logic to use version only (#1146) --- languages/java/build.gradle | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/languages/java/build.gradle b/languages/java/build.gradle index a28a7445..7e98de1d 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -34,13 +34,7 @@ repositories { // Main: Grab it from `crates/bitwarden/Cargo.toml` def branchName = "git branch --show-current".execute().text.trim() - - if (branchName == "main") { - version = "1.0.1" - } else { - // branchName-SNAPSHOT - version = "${branchName.replaceAll('/', '-')}-SNAPSHOT" - } + version = "1.0.1" afterEvaluate { from components.java From e2aa10212270ff21a8c99937d4a55b0d65080bb6 Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Mon, 21 Oct 2024 13:11:03 +0100 Subject: [PATCH 21/39] [BRE-372] - Clean up document start (#1147) --- .github/workflows/build-android.yml | 1 - .github/workflows/build-cli-docker.yml | 1 - .github/workflows/build-cli.yml | 1 - .github/workflows/build-java.yml | 1 - .github/workflows/build-napi.yml | 1 - .github/workflows/build-python-wheels.yml | 1 - .github/workflows/build-ruby.yml | 1 - .github/workflows/build-rust-crates.yml | 1 - .github/workflows/build-swift.yml | 1 - .github/workflows/build-wasm-internal.yml | 1 - .github/workflows/build-wasm.yml | 1 - .github/workflows/delete-old-packages.yml | 1 - .github/workflows/direct-minimal-versions.yml | 1 - .github/workflows/enforce-labels.yml | 1 - .github/workflows/memory-testing.yml | 1 - .github/workflows/minimum-rust-version.yml | 1 - .github/workflows/publish-bws.yml | 1 - .github/workflows/publish-internal.yml | 1 - .github/workflows/publish-java.yml | 1 - .github/workflows/publish-napi.yml | 1 - .github/workflows/publish-php.yml | 1 - .github/workflows/publish-python.yml | 1 - .github/workflows/publish-rust-crates.yml | 1 - .github/workflows/publish-wasm.yml | 1 - .github/workflows/release-bws.yml | 1 - .github/workflows/release-napi.yml | 1 - .github/workflows/release-python.yml | 1 - .github/workflows/release-swift.yml | 1 - .github/workflows/release-wasm.yml | 1 - .github/workflows/version-bump.yml | 1 - .github/workflows/workflow-linter.yml | 12 ------- languages/java/example/bin/main/.classpath | 12 +++++++ languages/java/example/bin/main/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../main/.settings/org.eclipse.jdt.core.prefs | 4 +++ languages/java/example/bin/main/build.gradle | 23 +++++++++++++ 36 files changed, 75 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/workflow-linter.yml create mode 100644 languages/java/example/bin/main/.classpath create mode 100644 languages/java/example/bin/main/.project create mode 100644 languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs create mode 100644 languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs create mode 100644 languages/java/example/bin/main/build.gradle diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index e49fc0d6..49ee2084 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -1,4 +1,3 @@ ---- name: Build Android on: diff --git a/.github/workflows/build-cli-docker.yml b/.github/workflows/build-cli-docker.yml index 65e16480..abf1c3a8 100644 --- a/.github/workflows/build-cli-docker.yml +++ b/.github/workflows/build-cli-docker.yml @@ -1,4 +1,3 @@ ---- name: Build bws Docker image on: diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 648291eb..05f4cd23 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -1,4 +1,3 @@ ---- name: Build CLI on: diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml index 761ba5ce..abeabe9d 100644 --- a/.github/workflows/build-java.yml +++ b/.github/workflows/build-java.yml @@ -1,4 +1,3 @@ ---- name: Build Java SDK on: diff --git a/.github/workflows/build-napi.yml b/.github/workflows/build-napi.yml index f9ebbc7a..cae88a1b 100644 --- a/.github/workflows/build-napi.yml +++ b/.github/workflows/build-napi.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-napi on: diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index 60c6e4b2..da3305e7 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -1,4 +1,3 @@ ---- name: Build Python Wheels on: diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 559c161c..3ac79de7 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -1,4 +1,3 @@ ---- name: Build Ruby on: diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index 115be589..bc00dd97 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -1,4 +1,3 @@ ---- name: Build Rust crates on: diff --git a/.github/workflows/build-swift.yml b/.github/workflows/build-swift.yml index 94b730e8..93cb314c 100644 --- a/.github/workflows/build-swift.yml +++ b/.github/workflows/build-swift.yml @@ -1,4 +1,3 @@ ---- name: Build Swift Package on: diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 6e0e28b9..e45bcc26 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-internal on: diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index f3a57f06..7e01e10e 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-wasm on: diff --git a/.github/workflows/delete-old-packages.yml b/.github/workflows/delete-old-packages.yml index b3be807a..f690e801 100644 --- a/.github/workflows/delete-old-packages.yml +++ b/.github/workflows/delete-old-packages.yml @@ -1,4 +1,3 @@ ---- name: Delete old packages on: diff --git a/.github/workflows/direct-minimal-versions.yml b/.github/workflows/direct-minimal-versions.yml index 7b3820c7..66623ed6 100644 --- a/.github/workflows/direct-minimal-versions.yml +++ b/.github/workflows/direct-minimal-versions.yml @@ -1,4 +1,3 @@ ---- name: Direct Minimum Version on: diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index a98c4ae1..40ddfe77 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -1,4 +1,3 @@ ---- name: Enforce PR labels on: diff --git a/.github/workflows/memory-testing.yml b/.github/workflows/memory-testing.yml index 527121ba..619fbb46 100644 --- a/.github/workflows/memory-testing.yml +++ b/.github/workflows/memory-testing.yml @@ -1,4 +1,3 @@ ---- name: Test for memory leaks on: diff --git a/.github/workflows/minimum-rust-version.yml b/.github/workflows/minimum-rust-version.yml index deaca3c1..812822c6 100644 --- a/.github/workflows/minimum-rust-version.yml +++ b/.github/workflows/minimum-rust-version.yml @@ -1,4 +1,3 @@ ---- name: Minimum Rust Version on: diff --git a/.github/workflows/publish-bws.yml b/.github/workflows/publish-bws.yml index d4dc445c..3f4245b9 100644 --- a/.github/workflows/publish-bws.yml +++ b/.github/workflows/publish-bws.yml @@ -1,4 +1,3 @@ ---- name: Publish bws CLI run-name: Publish bws CLI ${{ inputs.release_type }} diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 62ffc9e4..eef5b4d0 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-internal run-name: Publish @bitwarden/sdk-internal ${{ inputs.release_type }} diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 7f461c19..84ce0a95 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -1,4 +1,3 @@ ---- name: Publish Java SDK run-name: Publish Java SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-napi.yml b/.github/workflows/publish-napi.yml index 0caec400..5c7aca19 100644 --- a/.github/workflows/publish-napi.yml +++ b/.github/workflows/publish-napi.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-napi run-name: Publish @bitwarden/sdk-napi ${{ inputs.release_type }} diff --git a/.github/workflows/publish-php.yml b/.github/workflows/publish-php.yml index fc82c6bc..d3965f70 100644 --- a/.github/workflows/publish-php.yml +++ b/.github/workflows/publish-php.yml @@ -1,4 +1,3 @@ ---- name: Publish PHP SDK run-name: Publish PHP SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 76b06a43..bfc6b7a0 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -1,4 +1,3 @@ ---- name: Publish Python SDK run-name: Publish Python SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-rust-crates.yml b/.github/workflows/publish-rust-crates.yml index 156aedb0..30921f6b 100644 --- a/.github/workflows/publish-rust-crates.yml +++ b/.github/workflows/publish-rust-crates.yml @@ -1,4 +1,3 @@ ---- name: Publish Rust crates run-name: Publish Rust crates ${{ inputs.release_type }} diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml index b8bd637f..95779b78 100644 --- a/.github/workflows/publish-wasm.yml +++ b/.github/workflows/publish-wasm.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-wasm run-name: Publish @bitwarden/sdk-wasm ${{ inputs.release_type }} diff --git a/.github/workflows/release-bws.yml b/.github/workflows/release-bws.yml index aec83741..9063ca6a 100644 --- a/.github/workflows/release-bws.yml +++ b/.github/workflows/release-bws.yml @@ -1,4 +1,3 @@ ---- name: Release bws CLI run-name: Release bws CLI ${{ inputs.release_type }} diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml index b47f51f5..65534e8e 100644 --- a/.github/workflows/release-napi.yml +++ b/.github/workflows/release-napi.yml @@ -1,4 +1,3 @@ ---- name: Release @bitwarden/sdk-napi run-name: Release @bitwarden/sdk-napi ${{ inputs.release_type }} diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 6d246270..a634a2d1 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -1,4 +1,3 @@ ---- name: Release Python SDK run-name: Release Python SDK ${{ inputs.release_type }} diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index 38f247cc..c5c25d65 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -1,4 +1,3 @@ ---- name: Release Swift Package on: diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index c53d3081..982a31ec 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -1,4 +1,3 @@ ---- name: Release @bitwarden/sdk-wasm run-name: Release @bitwarden/sdk-wasm ${{ inputs.release_type }} diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 9cd716eb..47642e19 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,4 +1,3 @@ ---- name: Version Bump run-name: Version Bump - ${{ inputs.project }} - v${{ inputs.version_number }} diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml deleted file mode 100644 index 24f10f1e..00000000 --- a/.github/workflows/workflow-linter.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Workflow linter - -on: - pull_request: - paths: - - .github/workflows/** - -jobs: - call-workflow: - name: Lint - uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main diff --git a/languages/java/example/bin/main/.classpath b/languages/java/example/bin/main/.classpath new file mode 100644 index 00000000..18f7d238 --- /dev/null +++ b/languages/java/example/bin/main/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/languages/java/example/bin/main/.project b/languages/java/example/bin/main/.project new file mode 100644 index 00000000..050f3113 --- /dev/null +++ b/languages/java/example/bin/main/.project @@ -0,0 +1,34 @@ + + + example + Project example created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1729179122477 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..b1886adb --- /dev/null +++ b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..55e9d5ff --- /dev/null +++ b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=19 +org.eclipse.jdt.core.compiler.compliance=19 +org.eclipse.jdt.core.compiler.source=19 diff --git a/languages/java/example/bin/main/build.gradle b/languages/java/example/bin/main/build.gradle new file mode 100644 index 00000000..73025e50 --- /dev/null +++ b/languages/java/example/bin/main/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'application' +} + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + implementation rootProject +} + +application { + mainClass = 'Example' +} + +sourceSets { + main { + java.srcDirs += '.' + } +} + From c5a74193dbe8fa6d2b7c45412c678d7dcdb2a239 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 21 Oct 2024 14:53:38 +0200 Subject: [PATCH 22/39] fix: downgrade rust to 1.81.0 in WASM builds (#1149) This is a temporary fix for WASM no longer building due to wasm2js breaking when using 1.82.0 --- .github/workflows/build-wasm-internal.yml | 2 +- .github/workflows/build-wasm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index e45bcc26..2262babc 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -36,7 +36,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable with: - toolchain: stable + toolchain: 1.81.0 targets: wasm32-unknown-unknown - name: Cache cargo registry diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 7e01e10e..e1924ca2 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -36,7 +36,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable with: - toolchain: stable + toolchain: 1.81.0 targets: wasm32-unknown-unknown - name: Cache cargo registry From 39358acc891590b5c90fa0734cd50a04cf80bb1c Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Mon, 21 Oct 2024 15:07:22 +0100 Subject: [PATCH 23/39] [BRE-372] - Clean up Eclipse added files (#1150) --- languages/java/example/bin/main/.classpath | 12 ------- languages/java/example/bin/main/.project | 34 ------------------- .../org.eclipse.buildship.core.prefs | 2 -- .../main/.settings/org.eclipse.jdt.core.prefs | 4 --- languages/java/example/bin/main/build.gradle | 23 ------------- 5 files changed, 75 deletions(-) delete mode 100644 languages/java/example/bin/main/.classpath delete mode 100644 languages/java/example/bin/main/.project delete mode 100644 languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs delete mode 100644 languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs delete mode 100644 languages/java/example/bin/main/build.gradle diff --git a/languages/java/example/bin/main/.classpath b/languages/java/example/bin/main/.classpath deleted file mode 100644 index 18f7d238..00000000 --- a/languages/java/example/bin/main/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/languages/java/example/bin/main/.project b/languages/java/example/bin/main/.project deleted file mode 100644 index 050f3113..00000000 --- a/languages/java/example/bin/main/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - example - Project example created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1729179122477 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index b1886adb..00000000 --- a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir=.. -eclipse.preferences.version=1 diff --git a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 55e9d5ff..00000000 --- a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=19 -org.eclipse.jdt.core.compiler.compliance=19 -org.eclipse.jdt.core.compiler.source=19 diff --git a/languages/java/example/bin/main/build.gradle b/languages/java/example/bin/main/build.gradle deleted file mode 100644 index 73025e50..00000000 --- a/languages/java/example/bin/main/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'application' -} - -repositories { - mavenLocal() - mavenCentral() -} - -dependencies { - implementation rootProject -} - -application { - mainClass = 'Example' -} - -sourceSets { - main { - java.srcDirs += '.' - } -} - From be75311e92309109147c4b6d742e23a192b253c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 21 Oct 2024 17:37:04 +0200 Subject: [PATCH 24/39] [PM-13420] Support case-insensitive TOTP generation (#1144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/PM-13420 ## 📔 Objective Update TOTP parsing to be case insensitive by lowercasing the input initially. `decode_b32` is already converting the input to uppercase so secret decoding will still work the same. I've also removed the `to_uppercase` from algorithm now that we know the string is lowercase. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden-vault/src/totp.rs | 44 ++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/crates/bitwarden-vault/src/totp.rs b/crates/bitwarden-vault/src/totp.rs index 8aee3e69..d6167a1a 100644 --- a/crates/bitwarden-vault/src/totp.rs +++ b/crates/bitwarden-vault/src/totp.rs @@ -157,17 +157,19 @@ impl FromStr for Totp { /// - OTP Auth URI /// - Steam URI fn from_str(key: &str) -> Result { + let key = key.to_lowercase(); + let params = if key.starts_with("otpauth://") { - let url = Url::parse(key).map_err(|_| TotpError::InvalidOtpauth)?; + let url = Url::parse(&key).map_err(|_| TotpError::InvalidOtpauth)?; let parts: HashMap<_, _> = url.query_pairs().collect(); Totp { algorithm: parts .get("algorithm") - .and_then(|v| match v.to_uppercase().as_ref() { - "SHA1" => Some(Algorithm::Sha1), - "SHA256" => Some(Algorithm::Sha256), - "SHA512" => Some(Algorithm::Sha512), + .and_then(|v| match v.as_ref() { + "sha1" => Some(Algorithm::Sha1), + "sha256" => Some(Algorithm::Sha256), + "sha512" => Some(Algorithm::Sha512), _ => None, }) .unwrap_or(DEFAULT_ALGORITHM), @@ -200,7 +202,7 @@ impl FromStr for Totp { algorithm: DEFAULT_ALGORITHM, digits: DEFAULT_DIGITS, period: DEFAULT_PERIOD, - secret: decode_b32(key), + secret: decode_b32(&key), } }; @@ -285,6 +287,7 @@ mod tests { ("PIUD1IS!EQYA=", "829846"), // sanitized // Steam ("steam://HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", "7W6CJ"), + ("StEam://HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", "7W6CJ"), ("steam://ABCD123", "N26DF"), // Various weird lengths ("ddfdf", "932653"), @@ -321,6 +324,20 @@ mod tests { assert_eq!(response.period, 30); } + #[test] + fn test_generate_otpauth_uppercase() { + let key = "OTPauth://totp/test-account?secret=WQIQ25BRKZYCJVYP".to_string(); + let time = Some( + DateTime::parse_from_rfc3339("2023-01-01T00:00:00.000Z") + .unwrap() + .with_timezone(&Utc), + ); + let response = generate_totp(key, time).unwrap(); + + assert_eq!(response.code, "194506".to_string()); + assert_eq!(response.period, 30); + } + #[test] fn test_generate_otpauth_period() { let key = "otpauth://totp/test-account?secret=WQIQ25BRKZYCJVYP&period=60".to_string(); @@ -335,6 +352,21 @@ mod tests { assert_eq!(response.period, 60); } + #[test] + fn test_generate_otpauth_algorithm_sha256() { + let key = + "otpauth://totp/test-account?secret=WQIQ25BRKZYCJVYP&algorithm=SHA256".to_string(); + let time = Some( + DateTime::parse_from_rfc3339("2023-01-01T00:00:00.000Z") + .unwrap() + .with_timezone(&Utc), + ); + let response = generate_totp(key, time).unwrap(); + + assert_eq!(response.code, "842615".to_string()); + assert_eq!(response.period, 30); + } + #[test] fn test_generate_totp_cipher_view() { let view = CipherListView { From 38ecf133f86940f9c8f6a9627012938e7569b44d Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 21 Oct 2024 18:05:18 +0200 Subject: [PATCH 25/39] [PM-11924] Add ssh-key item type (#1037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/PM-11924 Server PR: https://bitwarden.atlassian.net/browse/PM-10394 ## 📔 Objective Add a new item type for ssh-keys. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Oscar Hinton --- .../resources/json_export.json | 20 ++++ crates/bitwarden-exporters/src/json.rs | 113 +++++++++++++++++- crates/bitwarden-exporters/src/lib.rs | 11 ++ crates/bitwarden-exporters/src/models.rs | 9 ++ .../bitwarden-vault/src/cipher/attachment.rs | 3 + crates/bitwarden-vault/src/cipher/cipher.rs | 71 ++++++++++- crates/bitwarden-vault/src/cipher/mod.rs | 1 + crates/bitwarden-vault/src/cipher/ssh_key.rs | 49 ++++++++ .../src/mobile/client_ciphers.rs | 2 + 9 files changed, 272 insertions(+), 7 deletions(-) create mode 100644 crates/bitwarden-vault/src/cipher/ssh_key.rs diff --git a/crates/bitwarden-exporters/resources/json_export.json b/crates/bitwarden-exporters/resources/json_export.json index ad538055..27a0921d 100644 --- a/crates/bitwarden-exporters/resources/json_export.json +++ b/crates/bitwarden-exporters/resources/json_export.json @@ -141,6 +141,26 @@ "revisionDate": "2024-01-30T17:54:50.706Z", "creationDate": "2024-01-30T17:54:50.706Z", "deletedDate": null + }, + { + "id": "646594a9-a9cb-4082-9d57-0024c3fbcaa9", + "folderId": null, + "organizationId": null, + "collectionIds": null, + "name": "My ssh key", + "notes": null, + "type": 5, + "sshKey": { + "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiwAAAKAy48fwMuPH\n8AAAAAtzc2gtZWQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiw\nAAAEAYUCIdfLI14K3XIy9V0FDZLQoZ9gcjOnvFjb4uA335HmKc0TlyEy0IeHcFXQfX4Kk+\nURAHBHlwP5dv2LwxocaLAAAAHHF1ZXh0ZW5ATWFjQm9vay1Qcm8tMTYubG9jYWwB\n-----END OPENSSH PRIVATE KEY-----", + "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKc0TlyEy0IeHcFXQfX4Kk+URAHBHlwP5dv2LwxocaL", + "fingerprint": "SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0" + }, + "favorite": false, + "reprompt": 0, + "passwordHistory": null, + "revisionDate": "2024-01-30T11:25:25.466Z", + "creationDate": "2024-01-30T11:25:25.466Z", + "deletedDate": null } ] } \ No newline at end of file diff --git a/crates/bitwarden-exporters/src/json.rs b/crates/bitwarden-exporters/src/json.rs index 3f6c72c1..7ed85d45 100644 --- a/crates/bitwarden-exporters/src/json.rs +++ b/crates/bitwarden-exporters/src/json.rs @@ -2,7 +2,9 @@ use chrono::{DateTime, Utc}; use thiserror::Error; use uuid::Uuid; -use crate::{Card, Cipher, CipherType, Field, Folder, Identity, Login, LoginUri, SecureNote}; +use crate::{ + Card, Cipher, CipherType, Field, Folder, Identity, Login, LoginUri, SecureNote, SshKey, +}; #[derive(Error, Debug)] pub enum JsonError { @@ -69,6 +71,8 @@ struct JsonCipher { card: Option, #[serde(skip_serializing_if = "Option::is_none")] secure_note: Option, + #[serde(skip_serializing_if = "Option::is_none")] + ssh_key: Option, favorite: bool, reprompt: u8, @@ -206,6 +210,24 @@ impl From for JsonIdentity { } } +#[derive(serde::Serialize)] +#[serde(rename_all = "camelCase")] +struct JsonSshKey { + private_key: Option, + public_key: Option, + fingerprint: Option, +} + +impl From for JsonSshKey { + fn from(ssh_key: SshKey) -> Self { + JsonSshKey { + private_key: ssh_key.private_key, + public_key: ssh_key.public_key, + fingerprint: ssh_key.fingerprint, + } + } +} + #[derive(serde::Serialize)] #[serde(rename_all = "camelCase")] struct JsonField { @@ -233,13 +255,15 @@ impl From for JsonCipher { CipherType::SecureNote(_) => 2, CipherType::Card(_) => 3, CipherType::Identity(_) => 4, + CipherType::SshKey(_) => 5, }; - let (login, secure_note, card, identity) = match cipher.r#type { - CipherType::Login(l) => (Some((*l).into()), None, None, None), - CipherType::SecureNote(s) => (None, Some((*s).into()), None, None), - CipherType::Card(c) => (None, None, Some((*c).into()), None), - CipherType::Identity(i) => (None, None, None, Some((*i).into())), + let (login, secure_note, card, identity, ssh_key) = match cipher.r#type { + CipherType::Login(l) => (Some((*l).into()), None, None, None, None), + CipherType::SecureNote(s) => (None, Some((*s).into()), None, None, None), + CipherType::Card(c) => (None, None, Some((*c).into()), None, None), + CipherType::Identity(i) => (None, None, None, Some((*i).into()), None), + CipherType::SshKey(ssh) => (None, None, None, None, Some((*ssh).into())), }; JsonCipher { @@ -254,6 +278,7 @@ impl From for JsonCipher { identity, card, secure_note, + ssh_key, favorite: cipher.favorite, reprompt: cipher.reprompt, fields: cipher.fields.into_iter().map(|f| f.into()).collect(), @@ -594,6 +619,60 @@ mod tests { ) } + #[test] + fn test_convert_ssh_key() { + let cipher = Cipher { + id: "23f0f877-42b1-4820-a850-b10700bc41eb".parse().unwrap(), + folder_id: None, + + name: "My ssh key".to_string(), + notes: None, + + r#type: CipherType::SshKey(Box::new(SshKey { + private_key: Some("private".to_string()), + public_key: Some("public".to_string()), + fingerprint: Some("fingerprint".to_string()), + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + creation_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + deleted_date: None, + }; + + let json = serde_json::to_string(&JsonCipher::from(cipher)).unwrap(); + + let expected = r#"{ + "passwordHistory": null, + "revisionDate": "2024-01-30T11:25:25.466Z", + "creationDate": "2024-01-30T11:25:25.466Z", + "deletedDate": null, + "id": "23f0f877-42b1-4820-a850-b10700bc41eb", + "organizationId": null, + "folderId": null, + "type": 5, + "reprompt": 0, + "name": "My ssh key", + "notes": null, + "sshKey": { + "privateKey": "private", + "publicKey": "public", + "fingerprint": "fingerprint" + }, + "favorite": false, + "collectionIds": null + }"#; + + assert_eq!( + json.parse::().unwrap(), + expected.parse::().unwrap() + ) + } + #[test] pub fn test_export() { let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -750,6 +829,28 @@ mod tests { creation_date: "2024-01-30T17:54:50.706Z".parse().unwrap(), deleted_date: None, }, + Cipher { + id: "646594a9-a9cb-4082-9d57-0024c3fbcaa9".parse().unwrap(), + folder_id: None, + + name: "My ssh key".to_string(), + notes: None, + + r#type: CipherType::SshKey(Box::new(SshKey { + private_key: Some("-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiwAAAKAy48fwMuPH\n8AAAAAtzc2gtZWQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiw\nAAAEAYUCIdfLI14K3XIy9V0FDZLQoZ9gcjOnvFjb4uA335HmKc0TlyEy0IeHcFXQfX4Kk+\nURAHBHlwP5dv2LwxocaLAAAAHHF1ZXh0ZW5ATWFjQm9vay1Qcm8tMTYubG9jYWwB\n-----END OPENSSH PRIVATE KEY-----".to_string()), + public_key: Some("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKc0TlyEy0IeHcFXQfX4Kk+URAHBHlwP5dv2LwxocaL".to_string()), + fingerprint: Some("SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0".to_string()), + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + creation_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + deleted_date: None, + } ], ) .unwrap(); diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 75b0503e..f6bb8dbf 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -70,6 +70,7 @@ pub enum CipherType { SecureNote(Box), Card(Box), Identity(Box), + SshKey(Box), } impl fmt::Display for CipherType { @@ -79,6 +80,7 @@ impl fmt::Display for CipherType { CipherType::SecureNote(_) => write!(f, "note"), CipherType::Card(_) => write!(f, "card"), CipherType::Identity(_) => write!(f, "identity"), + CipherType::SshKey(_) => write!(f, "ssh_key"), } } } @@ -132,3 +134,12 @@ pub struct Identity { pub passport_number: Option, pub license_number: Option, } + +pub struct SshKey { + /// [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key), in PEM encoding. + pub private_key: Option, + /// Ssh public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index 1d56e723..1d2e80d9 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -74,6 +74,14 @@ impl TryFrom for crate::Cipher { license_number: i.license_number, })) } + CipherType::SshKey => { + let s = require!(value.ssh_key); + crate::CipherType::SshKey(Box::new(crate::SshKey { + private_key: s.private_key, + public_key: s.public_key, + fingerprint: s.fingerprint, + })) + } }; Ok(Self { @@ -172,6 +180,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index d1a058c0..bf589879 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -208,6 +208,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -258,6 +259,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -312,6 +314,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 8ac4bfe7..846d332c 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -14,7 +14,7 @@ use uuid::Uuid; use super::{ attachment, card, field, identity, local_data::{LocalData, LocalDataView}, - secure_note, + secure_note, ssh_key, }; use crate::{ password_history, Fido2CredentialFullView, Fido2CredentialView, Login, LoginView, @@ -41,6 +41,7 @@ pub enum CipherType { SecureNote = 2, Card = 3, Identity = 4, + SshKey = 5, } #[derive(Clone, Copy, Serialize_repr, Deserialize_repr, Debug, JsonSchema, PartialEq)] @@ -72,6 +73,7 @@ pub struct Cipher { pub identity: Option, pub card: Option, pub secure_note: Option, + pub ssh_key: Option, pub favorite: bool, pub reprompt: CipherRepromptType, @@ -109,6 +111,7 @@ pub struct CipherView { pub identity: Option, pub card: Option, pub secure_note: Option, + pub ssh_key: Option, pub favorite: bool, pub reprompt: CipherRepromptType, @@ -137,6 +140,7 @@ pub enum CipherListViewType { SecureNote, Card, Identity, + SshKey, } #[derive(Serialize, Deserialize, Debug, JsonSchema, PartialEq)] @@ -211,6 +215,7 @@ impl KeyEncryptable for CipherView { identity: self.identity.encrypt_with_key(key)?, card: self.card.encrypt_with_key(key)?, secure_note: self.secure_note.encrypt_with_key(key)?, + ssh_key: self.ssh_key.encrypt_with_key(key)?, favorite: self.favorite, reprompt: self.reprompt, organization_use_totp: self.organization_use_totp, @@ -245,6 +250,7 @@ impl KeyDecryptable for Cipher { identity: self.identity.decrypt_with_key(key).ok().flatten(), card: self.card.decrypt_with_key(key).ok().flatten(), secure_note: self.secure_note.decrypt_with_key(key).ok().flatten(), + ssh_key: self.ssh_key.decrypt_with_key(key).ok().flatten(), favorite: self.favorite, reprompt: self.reprompt, organization_use_totp: self.organization_use_totp, @@ -329,6 +335,18 @@ impl Cipher { .transpose()?, ) } + CipherType::SshKey => { + let Some(ssh_key) = &self.ssh_key else { + return Ok(String::new()); + }; + + ssh_key + .fingerprint + .as_ref() + .map(|c| c.decrypt_with_key(key)) + .transpose()? + .unwrap_or_default() + } }) } } @@ -553,6 +571,7 @@ impl KeyDecryptable for Cipher { CipherType::SecureNote => CipherListViewType::SecureNote, CipherType::Card => CipherListViewType::Card, CipherType::Identity => CipherListViewType::Identity, + CipherType::SshKey => CipherListViewType::SshKey, }, favorite: self.favorite, reprompt: self.reprompt, @@ -614,6 +633,8 @@ impl TryFrom for Cipher { identity: cipher.identity.map(|i| (*i).try_into()).transpose()?, card: cipher.card.map(|c| (*c).try_into()).transpose()?, secure_note: cipher.secure_note.map(|s| (*s).try_into()).transpose()?, + // TODO: add ssh_key when api bindings have been updated + ssh_key: None, favorite: cipher.favorite.unwrap_or(false), reprompt: cipher .reprompt @@ -650,6 +671,7 @@ impl From for CipherType { bitwarden_api_api::models::CipherType::SecureNote => CipherType::SecureNote, bitwarden_api_api::models::CipherType::Card => CipherType::Card, bitwarden_api_api::models::CipherType::Identity => CipherType::Identity, + // TODO: add ssh_key when api bindings have been updated } } } @@ -669,6 +691,7 @@ mod tests { use std::collections::HashMap; use attachment::AttachmentView; + use ssh_key::SshKey; use super::*; use crate::Fido2Credential; @@ -695,6 +718,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, @@ -753,6 +777,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -1159,4 +1184,48 @@ mod tests { let subtitle = build_subtitle_identity(first_name, last_name); assert_eq!(subtitle, ""); } + + #[test] + fn test_subtitle_ssh_key() { + let key = "hvBMMb1t79YssFZkpetYsM3deyVuQv4r88Uj9gvYe0+G8EwxvW3v1iywVmSl61iwzd17JW5C/ivzxSP2C9h7Tw==".to_string(); + let key = SymmetricCryptoKey::try_from(key).unwrap(); + let original_subtitle = "SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0".to_string(); + let fingerprint_encrypted = original_subtitle.to_owned().encrypt_with_key(&key).unwrap(); + let ssh_key_cipher = Cipher { + id: Some("090c19ea-a61a-4df6-8963-262b97bc6266".parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + r#type: CipherType::SshKey, + key: None, + name: "My test ssh key" + .to_string() + .encrypt_with_key(&key) + .unwrap(), + notes: None, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: Some(SshKey { + private_key: None, + public_key: None, + fingerprint: Some(fingerprint_encrypted), + }), + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + }; + let subtitle = ssh_key_cipher.get_decrypted_subtitle(&key).unwrap(); + assert_eq!(subtitle, original_subtitle); + } } diff --git a/crates/bitwarden-vault/src/cipher/mod.rs b/crates/bitwarden-vault/src/cipher/mod.rs index 67513d52..a4a6088d 100644 --- a/crates/bitwarden-vault/src/cipher/mod.rs +++ b/crates/bitwarden-vault/src/cipher/mod.rs @@ -8,6 +8,7 @@ pub(crate) mod linked_id; pub(crate) mod local_data; pub(crate) mod login; pub(crate) mod secure_note; +pub(crate) mod ssh_key; pub use attachment::{ Attachment, AttachmentEncryptResult, AttachmentFile, AttachmentFileView, AttachmentView, diff --git a/crates/bitwarden-vault/src/cipher/ssh_key.rs b/crates/bitwarden-vault/src/cipher/ssh_key.rs new file mode 100644 index 00000000..6d4977c8 --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/ssh_key.rs @@ -0,0 +1,49 @@ +use bitwarden_crypto::{ + CryptoError, EncString, KeyDecryptable, KeyEncryptable, SymmetricCryptoKey, +}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +pub struct SshKey { + /// SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key) + pub private_key: Option, + /// SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} + +#[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +pub struct SshKeyView { + /// SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key) + pub private_key: Option, + /// SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} + +impl KeyEncryptable for SshKeyView { + fn encrypt_with_key(self, key: &SymmetricCryptoKey) -> Result { + Ok(SshKey { + private_key: self.private_key.encrypt_with_key(key)?, + public_key: self.public_key.encrypt_with_key(key)?, + fingerprint: self.fingerprint.encrypt_with_key(key)?, + }) + } +} + +impl KeyDecryptable for SshKey { + fn decrypt_with_key(&self, key: &SymmetricCryptoKey) -> Result { + Ok(SshKeyView { + private_key: self.private_key.decrypt_with_key(key).ok().flatten(), + public_key: self.public_key.decrypt_with_key(key).ok().flatten(), + fingerprint: self.fingerprint.decrypt_with_key(key).ok().flatten(), + }) + } +} diff --git a/crates/bitwarden-vault/src/mobile/client_ciphers.rs b/crates/bitwarden-vault/src/mobile/client_ciphers.rs index 345f04df..063fb4bc 100644 --- a/crates/bitwarden-vault/src/mobile/client_ciphers.rs +++ b/crates/bitwarden-vault/src/mobile/client_ciphers.rs @@ -118,6 +118,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, @@ -159,6 +160,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, From b0b39a863bf0747230bea07b1bd37191bf02de3c Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:02:22 -0700 Subject: [PATCH 26/39] Remove bitwarden from build-rust-crates --- .github/workflows/build-rust-crates.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index bc00dd97..6c433418 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -25,7 +25,6 @@ jobs: - windows-latest package: - - bitwarden - bitwarden-api-api - bitwarden-api-identity - bitwarden-crypto From 402d19dbf0cd0f8bc13e0b54fdeb5c757e486fcc Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:06:40 -0700 Subject: [PATCH 27/39] Change wasm test to use internal --- .github/workflows/rust-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index afc144a2..73f3aed7 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -95,13 +95,13 @@ jobs: uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Check - run: cargo check -p bitwarden-wasm --target wasm32-unknown-unknown + run: cargo check -p bitwarden-wasm-internal --target wasm32-unknown-unknown - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Wasm-pack test firefox - run: wasm-pack test --headless --firefox crates/bitwarden-wasm + run: wasm-pack test --headless --firefox crates/bitwarden-wasm-internal - name: Wasm-pack test chrome - run: wasm-pack test --headless --chrome crates/bitwarden-wasm + run: wasm-pack test --headless --chrome crates/bitwarden-wasm-internal From 655e6f2ca7fda126ad84ebde1e3037e7c99d0d5b Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:13:24 -0700 Subject: [PATCH 28/39] Check whole repo --- .github/workflows/minimum-rust-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-rust-version.yml b/.github/workflows/minimum-rust-version.yml index 812822c6..0557948e 100644 --- a/.github/workflows/minimum-rust-version.yml +++ b/.github/workflows/minimum-rust-version.yml @@ -42,4 +42,4 @@ jobs: key: msrv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} - name: cargo check MSRV - run: cargo check -p bitwarden --all-features + run: cargo check --all-features From 24aee1069b3fcc0439b7714478372ddfe9ff6ef2 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:24:03 -0700 Subject: [PATCH 29/39] Fix workflows --- .github/workflows/build-android.yml | 8 ++++---- .github/workflows/rust-test.yml | 30 ----------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 49ee2084..ab451e4b 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -91,10 +91,10 @@ jobs: working-directory: languages/kotlin/sdk/src/main/jniLibs run: | mkdir armeabi-v7a arm64-v8a x86 x86_64 - mv /home/runner/work/sdk/sdk/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./armeabi-v7a/libbitwarden_uniffi.so - mv /home/runner/work/sdk/sdk/android-aarch64-linux-android/libbitwarden_uniffi.so ./arm64-v8a/libbitwarden_uniffi.so - mv /home/runner/work/sdk/sdk/android-i686-linux-android/libbitwarden_uniffi.so ./x86/libbitwarden_uniffi.so - mv /home/runner/work/sdk/sdk/android-x86_64-linux-android/libbitwarden_uniffi.so ./x86_64/libbitwarden_uniffi.so + mv ./sdk/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/armeabi-v7a/libbitwarden_uniffi.so + mv ./sdk/android-aarch64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/arm64-v8a/libbitwarden_uniffi.so + mv ./sdk/android-i686-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86/libbitwarden_uniffi.so + mv ./sdk/android-x86_64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86_64/libbitwarden_uniffi.so - name: Generate bindings working-directory: languages/kotlin diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 73f3aed7..68993bff 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -75,33 +75,3 @@ jobs: uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - wasm: - name: WASM - - runs-on: ubuntu-22.04 - - steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - targets: wasm32-unknown-unknown - - - name: Cache cargo registry - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - - - name: Check - run: cargo check -p bitwarden-wasm-internal --target wasm32-unknown-unknown - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - name: Wasm-pack test firefox - run: wasm-pack test --headless --firefox crates/bitwarden-wasm-internal - - - name: Wasm-pack test chrome - run: wasm-pack test --headless --chrome crates/bitwarden-wasm-internal From 2bbdfd39b8febfad73ed0ae373d36172858df6b5 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:25:50 -0700 Subject: [PATCH 30/39] Remove SM codeowners --- .github/CODEOWNERS | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6968746f..ec0c52c9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -17,6 +17,3 @@ .github/workflows/release-rust-crates.yml .github/workflows/release-swift.yml .github/workflows/version-bump.yml - -# Secrets Manager team -crates/bitwarden-sm @bitwarden/team-secrets-manager-dev From 900f50b07946a63676cf3fed4f58efab5dbd404e Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:35:05 -0700 Subject: [PATCH 31/39] Fix android --- .github/workflows/build-android.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index ab451e4b..f5e72845 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -91,10 +91,10 @@ jobs: working-directory: languages/kotlin/sdk/src/main/jniLibs run: | mkdir armeabi-v7a arm64-v8a x86 x86_64 - mv ./sdk/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/armeabi-v7a/libbitwarden_uniffi.so - mv ./sdk/android-aarch64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/arm64-v8a/libbitwarden_uniffi.so - mv ./sdk/android-i686-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86/libbitwarden_uniffi.so - mv ./sdk/android-x86_64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86_64/libbitwarden_uniffi.so + mv ./sdk-internal/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/armeabi-v7a/libbitwarden_uniffi.so + mv ./sdk-internal/android-aarch64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/arm64-v8a/libbitwarden_uniffi.so + mv ./sdk-internal/android-i686-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86/libbitwarden_uniffi.so + mv ./sdk-internal/android-x86_64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86_64/libbitwarden_uniffi.so - name: Generate bindings working-directory: languages/kotlin From cf9d7a2ea361c4f7b4d658f26b5a2d94346314f6 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:39:26 -0700 Subject: [PATCH 32/39] Fix --- .github/workflows/rust-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 68993bff..9dee652d 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -16,7 +16,6 @@ jobs: runs-on: ubuntu-22.04 needs: - test - - wasm steps: - run: exit 0 From 3fefa19cad66feb256b84b156d32c97b6a436f05 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:48:27 -0700 Subject: [PATCH 33/39] I give up --- .github/workflows/build-android.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index f5e72845..ba8d6e94 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -91,10 +91,10 @@ jobs: working-directory: languages/kotlin/sdk/src/main/jniLibs run: | mkdir armeabi-v7a arm64-v8a x86 x86_64 - mv ./sdk-internal/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/armeabi-v7a/libbitwarden_uniffi.so - mv ./sdk-internal/android-aarch64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/arm64-v8a/libbitwarden_uniffi.so - mv ./sdk-internal/android-i686-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86/libbitwarden_uniffi.so - mv ./sdk-internal/android-x86_64-linux-android/libbitwarden_uniffi.so ./languages/kotlin/sdk/src/main/jniLibs/x86_64/libbitwarden_uniffi.so + mv /home/runner/work/sdk-internal/sdk-internal/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./armeabi-v7a/libbitwarden_uniffi.so + mv /home/runner/work/sdk-internal/sdk-internal/android-aarch64-linux-android/libbitwarden_uniffi.so ./arm64-v8a/libbitwarden_uniffi.so + mv /home/runner/work/sdk-internal/sdk-internal/android-i686-linux-android/libbitwarden_uniffi.so ./x86/libbitwarden_uniffi.so + mv /home/runner/work/sdk-internal/sdk-internal/android-x86_64-linux-android/libbitwarden_uniffi.so ./x86_64/libbitwarden_uniffi.so - name: Generate bindings working-directory: languages/kotlin From 9a0db4ac77d88b0d9ed6eb7459bd8c2ed70855bf Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 10:57:57 -0700 Subject: [PATCH 34/39] Update gradle gh packages --- languages/kotlin/sdk/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/languages/kotlin/sdk/build.gradle b/languages/kotlin/sdk/build.gradle index 2006e467..ebcb0838 100644 --- a/languages/kotlin/sdk/build.gradle +++ b/languages/kotlin/sdk/build.gradle @@ -76,7 +76,7 @@ publishing { repositories { maven { name = 'GitHubPackages' - url = 'https://maven.pkg.github.com/bitwarden/sdk' + url = 'https://maven.pkg.github.com/bitwarden/sdk-internal' credentials { username = System.getenv('GITHUB_ACTOR') password = System.getenv('GITHUB_TOKEN') @@ -96,12 +96,12 @@ File findRustlsPlatformVerifierClassesJar() { }.standardOutput.asText.get() def dependencyJson = new groovy.json.JsonSlurper().parseText(dependencyText) - def manifestPath = file(dependencyJson.packages.find { it.name == "rustls-platform-verifier-android" }.manifest_path) + def manifestPath = file(dependencyJson.packages.find { it.name == 'rustls-platform-verifier-android' }.manifest_path) def aar = fileTree(manifestPath.parentFile).matching { - include "maven/rustls/rustls-platform-verifier/*/rustls-platform-verifier-*.aar" + include 'maven/rustls/rustls-platform-verifier/*/rustls-platform-verifier-*.aar' }.getSingleFile() - return zipTree(aar).matching { include 'classes.jar'}.getSingleFile() + return zipTree(aar).matching { include 'classes.jar' }.getSingleFile() } dependencies { From 33cea358b074025f8100ba2cd9781288cf04c049 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 11:01:12 -0700 Subject: [PATCH 35/39] Resolve review feedback --- .github/workflows/rust-test.yml | 1 - .github/workflows/version-bump.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 9dee652d..58126679 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -44,7 +44,6 @@ jobs: uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Test - # Termporarily exclude NAPI due to a test error on windows run: cargo test --workspace --all-features coverage: diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 6a24d7df..4b3987e1 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -83,7 +83,7 @@ jobs: ### bitwarden - name: Bump bitwarden crate Version if: ${{ inputs.project == 'bitwarden' }} - run: cargo set-version -p bitwarden ${{ inputs.version_number }} + run: cargo set-version -p bitwarden-core ${{ inputs.version_number }} ############################ # VERSION BUMP SECTION END # From acf46387faa8a39953795c1079106b60f7e7f816 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 11:09:14 -0700 Subject: [PATCH 36/39] Tweak --- .github/workflows/version-bump.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 4b3987e1..272a6347 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -9,7 +9,7 @@ on: required: true type: choice options: - - bitwarden + - bitwarden-core version_number: description: "New version (example: '2024.1.0')" required: true @@ -82,7 +82,7 @@ jobs: ### bitwarden - name: Bump bitwarden crate Version - if: ${{ inputs.project == 'bitwarden' }} + if: ${{ inputs.project == 'bitwarden-core' }} run: cargo set-version -p bitwarden-core ${{ inputs.version_number }} ############################ From 988eed5825def31b444b2937ed83f1a34e373310 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 21 Oct 2024 11:09:33 -0700 Subject: [PATCH 37/39] 2 --- .github/workflows/version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 272a6347..6a33fe4f 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -81,7 +81,7 @@ jobs: ######################## ### bitwarden - - name: Bump bitwarden crate Version + - name: Bump bitwarden-core crate Version if: ${{ inputs.project == 'bitwarden-core' }} run: cargo set-version -p bitwarden-core ${{ inputs.version_number }} From f7202abd154ba028f7fc834d7b0ba47dc1039906 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 21 Oct 2024 22:36:19 +0200 Subject: [PATCH 38/39] Rename android artifact to -temp (#3) Fix android artifact. --- .github/workflows/generate_schemas.yml | 98 -------------------------- languages/kotlin/sdk/build.gradle | 2 +- 2 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 .github/workflows/generate_schemas.yml diff --git a/.github/workflows/generate_schemas.yml b/.github/workflows/generate_schemas.yml deleted file mode 100644 index 66e6f450..00000000 --- a/.github/workflows/generate_schemas.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Generate schemas - -on: - workflow_call: - workflow_dispatch: - push: - branches: - - main - - rc - - hotfix-rc - -env: - CARGO_TERM_COLOR: always - -jobs: - schemas: - name: Generate schemas - runs-on: ubuntu-22.04 - - steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - - name: Install rust - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable - with: - toolchain: stable - - - name: Set up Node - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - with: - cache: "npm" - cache-dependency-path: "package-lock.json" - node-version: "16" - - - name: NPM setup - run: npm ci - - - name: Cache cargo registry - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - - - name: NPM Schemas - run: npm run schemas - - - name: Upload ts schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: schemas.ts - path: ${{ github.workspace }}/languages/js/sdk-client/src/schemas.ts - if-no-files-found: error - - - name: Upload c# schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: schemas.cs - path: ${{ github.workspace }}/languages/csharp/Bitwarden.Sdk/schemas.cs - if-no-files-found: error - - - name: Upload python schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: schemas.py - path: ${{ github.workspace }}/languages/python/bitwarden_sdk/schemas.py - if-no-files-found: error - - - name: Upload ruby schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: schemas.rb - path: ${{ github.workspace }}/languages/ruby/bitwarden_sdk_secrets/lib/schemas.rb - if-no-files-found: error - - - name: Upload json schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: sdk-schemas-json - path: ${{ github.workspace }}/support/schemas/* - if-no-files-found: error - - - name: Upload Go schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: schemas.go - path: ${{ github.workspace }}/languages/go/schema.go - - - name: Upload java schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: sdk-schemas-java - path: ${{ github.workspace }}/languages/java/src/main/java/com/bitwarden/sdk/schema/* - if-no-files-found: error - - - name: Upload cpp schemas artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: sdk-schemas-cpp - path: ${{ github.workspace }}/languages/cpp/include/schemas.hpp - if-no-files-found: error diff --git a/languages/kotlin/sdk/build.gradle b/languages/kotlin/sdk/build.gradle index ebcb0838..ce23fa90 100644 --- a/languages/kotlin/sdk/build.gradle +++ b/languages/kotlin/sdk/build.gradle @@ -45,7 +45,7 @@ publishing { publications { maven(MavenPublication) { groupId = 'com.bitwarden' - artifactId = 'sdk-android' + artifactId = 'sdk-android-temp' if (findProperty('version') == 'unspecified') { // Determine the version from the git history. From 3800954c4cb5540c858fb8f282c22e0fa2e25d24 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:27:03 +1000 Subject: [PATCH 39/39] [PM-13910] Add collection.manage property (#4) --- crates/bitwarden-vault/src/collection.rs | 4 ++++ crates/bitwarden-vault/src/mobile/client_collection.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/bitwarden-vault/src/collection.rs b/crates/bitwarden-vault/src/collection.rs index 5e0fcbdc..ce798d92 100644 --- a/crates/bitwarden-vault/src/collection.rs +++ b/crates/bitwarden-vault/src/collection.rs @@ -21,6 +21,7 @@ pub struct Collection { pub external_id: Option, pub hide_passwords: bool, pub read_only: bool, + pub manage: bool, } #[derive(Serialize, Deserialize, Debug, JsonSchema)] @@ -35,6 +36,7 @@ pub struct CollectionView { pub external_id: Option, pub hide_passwords: bool, pub read_only: bool, + pub manage: bool, } impl LocateKey for Collection { @@ -57,6 +59,7 @@ impl KeyDecryptable for Collection { external_id: self.external_id.clone(), hide_passwords: self.hide_passwords, read_only: self.read_only, + manage: self.manage, }) } } @@ -72,6 +75,7 @@ impl TryFrom for Collection { external_id: collection.external_id, hide_passwords: collection.hide_passwords.unwrap_or(false), read_only: collection.read_only.unwrap_or(false), + manage: collection.manage.unwrap_or(false), }) } } diff --git a/crates/bitwarden-vault/src/mobile/client_collection.rs b/crates/bitwarden-vault/src/mobile/client_collection.rs index a3d6ee61..0c007f9e 100644 --- a/crates/bitwarden-vault/src/mobile/client_collection.rs +++ b/crates/bitwarden-vault/src/mobile/client_collection.rs @@ -58,6 +58,7 @@ mod tests { external_id: None, hide_passwords: false, read_only: false, + manage: false, }]).unwrap(); assert_eq!(dec[0].name, "Default collection"); @@ -74,6 +75,7 @@ mod tests { external_id: None, hide_passwords: false, read_only: false, + manage: false, }).unwrap(); assert_eq!(dec.name, "Default collection");