zulip / python-zulip-api

Python library for the Zulip API.
https://zulip.com/api/
Apache License 2.0
354 stars 355 forks source link

api: Give quicker feedback if your credentials are wrong #533

Open showell opened 4 years ago

showell commented 4 years ago

When you use the api and instantiate a Client, it will succeed as long as the credentials are well-formed, even if the credentials aren't actually valid. Of course, as soon as you try to use them, you'll get a proper error, but it might make sense to have some kind of "ping" method that you can call that literally just makes sure you can connect to the server, so that program can handle that error immediately before starting real work.

More discussion here:

https://chat.zulip.org/#narrow/stream/127-integrations/topic/python.20client/near/813065

Even though this might be a quick fix in terms of the amount of code, I recommend that you work on this only after you've worked with the API a bit and have a feel for the use cases. A big part of this issue is figuring out the strategy that makes the most sense here.

We'll also want to improve the docs here to reflect any new methods we add or best practices we decide to recommend.

Kushal-kothari commented 4 years ago

@zulipbot claim

zulipbot commented 4 years ago

Welcome to Zulip, @Kushal-kothari! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

Kushal-kothari commented 4 years ago

@showell . Am I on the correct path to interpret this issue Eg: whenever a user try to use an api for some random reason "x" (let say to create a bot and get it integrated). After adding the wrong credentials lets say (incorrect email id / incorrect token) we need a method handler that checks and give the feedback that the entered credentials are valid or not immediately and not after the whole process.

zulipbot commented 4 years ago

Hello @Kushal-kothari, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

Kushal-kothari commented 4 years ago

@zulipbot claim

zulipbot commented 4 years ago

Hello @Kushal-kothari, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

TAM360 commented 4 years ago

@zulipbot claim

zulipbot commented 4 years ago

Welcome to Zulip, @TAM360! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot commented 4 years ago

Hello @TAM360, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

TAM360 commented 4 years ago

@zulipbot I am currently working on this issue.

zulipbot commented 4 years ago

ERROR: You have not claimed this issue to work on yet.

Pradhvan commented 4 years ago

@zulipbot claim

zulipbot commented 4 years ago

Welcome to Zulip, @Pradhvan! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot commented 4 years ago

Hello @Pradhvan, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

Pradhvan commented 4 years ago

I am starting to work on it now. 😄

QEDK commented 3 years ago

I think #592 is attempting to address this.

showell commented 3 years ago

592 has been abandoned, so somebody should feel free to work on this, ideally after looking at that PR to see how much of it is headed in the right direction.

QEDK commented 3 years ago

@zulipbot claim

zulipbot commented 3 years ago

Welcome to Zulip, @QEDK! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot commented 3 years ago

Hello @QEDK, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

QEDK commented 3 years ago

Just been setting up my new environment in WSL, back at this! 🚀

showell commented 3 years ago

One thing to clarify--if the API has the wrong credentials, we should probably throw an exception, and not use sys.exit(1) or similar, since it's plausible that the calling code will simply want to handle the exception and move on.

We should take care to provide useful messaging to standard output, however, since 90% of use cases are probably people who are clearly just dealing with some kind of confusing configuration situation.

dmarar commented 3 years ago

@zulipbot claim

vinitwadgaonkar commented 3 years ago

@zulipbot claim

vinitwadgaonkar commented 3 years ago

please assign this issue to me

vinitwadgaonkar commented 3 years ago

@zulipbot claim

zulipbot commented 3 years ago

Hello @vinitwadgaonkar, it looks like you've currently claimed 1 issue in this repository. We encourage new contributors to focus their efforts on at most 1 issue at a time, so please complete your work on your other claimed issues before trying to claim this issue again.

We look forward to your valuable contributions!

kamalbuilds commented 2 years ago

@zulipbot claim

zulipbot commented 2 years ago

Welcome to Zulip, @legendarykamal! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot commented 2 years ago

Hello @legendarykamal, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

codewithnick commented 8 months ago

@zulipbot claim

zulipbot commented 8 months ago

Hello @codewithnick!

Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label.

If this is your first time here, we recommend reading our guide for new contributors before getting started.

codewithnick commented 8 months ago

@showell can you add help wanted tag here so I can contribute to this issue , thanks