Finally, Released oauth crate for google and github in rust

Hello My Lovly Developers,
finally created proper google and github oauth crate for rust
this is because there is no proper oauth for managing authentication in rust so created this
check it and tell your opinion and how can be improved better to be great developer experience :green_heart:

https://crates.io/crates/rusty_oauth

Docs. Please. The only example is the one in the README and it doesn’t actually explain anything. I guess it shows the correct order of functions to call on the Oauth builder (because the way you’ve built it, the calls must be in exactly this order).

I know writing docs is hard, it’s annoying for me too but it must be done. Just one sentence per item would be so much better.

You have lots of public modules at the root with no exposed items (build, id, login, provider, redirect, response, scope, secret, stream). The impls within them

  • don’t need to be in their own modules
  • and the module doesn’t need to be public for the impls to be visible

Consider utilizing pub use to export an API that isn’t the same shape as your files (like flattening everything in rusty_ouath::github::{authorization, client, decode, github} into the crate::github path). Leaving the API exactly as the files are on disk leads to ridiculous paths like rusty_oauth::google::google::google().

Your package.homepage in Cargo.toml is just set to your crates.io page. The Cargo book says:

A value should only be set for homepage if there is a dedicated website for the crate other than the source repository or API documentation.

Good examples of package.homepage are serde’s and tokio’s (serde.rs and tokio.rs). You probably don’t need a homepage, just don’t set the value in Cargo.toml.

The flow.png file is a nice diagram of OAuth, but it doesn’t seem to be linked to anywhere in the crate. (Disclaimer: I don’t actually know anything about OAuth so I don’t actually know whether it’s correct).

In CONTRIBUTING.md, the instruction to “clone your [the contributor’s] forked repository” says to git clone https://github.com/HashiramaSenjuhari/rusty_oauth. Other developers are not HashiramaSenjuhari.

The table of contents in the README has dangling links to the Usage, Examples, Contributing, and License sections.

3 Likes