@hiveitsolutions/sdk-internal
v0.0.0
Published
This repository houses the internal Hive SDKs. We also provide a public [Secrets Manager SDK](https://github.com/CNI-Services/sdk-sm).
Readme
Hive Internal SDK
This repository houses the internal Hive SDKs. We also provide a public Secrets Manager SDK.
Disclaimer
The password manager SDK is not intended for public use and is not supported by CNI-Services 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 Hive.
Getting Started
Linux / Mac / Windows
cargo buildWindows on ARM
To build, you will need the following in your PATH:
- Python
- Clang
- We recommend installing this via the Visual Studio Build Tools
Documentation
Crates
The project is structured as a monorepo using cargo workspaces. Some of the more noteworthy crates are:
hive-api-api: Auto-generated API bindings for the API server.hive-api-identity: Auto-generated API bindings for the Identity server.hive-core: The core functionality consumed by the other crates.hive-crypto: Crypto library.hive-wasm-internal: WASM bindings for the internal SDK.hive-uniffi: Mobile bindings for swift and kotlin using UniFFI.
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 v1OpenApi Generator
To generate a new version of the bindings run the following script from the root of the SDK project.
./support/build-api.shThis 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 theExtensionstab when opening this project with the editor. We also offer a few launch settings and tasks to build and run the SDKbacon: 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- runbacon -lto see them all). This tool needs to be installed separately by runningcargo 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 tocargo test. This tool needs to be installed separately by runningcargo install cargo-nextest --locked. It can be manually run usingcargo nextest run --all-features
Formatting & Linting
This repository uses various tools to check formatting and linting before it's merged. It's recommended to run the checks prior to submitting a PR.
Installation
Please see the lint.yml file for example installation commands & versions. Here are the cli tools we use:
- Nightly cargo fmt and cargo udeps
- rust clippy
- cargo sort
- prettier
Checks
To verify if changes need to be made, here are examples for the above tools:
export RUSTFLAGS="-D warnings"
cargo +nightly fmt --check
cargo +nightly udeps --workspace --all-features
cargo clippy --all-features --tests
cargo sort --workspace --check
npm run lint