The 1Password Connect Rust SDK provides your Rust applications access to the 1Password Connect API hosted on your infrastructure and leverage the power of 1Password Secrets Automation
The library can be used by Rust applications, tools, and other automations to access and manage items in 1Password Vaults.
This is an early draft and is a work in progress. I've posted this earlier so as to setup my crate online. Please wait for a proper release, which will be ready shortly; watch this space for further updates.
.env-sample
to .env
, making sure to update its values.http://localhost:8080
OP_API_TOKEN
in the .env
file.```rust use connect_1password::connect::Connect;
let connect = Connect::new();
// List vaults let (vaults, ) = connect.vault().getlist().await?;
// Add a login item let mut builder = LoginItemBuilder::new("vaultUUID"); builder.username(&"Bob".tostring()); builder.password(&"".tostring());
let item: FullItem = builder.build(); let (new_item, _) = connect.item().add(item).await?;
// newitem = ItemData { // id: "feprs5zpzn7ck5hwvk5r6zunju", // title: "", // vault: VaultID { // id: "c6erdleqzhjlh4iu7ptwyd7hmy", // }, // category: Some( // "LOGIN", // ), // urls: None, // favorite: None, // tags: None, // state: None, // createdat: Some( // 2022-05-19T09:32:31.634125991Z, // ), // updated_at: Some( // 2022-05-19T09:32:31.634126051Z, // ), // } ```
Refer to the docs for further examples.
Under the hood, Hyper is used with hyper_rustls which supports both HTTP and TLS connections out of the box.
From repository root:
shell script
cargo test
shell script
cargo build --release
This Rust crate has been created solely by me and so far is not "officially" supported by the awesome folk at 1Password. This may change, maybe and if they would like to help out and/or adopt this into the 1Password ecosystem, that would be nice as well.
1Password is the world’s most-loved password manager. By combining industry-leading security and award-winning design, the company provides private, secure, and user-friendly password management to businesses and consumers globally. More than 60,000 business customers trust 1Password as their enterprise password manager.
1Password requests you practice responsible disclosure if you discover a vulnerability. Please submit discoveries via BugCrowd.
For information about security practices, please visit our Security homepage.
This project is tested against the most recent stable rust version.