ockam icon indicating copy to clipboard operation
ockam copied to clipboard

ockam enroll identity fixes

Open YorickdeJong opened this issue 1 year ago • 5 comments

Current behavior

Currently running ockam enroll handles identity re-use and creation differently depending on what the local state is. Here are the 3 states that are possible.

--identity option not used. And no prior enrollment, ~/.ockam is empty. Running ockam enroll creates a new identity, marks it as default, and saves it to a vault, and then uses that w/ Orchestrator.

--identity option not used. Default identity already exists in ~/.ockam and is used. A new identity is not created. This is the result of a previous successful enrollment, or, someone creating a new identity and marking it as the default using ockam identity create, etc.

—-identity my_id option is used. Where my_id has already been created and is on disk. Eg using ockam identity create my_id.

Proposed changes

Added correct error handling

Checks

  • [x] All commits in this Pull Request are signed and Verified by Github.
  • [x] All commits in this Pull Request follow the Ockam commit message convention.
  • [x] There are no Merge commits in this Pull Request. Ockam repo maintains a linear commit history. We merge Pull Requests by rebasing them onto the develop branch. Rebasing to the latest develop branch and force pushing to your Pull Request branch is okay.
  • [x] I have read and accept the Ockam Community Code of Conduct.
  • [x] I have read and accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam repository. The easiest way to do this is to edit the CONTRIBUTORS.csv file in the github web UI and create a separate Pull Request, this will mark the commit as verified.

YorickdeJong avatar Jan 31 '24 09:01 YorickdeJong

@nazmulidris

YorickdeJong avatar Feb 01 '24 16:02 YorickdeJong

Hi @nazmulidris, Hope you are doing well. Could you take a look at this PR?

YorickdeJong avatar Feb 06 '24 17:02 YorickdeJong

Hello @YorickdeJong ! I'll be reviewing your PR, nazmul is not available until next week. To make things easier on our side, could you:

I'll get with the review as soon as I can, thanks for submitting it!

adrianbenavides avatar Feb 13 '24 14:02 adrianbenavides

Thanks! Will take a look in about 1-2 days if that's ok :)

YorickdeJong avatar Feb 14 '24 17:02 YorickdeJong

Thanks! Will take a look in about 1-2 days if that's ok :)

Sure, whenever you can. Thanks 🙏

adrianbenavides avatar Feb 16 '24 09:02 adrianbenavides

This PR https://github.com/build-trust/ockam/pull/7616 actually closes this issue. We had to make some architectural changes to support this here

nazmulidris avatar Feb 27 '24 14:02 nazmulidris

@YorickdeJong Thank you for taking a look at this. We had a to make some architectural changes to CliState and ended up resolving this issue for a release version of the command. Sorry that we had to close it, and thank you for contributing to all the other issues as well.

nazmulidris avatar Feb 27 '24 14:02 nazmulidris