-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Enhancement request for console component help feature (IDFGH-7603) #9158
Comments
Another easy feature I have in my console implementation is an optional password. If passwordP is not null, a boolean authenticated is set false and the console task prompts with a "password>" prompt. When the user enters the configured password, authenticated is set true and normal console operation proceeds. Each failed password attempt bumps login_failure_cnt and whenever login_failure_cnt & 0x03 == 0 (every 4 failures), a brief vTaskDelay() prevents brute force attacks. An exit command sets the authenticated variable false again. This is easy to implement and provides a minimum level of security on console interfaces. |
Hi @dalbert2, the first suggestion (brief For the 2nd option, I think this doesn't require changes to the console component itself. You can start the console with only one command registered, e.g. |
Thanks @igrr, I mentioned the second enhancement (minimum password security) because it is so easy to implement and makes a significant improvement to the component. Virtually all CLI consoles on commercial devices have at least a minimum level of security. The workaround you propose is interesting, but there appears to be no way to un-register commands, so you could log in that way, but you would have to reset the unit to log out. The enhancement proposed is both easy to implement and adds important functionality. I'm new to IDF so it will be my first PR; I'm happy to make these changes and submit for review; unless you object, I'd like to open PRs for both. |
It is possible to un-initalize the console and re-initialize it again, as a lighter weight alternative to resetting the device. We can also accept a PR for un-registering commands, this sounds like a reasonable request! Typically we don't add additional functionality to core components, which
The request for a feature to log into the console hasn't been seen on the IDF feature tracker before. It is something that can be easily implemented in the application (just about 20 lines of code, as shown above). Different users may require different ways the passwords are validated. For these reasons I don't think we will accept a PR for this feature. Of course, if more developers chime in and say that they would like to see such functionality in IDF, we can reconsider this. I'm sorry if my reply sounds discouraging. For your first request (help command) we definitely welcome a PR. |
Here is the updated example which demonstrates logging out by de-initializing the console REPL. |
What about as an example? |
Hi @dalbert2, We develop a feature that enable users to decide the help command verbose level, and that will be available soon. |
I have always implemented a command line interface for my projects that's similar to the console component. I'm trying to switch to IDF standard components whenever possible. but an obstacle with the console component is the implementation of the help feature which generates excessive output once the number of commands grows larger than a trivial example.
For my own component, I implement help as a two-tier function:
the help command alone lists all commands, separated by commas and at the end suggests
"use help for more details".
help displays the detailed help for the specified command
This way a system with more than a few commands can generate reasonable amounts of output for any particular help request.
I'd be happy to modify the component code to do this if the maintainers agree it is desirable and permit me to do so. Otherwise, please consider this as an enhancement request.
The text was updated successfully, but these errors were encountered: