egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
371 stars 65 forks source link

The Great Auth Refactor of 2020 #93

Closed QuietMisdreavus closed 4 years ago

QuietMisdreavus commented 4 years ago

To be honest, this has been overdue for a few years. The auth code was (by necessity) the first code i wrote for egg-mode, and a lot of it was cribbed from another library because i didn't know what i was doing. Most of the work here was mostly internal, but the net effect is a breaking change because i finally got the auth module to the point where i could expose it and throw all the authentication things there instead of loosely at the crate root. This is related to #32 but it doesn't really close it because i feel like i won't really rest until i can make the internal request-building stuff fully public.

I feel like a lot of the changes here make the auth code a bit easier to understand, and easier to navigate. The internal API to set up a request feels a lot nicer now, as opposed to a lot of the ad-hoc stuff i wrote in 2016 because i was still learning Rust.

The branch as a whole has a lot of big sweeping changes, but i tried to break the commits up so that each individual change could be understood on its own, in case anyone wants to read through and understand what's going on. Listing every change i did on the internal stuff here would be way too much, so i tried to make the commits logically distinct and give them enough of a description to make them understandable.

adwhit commented 4 years ago

Looks like you're on a roll :slightly_smiling_face:

QuietMisdreavus commented 4 years ago

Definitely! I feel like i'm coming back to egg-mode in a big way, but i'm also making the changes that allow people to make way more with it than just the stuff we already wrap. My hope is that the next time my attention shifts away (i.e. whenever i get a job again or focus on other personal projects) i can leave egg-mode in a place where it's okay that it doesn't see an update for a while.