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

chore: add available options for perm on error #5814

Conversation

vasco-santos
Copy link
Contributor

@vasco-santos vasco-santos commented Mar 15, 2021

This PR adds more information on the auth CLI error. My flow to use the auth command was:

$ lotus auth
NAME:
   lotus auth - Manage RPC permissions

USAGE:
   lotus auth command [command options] [arguments...]

COMMANDS:
   create-token  Create token
   api-info      Get token with API info required to connect to this node
   help, h       Shows a list of commands or help for one command

OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

$ lotus auth api-info
ERROR: --perm flag not set

This PR suggests the enhancement of the error to:

$ lotus auth api-info
ERROR: --perm flag not set, use with one of: read, write, sign, admin

We can also use lotus auth api-info --help, but I think that creates some confusion as commandOptions seem optional. This helps the user to be able to just act instead of trying to figure out what the problem is.


I would also like to discuss the usage of the read token. It is not mandatory for the client, are there thoughts about having it required? Otherwise, we could remove the read option as it is quite useless at this moment.

We could iterate on:

lotus auth create-token --write
lotus auth create-token --sign
lotus auth create-token --admin
lotus auth api-info

The api-info would return all the available tokens for each type of permissions. Let me know your thoughts and I can update this PR or create a follow up

@magik6k magik6k added the area/ux Area: UX label Mar 19, 2021
@magik6k magik6k merged commit 312c69f into filecoin-project:master Mar 25, 2021
@magik6k magik6k mentioned this pull request Apr 13, 2021
69 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ux Area: UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants