Coder Social home page Coder Social logo

maxkpower / sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitwarden/sdk

0.0 0.0 0.0 4.36 MB

Secrets Manager SDK

License: Other

Shell 0.24% JavaScript 0.31% Ruby 0.66% C++ 1.06% Python 0.27% PHP 1.79% Java 0.58% Go 0.52% C# 0.41% Rust 89.84% Kotlin 0.95% TypeScript 0.55% Swift 0.76% Handlebars 0.12% CMake 0.04% Dockerfile 0.13% Mustache 1.76%

sdk's Introduction

Bitwarden 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.

Disclaimer

The password manager SDK is not intended for public use and is not supported by Bitwarden at this stage. It is solely intended to centralize the business logic and to provide a single source of truth for the internal applications. As the SDK evolves into a more stable and feature complete state we will re-evaluate the possibility of publishing stable bindings for the public. The password manager interface is unstable and will change without warning.

We're Hiring!

Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our Careers page to see what opportunities are currently open as well as what it's like to work at Bitwarden.

Getting Started

cargo build

Crates

The project is structured as a monorepo using cargo workspaces. Some of the more noteworthy crates are:

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. The json schemas are later used to generate the API bindings for each language using QuickType.

npm run schemas

API Bindings

We autogenerate the server bindings using openapi-generator. To do this we first need to build the internal swagger documentation.

Swagger generation

The first step is to generate the swagger documents from the server repository.

# src/Api
dotnet swagger tofile --output ../../api.json ./bin/Debug/net8.0/Api.dll internal

# src/Identity
ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity.json ./bin/Debug/net8.0/Identity.dll v1

OpenApi Generator

To generate a new version of the bindings run the following script from the root of the SDK project.

./support/build-api.sh

This project uses customized templates which lives in the support/openapi-templates directory. These templates resolves some outstanding issues we've experienced with the rust generator. But we strive towards modifying the templates as little as possible to ease future upgrades.

Note: If you don't have the nightly toolchain installed, the build-api.sh script will install it for you.

Developer tools

This project recommends the use of certain developer tools, and also includes configurations for them to make developers lives easier. The use of these tools is optional and they might require a separate installation step.

The list of developer tools is:

  • Visual Studio Code: We provide a recommended extension list which should show under the Extensions tab when opening this project with the editor. We also offer a few launch settings and tasks to build and run the SDK
  • bacon: This is a CLI background code checker. We provide a configuration file with some of the most common tasks to run (check, clippy, test, doc - run bacon -l to see them all). This tool needs to be installed separately by running cargo install bacon --locked.
  • nexttest: This is a new and faster test runner, capable of running tests in parallel and with a much nicer output compared to cargo test. This tool needs to be installed separately by running cargo install cargo-nextest --locked. It can be manually run using cargo nextest run --all-features

Cargo fmt

We use certain unstable features for formatting which require the nightly version of cargo-fmt.

To install:

rustup component add rustfmt --toolchain nightly

To run:

cargo +nightly fmt

Contribute

Code contributions are welcome! Please commit any pull requests against the main branch. Learn more about how to contribute by reading the Contributing Guidelines. Check out the Contributing Documentation for how to get started with your first contribution.

Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the SECURITY.md file. We also run a program on HackerOne.

No grant of any rights in the trademarks, service marks, or logos of Bitwarden is made (except as may be necessary to comply with the notice requirements as applicable), and use of any Bitwarden trademarks must comply with Bitwarden Trademark Guidelines.

sdk's People

Contributors

renovate[bot] avatar hinton avatar dani-garcia avatar michalchecinski avatar coltonhurst avatar github-actions[bot] avatar tangowithfoxtrot avatar vgrassia avatar bitwarden-devops-bot avatar withinfocus avatar thomas-avery avatar dependabot[bot] avatar joseph-flinn avatar matt-livefront avatar differsthecat avatar bbujak avatar jlf0dev avatar carnei-ro avatar lukpotsym avatar mgibson1 avatar malirobot avatar milost77 avatar eeebru avatar patrick-bitwarden avatar slobokv83 avatar cvele avatar mimartin12 avatar audreyality avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.