https://github.com/m0dex/passbolt-api-rs
Rust library for interacting with Passbolt API
https://github.com/m0dex/passbolt-api-rs
Last synced: 9 months ago
JSON representation
Rust library for interacting with Passbolt API
- Host: GitHub
- URL: https://github.com/m0dex/passbolt-api-rs
- Owner: M0dEx
- License: gpl-3.0
- Created: 2022-01-28T22:46:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-03T20:55:49.000Z (over 4 years ago)
- Last Synced: 2025-08-30T20:02:33.077Z (9 months ago)
- Language: Rust
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# passbolt-api-rs
This is a tool to interact with [Passbolt API](https://help.passbolt.com/api) using pure Rust.
## Features
* Basic functions
* [X] Authentication
* [X] PGP message decryption
* [X] GET and POST methods
* [X] PUT, DELETE methods
* Advanced functions
* [ ] Structs
* [X] Users
* [ ] Groups
* [ ] Permissions
* [X] Resources
* [X] Secrets
* [ ] Folders
* [X] Actions
* [ ] Comments
* [ ] Methods for natural interaction with the structs
* [ ] Configuration file
* [ ] CLI
## Usage
```rust
const PRIVATE_KEY: &str = "
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: OpenPGP.js v4.10.9
Comment: https://openpgpjs.org
YOUR PRIVATE KEY
-----END PGP PRIVATE KEY BLOCK-----";
const PRIVATE_KEY_PW: &str = "PASSWORD FOR YOUR PRIVATE KEY";
#[tokio::main]
async fn main() -> Result<()> {
let mut passbolt = Passbolt::new(
"".to_string(),
SignedSecretKey::from_asc(PRIVATE_KEY).unwrap().0,
PRIVATE_KEY_PW.to_string(),
)
.await?;
let res_id = "";
let user_id = "";
/// "Raw" methods to interact in case a model does not exist/does not support wanted functionality
let resource_json = passbolt
.get(format(RESOURCE_URL, &[res_id]).as_str())
.await?
.1["body"]
.to_string();
/// Native Rust structs representing the objects and common interaction with them
let resource: Resource = passbolt
.get_resource(res_id)
.await?;
let secret: Secret = resource
.secret(&passbolt)
.await?;
let user: User = passbolt
.get_user(user_id)
.await?;
let history: Vec = resource
.history(&passbolt)
.await?;
println!("{:#?}", resource);
println!("{:#?}", secret.decrypt_data(&passbolt)?);
Ok(())
}
```
## [Known issues](https://github.com/M0dEx/passbolt-api-rs/issues)
## Disclaimer
This is a community driven project and it is not associated with Passbolt SA.