Skip to content

Commit

Permalink
Renamed crates and publish to crates.io.
Browse files Browse the repository at this point in the history
  • Loading branch information
apognu committed Mar 23, 2019
1 parent f2963ff commit 3068d37
Show file tree
Hide file tree
Showing 38 changed files with 147 additions and 112 deletions.
38 changes: 25 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [
"libknox",
"knox",
"knox-bin",
"knox-testing"
]
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following command creates an empty vault and takes the GPG identity for whic

```
$ knox init myidentity@example.com
INFO knox::commands::init > vault initialized successfully
INFO libknox::commands::init > vault initialized successfully
```

By default, the vault will be created in ```$HOME/.knox```. You can change this path by setting the ```KNOX_PATH``` environment variable.
Expand All @@ -57,7 +57,7 @@ By default, the vault will be created in ```$HOME/.knox```. You can change this

```
$ knox add dir/subdir/website.com username=apognu password=Str0ngP@ss
INFO knox::commands::write > entry personal/website was successfully added to the vault
INFO libknox::commands::write > entry personal/website was successfully added to the vault
```

```vault``` is attribute-agnostic, there is no special handling of, for instance, the ```password``` attribute. You can add any number of attributes to an entry.
Expand All @@ -69,7 +69,7 @@ One special kind of attribute is _confidential_ attributes. They only differ in
```
$ knox add website.com username=apognu password=
Enter value for 'password':
INFO knox::commands::write > entry personal/website was successfully added to the vault
INFO libknox::commands::write > entry personal/website was successfully added to the vault
```

### Generated passwords
Expand All @@ -90,7 +90,7 @@ An entire file can be embedded into an attribute with the syntax ```attr=@/path/

```
$ knox add personal/ssh pubkey=@/home/apognu/.ssh/id_rsa.pub privkey=@/home/apognu/.ssh/id_rsa
INFO knox::commands::write > entry personal/ssh was successfully added to the vault
INFO libknox::commands::write > entry personal/ssh was successfully added to the vault
$ knox show personal/ssh
Store » ssh » keys
privkey = <file content>
Expand Down Expand Up @@ -175,7 +175,7 @@ The syntax for modifying an existing secret is exactly the same as the one used

```
$ knox edit website.com -d url username=newlogin password=
INFO knox::commands::write > entry website.com was successfully edited
INFO libknox::commands::write > entry website.com was successfully edited
```

This command will delete thre ```url``` attribute from the secret, change the ```username``` attribute to ```newlogin``` and prompt for the value of the redacted attribute ```password```
Expand All @@ -186,14 +186,14 @@ A secret can be renamed through the ```rename``` command:

```
$ knox rename my/first/secret new/location/secret
INFO knox::commands::write > entry my/first/secret was successfully renamed to new/location/secret
INFO libknox::commands::write > entry my/first/secret was successfully renamed to new/location/secret
```

## Delete a secret

```
$ knox delete dir/subdir/website.com
INFO knox::commands::delete > entry 'dir/subdir/website.com' was successfully deleted from the vault
INFO libknox::commands::delete > entry 'dir/subdir/website.com' was successfully deleted from the vault
```

## Check if you've been pwned
Expand All @@ -202,7 +202,7 @@ Vault integrates Troy Hunt's [Have I Been Pwned](https://haveibeenpwned.com/) to

```
$ knox pwned my/super/password
INFO knox::commands::pwned > Pwnage status for attributes at pwned/test
INFO libknox::commands::pwned > Pwnage status for attributes at pwned/test
⚠ password -> PWNED
✓ secure -> CLEAR
⚠ apikey -> PWNED
Expand All @@ -213,7 +213,7 @@ The check is also performed for confidential attributes when adding or editing a
You may also omit the ```PATH``` paramter to initiate a vault-wide check against the data breaches. This may take some time, but will check all confidential attributes in your vault:

```
INFO knox::commands::pwned > checking for pwned secret across your vault
INFO libknox::commands::pwned > checking for pwned secret across your vault
⚠ test/insecure/test1/password -> PWNED
⚠ test/insecure/test1/apikey -> PWNED
⚠ test/insecure/test2/password -> PWNED
Expand All @@ -232,10 +232,10 @@ When you add or remove an identity to or from the vault, all entries (including

```
$ knox init myown@identity.com
INFO knox::commands::init > vault initialized successfully at /vault
INFO libknox::commands::init > vault initialized successfully at /vault
[...]
$ knox identities add myfriend@identity.com
INFO knox::commands::identities > Writing metadata file...
INFO libknox::commands::identities > Writing metadata file...
re-encrypting entry company/secret1
re-encrypting entry personal/secret2
re-encrypting entry company/secret2
Expand All @@ -256,7 +256,7 @@ The library contained in ```knox``` can be used by your program to access and ma
#
# main.rs
use knox::prelude::*;
use libknox::prelude::*;
fn main() -> Result<(), Box<dyn Error>> {
let context = VaultContext::open("/home/user/.knox")?;
Expand Down
31 changes: 0 additions & 31 deletions knox-bin/Cargo.toml

This file was deleted.

22 changes: 0 additions & 22 deletions knox-bin/src/util/mod.rs

This file was deleted.

2 changes: 1 addition & 1 deletion knox-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
edition = "2018"

[dependencies]
knox = { path = "../knox" }
libknox = { path = "../libknox" }
tempfile = "^3.0"
protobuf = "^2.2"
gpgme = "^0.8"
Expand Down
26 changes: 16 additions & 10 deletions knox/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
[package]
name = "knox"
version = "0.1.0"
description = "secret vault encrypted with GPG"
description = "structured secret vault encrypted through GPG"
authors = ["Antoine POPINEAU <antoine.popineau@appscho.com>"]
repository = "https://github.com/apognu/knox"
license = "MIT"

edition = "2018"
workspace = "../"
build = "build.rs"

[build-dependencies]
protoc-rust = "2.0"
[[bin]]
name = "knox"
path = "src/main.rs"

[dev-dependencies]
knox_testing = { path = "../knox-testing" }

[dependencies]
protobuf = "^2.2"
gpgme = "^0.8"
uuid = { version = "^0.7", features = ["v4"] }

[features]
protobufs = []
libknox = "^0.1"
log = "^0.4"
pretty_env_logger = "^0.2"
clap = { version = "^2.0", features = ["yaml"] }
rand = "^0.6"
rpassword = "2.1.0"
colored = "1.6"
clipboard = "^0.5"
dirs = "1.0.4"
reqwest = "^0.9.0"
sha-1 = "^0.8.0"
indicatif = "^0.11.0"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;
use colored::*;
use log::*;

use knox::prelude::*;
use libknox::prelude::*;

use crate::util::vault_path;

Expand All @@ -26,7 +26,7 @@ pub(crate) fn delete(args: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
mod tests {
use clap::App;

use knox::prelude::*;
use libknox::prelude::*;
use knox_testing::spec;

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use colored::*;
use log::*;

use crate::util::{display, hierarchy, vault_path};
use knox::prelude::*;
use libknox::prelude::*;

pub(crate) fn list(args: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
let path = args.value_of("path");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::error::Error;

use colored::*;
use indicatif::ProgressBar;
use knox::prelude::*;
use libknox::prelude::*;
use log::*;

use crate::util::vault_path;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::error::Error;

use colored::*;
use knox::prelude::*;
use libknox::prelude::*;

use crate::util::vault_path;

Expand Down
4 changes: 2 additions & 2 deletions knox-bin/src/commands/init.rs → knox/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;
use colored::*;
use log::*;

use knox::prelude::*;
use libknox::prelude::*;

use crate::util::vault_path;

Expand All @@ -26,7 +26,7 @@ pub(crate) fn init(args: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
mod tests {
use clap::App;

use knox::prelude::*;
use libknox::prelude::*;
use knox_testing::spec;

#[test]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;

use colored::*;
use indicatif::ProgressBar;
use knox::prelude::*;
use libknox::prelude::*;
use log::*;
use sha1::{Digest, Sha1};

Expand Down
4 changes: 2 additions & 2 deletions knox-bin/src/commands/write.rs → knox/src/commands/write.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::error::Error;

use colored::*;
use knox::prelude::*;
use libknox::prelude::*;
use log::*;

use crate::commands::pwned::{self, PwnedResult};
Expand Down Expand Up @@ -122,7 +122,7 @@ pub(crate) fn rename(args: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
mod tests {
use clap::App;

use knox::prelude::*;
use libknox::prelude::*;
use knox_testing::spec;

#[test]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions knox/src/spec.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[cfg(test)]
// #[cfg(test)]
use std::error::Error;
use std::path::Path;

use knox_testing::spec;

use crate::prelude::*;
use libknox::prelude::*;

pub(crate) fn get_test_vault<P>(path: P) -> Result<VaultContext, Box<dyn Error>>
where
Expand Down
Loading

0 comments on commit 3068d37

Please sign in to comment.