tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
126 stars 76 forks source link

Implement proper XML parsing, fix QoS parsing / acks, add disable_auth_cert #241

Closed bluemods closed 7 months ago

bluemods commented 7 months ago

This aims to enable the client to auto reconnect properly, handle connection failures, and parse stanzas using pull parsing.

Some notes:

tomer8007 commented 7 months ago

Thank you for this awesome pull request.

  1. If everything inside the http directory deals with HTTP requests, maybe it will be better to rename it to http_requests?
  2. At which cases you could enable disable_auth_cert and can this be automated?
bluemods commented 7 months ago

1) I renamed http to http_requests to resolve that 2) auth certs have one purpose, this is to sign JWTs for clients using the Kik browser and wanting to authenticate their account for web requests (like linking their account to a game and proving ownership, or authenticating against a Kik web-service like the sticker and emoji inventories). This functionality is part of the kik.js library, for which the docs have been taken offline but it still works and I have a copy of them. This library doesn't currently implement the functionality to create JWTs / sign requests, so it won't have a use for most people.

I made an archive of the kik.js docs. Search for kik.sign to read more about it

tomer8007 commented 7 months ago

Oh I see. So the auth cert request was added by @kandnub in 9ea8795063a353a212b8b8383f12c97469ddc729. Do you think we can have disable_auth_cert=True by default? Or even remove the self.authenticator.send_stanza() line?

bluemods commented 7 months ago

Oh I see. So the auth cert request was added by @kandnub in 9ea8795. Do you think we can have disable_auth_cert=True by default? Or even remove the self.authenticator.send_stanza() line?

True by default, sure, but I don't see a reason to remove it entirely.

tomer8007 commented 7 months ago

I don't see a reason to remove it entirely.

We won't remove the AuthStanza class of course, but why would anyone want to create a bot with disable_auth_cert=False? Can you give one example?

bluemods commented 7 months ago

JWT signing / requests could be implemented for interacting with websites or unlocking all the emotes in Kik's emote shop, for example. But it is a very niche use case so I did change it to be disabled by default.