Comments (5)
Hi @nazmulidris
I can take a look at this one later today. Just to understand, I created a sample format of when a default identity doesn't or does exist. Please let me know if that is what you had in mind, such that i know what to work on.
from ockam.
@YorickdeJong Thank you for doing the mocks. I really appreciate it. This is
a great direction to head in 👏🏽 .
I think your mocks are a great starting point and we might try to create a PR that we can collaborate on as you get further in it. I can help provide feedback on the UX strings and the organization as you go. This way you won't have to iterate very far before you get feedback and I can engage with you along the way.
The identity section could reflect the following states:
-
No identity exists on the machine. A new one is created for the user. Saved to the vault locally. Marked as default. The user can be apprised of this information.
-
Default identity was found (eg in
~/.ockam
folder or whatever$OCKAM_HOME
is set to). The user can be apprised of this information - that a pre-existing default identity on the local machine is used. -
A given identity is used that is passed in via the
--identity
flag. The user can be apprised of this information that the given identity is used.
from ockam.
Hi @nazmulidris,
I'm glad the direction we're heading in is to your liking. I'll start working on the PR based on our discussion and the initial mocks I've created. I'll set up the PR (#7497), such that you can see its progression, thanks!
from ockam.
Hi @nazmulidris,
I've made progress on the issue. I found that name_identity
includes name
, vault_name
, and is_default
fields. Based on this, I've updated the terminal messages to reflect whether a default identity exists and if a specific identity is being used.
I've also added a function check_default_named_identity
in the CliState struct to verify the existence of a default identity. This function returns a boolean indicating the presence of a default identity.
Here are the key changes in the code:
// Print the identity name if it exists.
if let Ok(named_identity) = opts
.state
.get_named_identity_by_identifier(&identifier)
.await
{
// Notify the user that a new identity was created for them.
if !default_identity_exist {
opts.terminal.write_line(&fmt_log!(
"\nNo Identity name exists. A new identity was created for you: '{}'.",
color_primary(named_identity.name())
))?;
}
// Notify the user that the default identity will be used.
else if named_identity.is_default() && self.identity.is_none() {
opts.terminal
.write_line(&fmt_log!("\nExisting default identity: '{}' will be used for enrollment. \
To use a different identity, run `ockam enroll --identity <IDENTITY_NAME>`.",
color_primary(named_identity.name()))
)?;
}
// Notify the user that the chosen identity will be used.
else {
opts.terminal
.write_line(&fmt_log!("\nChosen identity: '{}' will be used for enrollment. \
To use the default identity, run `ockam enroll` instead.",
color_primary(named_identity.name()))
)?;
}
}
This update will show different messages based on whether a default identity exists, and if a specific identity is chosen. For example:
ockam enroll
with no default identity will now indicate that a new identity is created:
No Identity name exists. A new identity was created for you: '[name]'.
ockam enroll
with a default identity will inform the user about using the default identity:
Existing default identity: '[name]' will be used for enrollment. To use a different identity, run `ockam enroll --identity <IDENTITY_NAME>`.
ockam enroll --identity [name]
will confirm the chosen identity's usage:
Chosen identity: '[name]' will be used for enrollment. To use the default identity, run `ockam enroll` instead.
Do you think additional details, like vault information, should be included?
Best,
Yorick
from ockam.
This PR #7616 closes this issue
from ockam.
Related Issues (20)
- Report unused dependencies in CI HOT 2
- Improve type-safety for Identity arguments in `ockam_command` HOT 6
- Redpanda serverless are working and supported
- Kafka inlet and outlet supports ABAC policies
- Single command stress test project environments
- Allow to use `self` route to specify the same node
- Kafka consumer/producer/direct are replaced by Kafka inlet/outlet
- Kafka examples are using the new `kafka-inlet create`
- Portals excert backpressure
- Rust relays behaves like project relays
- Optimize Medic to avoid recreating inlet (instead, only recreate the secure channel and update the route inside the existing inlet)
- Kafka - Producer re-use the same key when re-connects
- what does the portal app do? Enroll says successful in the browser but failed in the app.
- Kafka - Allow encryption of specific fields
- Kafka - Keys are kept only for the duration of the topic retention window and regularly rotated
- Kafka code is easy to maintain, read and understand
- User can specify any bind address in Kafka Inlets
- Improve the Readability of Code
- Few tests in `secure channel examples` are being ignored
- Restrict allowed clippy warnings and errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ockam.