fortnitepy icon indicating copy to clipboard operation
fortnitepy copied to clipboard

Improve type hinting and consistency for auth.py + renaming ios_...

Open Luc1412 opened this issue 3 years ago • 1 comments

  • Attributes from classes in auth.py missing type hints. Instead of defining attributes in functions it might be better to define them in the init and type hinting them as optional.
  • ios_refresh_expires_at and refresh_expires_at are not converted into date time objects. Not sure if it's intended.
  • everything named ios_... should be renamed as using the iOS client is just one option. client_... might be a better prefix.
  • Auth._authenticate got a wrong return type hinted

Luc1412 avatar May 25 '22 07:05 Luc1412

Thanks for reporting. I will be going over most of the type hinting before 4.0 is released. Since the minimum python version has been bumped to 3.8, I will also add type hints to attributes.

As for the prefix ios_, I agree. I will rename it to something else so it's easier to understand.

Actually on the topic of ios. I might even change the default token used to the android one instead of the ios one. This would mean that everyone that has used ios up until now would have to either generate new device auths or change the token back to ios manually. I didn't originally want to do this for obvious reasons, but since 4.0 will be a big release with potentially lots of breaking stuff, this would be the time to do it. It seems like the best idea since ios isn't and hasn't really been supported for some time now. I'm still not 100% sure though.

Terbau avatar Jul 29 '22 00:07 Terbau