python-zulip-api icon indicating copy to clipboard operation
python-zulip-api copied to clipboard

api: Give quicker feedback if your credentials are wrong

Open showell opened this issue 5 years ago • 33 comments

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.

showell avatar Jan 29 '20 01:01 showell

@zulipbot claim

Kushal-kothari avatar Feb 23 '20 05:02 Kushal-kothari

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)!

zulipbot avatar Feb 23 '20 05:02 zulipbot

@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.

Kushal-kothari avatar Feb 23 '20 15:02 Kushal-kothari

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!

zulipbot avatar Mar 04 '20 16:03 zulipbot

@zulipbot claim

Kushal-kothari avatar Mar 11 '20 04:03 Kushal-kothari

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!

zulipbot avatar Mar 21 '20 08:03 zulipbot

@zulipbot claim

TAM360 avatar Apr 14 '20 02:04 TAM360

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 avatar Apr 14 '20 02:04 zulipbot

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!

zulipbot avatar Apr 24 '20 08:04 zulipbot

@zulipbot I am currently working on this issue.

TAM360 avatar Apr 24 '20 08:04 TAM360

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

zulipbot avatar May 08 '20 21:05 zulipbot

@zulipbot claim

Pradhvan avatar Jun 23 '20 06:06 Pradhvan

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 avatar Jun 23 '20 06:06 zulipbot

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!

zulipbot avatar Jul 03 '20 09:07 zulipbot

I am starting to work on it now. 😄

Pradhvan avatar Jul 04 '20 12:07 Pradhvan

I think #592 is attempting to address this.

QEDK avatar Sep 19 '20 12:09 QEDK

#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.

showell avatar Sep 19 '20 15:09 showell

@zulipbot claim

QEDK avatar Sep 19 '20 15:09 QEDK

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 avatar Sep 19 '20 15:09 zulipbot

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!

zulipbot avatar Sep 29 '20 20:09 zulipbot

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

QEDK avatar Sep 29 '20 21:09 QEDK

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.

showell avatar Oct 06 '20 15:10 showell

@zulipbot claim

dmarar avatar Nov 19 '20 18:11 dmarar

@zulipbot claim

vinitwadgaonkar avatar Dec 15 '20 14:12 vinitwadgaonkar

please assign this issue to me

vinitwadgaonkar avatar Dec 15 '20 14:12 vinitwadgaonkar

@zulipbot claim

vinitwadgaonkar avatar Jan 15 '21 14:01 vinitwadgaonkar

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!

zulipbot avatar Jan 15 '21 14:01 zulipbot

@zulipbot claim

kamalbuilds avatar Feb 09 '22 08:02 kamalbuilds

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 avatar Feb 09 '22 08:02 zulipbot

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!

zulipbot avatar Feb 19 '22 13:02 zulipbot