Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize identity change history in ockam identity show --full command #3258

Closed
mrinalwadhwa opened this issue Aug 17, 2022 · 2 comments
Closed

Comments

@mrinalwadhwa
Copy link
Member

mrinalwadhwa commented Aug 17, 2022

Currently

> ockam node create n1
...
> ockam identity show --full --node n1
01cc53b812830d84e7ced12e7c1ef439fb0e4f19c2559af0aef6abb42825567fc1010000084f434b414d5f524b0003012000000000000000200801878c3ea3861a67e416a7b3ce20aefbf65e5941fd4a4d772670dbbaf022460340b63ce930979978542d9352555bc34fd205bc784dd425ffa3f87f7be0dbd28ba7c4adaade6a6e8ed3384bb60d9e910c6e67d0c0ff87fbf2b592d43e5cc6acc705b9154549a381303a93dd12a27e173d7f366f1597ca282dace84737fcfb3fa2820101407c440c0e636bf9cd932615b9e69eb65810882ae335ec1bedf9daf729d2d31341cc287400722b3490ea6acbc673a345ca312e370ba767822e4806ac93ac603c0e

The above hex value is a serialized form of the identity.

An Ockam Identity is a series of change events that capture signed rotation and revocation of keys.

/// Identity implementation
#[derive(AsyncTryClone)]
#[async_try_clone(crate = "ockam_core")]
pub struct Identity<V: IdentityVault> {
id: IdentityIdentifier,
pub(crate) change_history: Arc<RwLock<IdentityChangeHistory>>,
pub(crate) ctx: Context,
pub(crate) vault: V,
}

pub struct IdentityChangeHistory(Vec<IdentityChangeEvent>);

https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_identity/src/change_history.rs#L32

Desired

We want to display some form of visualization of changes to an identity. Could be just a less opaque data structure or could some ascii art. We'd love ideas on how to visualize this data structure.

The code ockam identity show command is here
https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_command/src/identity/show.rs


We love helping new contributors!
If you have questions or need help as you work on your first Ockam contribution, please leave a comment on this discussion.
If you're looking for other issues to contribute to, checkout this discussion and labels - good first issue or help wanted

@mrinalwadhwa mrinalwadhwa changed the title Visualize identity change history ockam identity show --full command Visualize identity change history in ockam identity show --full command Aug 17, 2022
@adrianbenavides adrianbenavides added the hacktoberfest Apply to issues you want contributors to help with label Oct 3, 2022
@noyez
Copy link
Contributor

noyez commented Oct 20, 2022

Hello. I was looking at this issue. I created some nicer output for the identity, however I'm not sure I'm capturing your desired output. The only part of the Identity data struct that i am displaying is the change_history. Before I continue, I wanted to show the output so far so you can offer feedback if you wish.

Below is the output from the modified ockam identity show --full command.

A couple notes:

  • yes, there are repeated change-histories and signatures, which I synthesize to see how it looked with multiple change-histories and signatures. It will not repeat data normally, but as someone just exploring my change-histories and signatures were only 1 item deep and that may not represent the real-world identity. My experience is that testing with single element arrays/vectors leads to untested cases.
  • Is there any sensitivity to horizontal length? The public_key could easily be collapsed into a single line as the signatures are displayed or the signatures can be broken up into two lines per item as the public_key is.
Change History:
  Change[0]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:
        stype:      Ed25519
        data:       e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0] SelfSign: 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a7417710be2f1929549483827ac9e34544379610e29e1806778a9ae9204bf7fbc8adbc00138b2756a09
      [1] SelfSign: 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a7417710be2f1929549483827ac9e34544379610e29e1806778a9ae9204bf7fbc8adbc00138b2756a09
  Change[1]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:
        stype:      Ed25519
        data:       e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0] SelfSign: 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a7417710be2f1929549483827ac9e34544379610e29e1806778a9ae9204bf7fbc8adbc00138b2756a09
      [1] SelfSign: 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a7417710be2f1929549483827ac9e34544379610e29e1806778a9ae9204bf7fbc8adbc00138b2756a09

feedback welcome or I can just submit the PR.

@mrinalwadhwa
Copy link
Member Author

@noyez awesome, thank you for spending time on this!!
The output looks great!

  • No sensitivity to horizontal length.
  • visualizing just change history makes sense.

I created a related issue to add key rotation commands here #3685

Looking forward to the PR.

noyez added a commit to noyez/ockam that referenced this issue Oct 20, 2022
…w --full` command

This commit adds a more pleasing and human readable output for `ockam identity show --full`
command. This was mostly implmented by adding the `fmt::Display` trait to
the underlying types in the identity change history.
Before:
```
$ ockam identity show --full --node n1
01cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce1305...6778a9ae9204bf7fbc8adbc00138b2756a09
```
After:
```
$ ockam identity show --full --node n1
Change History:
  Change[0]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:   Ed25519 e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0]: SelfSign 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a741...9204bf7fbc8adbc00138b2756a09
```

issue ref: build-trust#3258
noyez added a commit to noyez/ockam that referenced this issue Oct 20, 2022
…w --full` command

This commit adds a more pleasing and human readable output for `ockam identity show --full`
command. This was mostly implmented by adding the `fmt::Display` trait to
the underlying types in the identity change history.
Before:
```
$ ockam identity show --full --node n1
01cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce1305...6778a9ae9204bf7fbc8adbc00138b2756a09
```
After:
```
$ ockam identity show --full --node n1
Change History:
  Change[0]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:   Ed25519 e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0]: SelfSign 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a741...9204bf7fbc8adbc00138b2756a09
```

issue ref: build-trust#3258
noyez added a commit to noyez/ockam that referenced this issue Oct 20, 2022
…w --full` command

This commit adds a more pleasing and human readable output for `ockam identity show --full`
command. This was mostly implmented by adding the `fmt::Display` trait to
the underlying types in the identity change history.
Before:
```
$ ockam identity show --full --node n1
01cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce1305...6778a9ae9204bf7fbc8adbc00138b2756a09
```
After:
```
$ ockam identity show --full --node n1
Change History:
  Change[0]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:   Ed25519 e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0]: SelfSign 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a741...9204bf7fbc8adbc00138b2756a09
```

issue ref: build-trust#3258
adrianbenavides pushed a commit to noyez/ockam that referenced this issue Oct 27, 2022
…w --full` command

This commit adds a more pleasing and human readable output for `ockam identity show --full`
command. This was mostly implmented by adding the `fmt::Display` trait to
the underlying types in the identity change history.
Before:
```
$ ockam identity show --full --node n1
01cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce1305...6778a9ae9204bf7fbc8adbc00138b2756a09
```
After:
```
$ ockam identity show --full --node n1
Change History:
  Change[0]:
    identifier: cdb5565163e5b1278eb31e6dbd213066e335da0c3e5d8ffed3789ce130523391
    change:
      prev_change_identifier: 0547c93239ba3d818ec26c9cdadd2a35cbdf1fa3b6d1a731e06164b1079fb7b8
      label:        OCKAM_RK
      public_key:   Ed25519 e7417e5ea17b05684cb56171f6f37ac92d37a03587fa43f66663bfda878a1322
    signatures:
      [0]: SelfSign 5e48f7a133ac1d9218f9fb7185cf890af6bbe9ca5ca58a741...9204bf7fbc8adbc00138b2756a09
```

issue ref: build-trust#3258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants