Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implementing the appwrite plugin #336
Implementing the appwrite plugin #336
Changes from 3 commits
54acb59
1111efb
b3d6c28
be44bff
f43221e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These looks like commands that would be scoped to a specific account.
Is there any documentation you could point me to about these commands? I wonder why they would not require auth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hculea without any argument these commands behave as if they were called with --help argument. So they just give you the list of available subcommands and options. Also, these are project specific commands. So if you run
appwrite users list
from the project folder (this requires auth, and can only be run from project folder which contains theappwrite.json
config file), you'll get the list of all users of that project.Here is the CLI documentation (they don't say the above in the docs, but all the examples given there are with arguments). I think @arunsathiya has verified this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my functional testing: The project token that we provision seems to work for
users list
andteams list
. I'd imagine that it works for the rest of the subcommands forusers
andteams
.However,
account get
(one of the many subcommands underaccount
) does not work with the project token, rather requires account scope. I think that's expecting a combination of username and password?Not too sure how
avatars
' subcommands work though.This matches my testing too. 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
account
commands work with currently logged in user (requires a session).users
is a more appropriate command from server's perspective.account
is for impersonating a user and acting in their behalf using their JWT token.avatars
offers below subcommands:These are some utility functions for getting images/icons for stuffs. e.g. getBrowser is for getting browser icon, getFlag for getting a country's flag icon etc.
Marking this conversation unresolved for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hculea Please let me know if I need to change anything, or provide more info.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if account doesn't work with the API KEY we provision anyway (it only works with a JWT), we should make sure we also exclude this command from out auth scheme as well:
needsauth.NotWhenContainsArgs("account"),
.As a bit of a background, where does that JWT come from? We should make sure this doesn't get placed somewhere on disk in plain-text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndyTitu The JWT comes when you use a Login/Password to login to the CLI (which we can't use with 1Passsword as this is an interactive process). Also, in this flow the JWT actually gets written to the same config file (~/.appwrite/prefs.json) on disk, again there won't be any JWT if we're using the CI mode (which we're doing with this integration).
You're right that the
account
commands don't work with an API KEY. Please let me know if I need to make this changeneedsauth.NotWhenContainsArgs("account")
.Thanks,
Rajeev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that change makes sense.
Sorry for the delayed reply!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem @accraw. Don't think this will be merged so it is okay. :-)