{"id":18994545,"url":"https://github.com/timelessnesses/tlns-google-oauth2","last_synced_at":"2026-01-03T06:50:09.806Z","repository":{"id":246660977,"uuid":"821784201","full_name":"timelessnesses/tlns-google-oauth2","owner":"timelessnesses","description":"An enshitificated Google OAuth2 Server Side support for Rust with built in Scopes enum","archived":false,"fork":false,"pushed_at":"2024-07-13T06:02:31.000Z","size":287,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T04:19:02.854Z","etag":null,"topics":["actix","google","login","macro","oauth2","proc","provider","rust","scopes","server","web"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tlns_google_oauth2","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timelessnesses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-29T12:27:22.000Z","updated_at":"2024-07-13T06:02:34.000Z","dependencies_parsed_at":"2024-06-29T13:43:15.508Z","dependency_job_id":"0d7d49bf-ffd8-4f4a-a539-06a74f8818bb","html_url":"https://github.com/timelessnesses/tlns-google-oauth2","commit_stats":null,"previous_names":["timelessnesses/tlns-google-oauth2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelessnesses%2Ftlns-google-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelessnesses%2Ftlns-google-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelessnesses%2Ftlns-google-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelessnesses%2Ftlns-google-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timelessnesses","download_url":"https://codeload.github.com/timelessnesses/tlns-google-oauth2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971155,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actix","google","login","macro","oauth2","proc","provider","rust","scopes","server","web"],"created_at":"2024-11-08T17:25:57.993Z","updated_at":"2026-01-03T06:50:09.801Z","avatar_url":"https://github.com/timelessnesses.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tlns-google-oauth2\n\nA server-side Google OAuth2 authentication with built in scopes for extra type safety.\n\n## Generating scopes enums (for proc macro library part only)\n\nGo to [Google's OAuth2 Scopes Listing](https://developers.google.com/identity/protocols/oauth2/scopes) and start copying from the first header to the final row of the table at the bottom of the document.\n![A picture showing the first blue header](./lmao.png)\n![A picture showing the last row of the table](./help.png)\nThen pasting all of that to the `info.txt` and build the library, it will give you all possible scopes!\n\n## Usage ([`crate::grouped_scopes`])\n\n```rust,should_panic\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    use tlns_google_oauth2::GoogleOAuth2Client as Client;\n    use tlns_google_oauth2::grouped_scopes;\n    use pollster::FutureExt as _;\n\n    let client = Client::new(\"CLIENT_ID\", \"CLIENT_SECRET\", \"http://localhost:8080/callback\")?;\n    let auth = client.build_authorize_url(None, \u0026[\u0026grouped_scopes::GoogleOAuth2APIv2::AuthUserinfoProfile]);\n    let url = auth.redirect_url;\n    let csrf_token = auth.csrf_token;\n    let scopes = auth.scopes;\n\n    // ... Callback codes here (You can't save states in oauth2 crate for some reasons :( )\n\n    let code = \"...\";\n    let token = client.get_token(code, None).block_on()?;\n    // Do request stuff\n    Ok(())\n}\n```\n\n## Usage ([`crate::scopes::Scopes`])\n\n```rust,should_panic\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    use tlns_google_oauth2::GoogleOAuth2Client as Client;\n    use tlns_google_oauth2::scopes;\n    use pollster::FutureExt as _;\n\n    let client = Client::new(\"CLIENT_ID\", \"CLIENT_SECRET\", \"http://localhost:8080/callback\")?;\n    let auth = client.build_authorize_url(None, \u0026[\u0026scopes::Scopes::AuthUserinfoProfile]);\n    let url = auth.redirect_url;\n    let csrf_token = auth.csrf_token;\n    let scopes = auth.scopes;\n\n    // ... Callback codes here (You can't save states in oauth2 crate for some reasons :( )\n\n    let code = \"...\";\n    let token = client.get_token(code, None).block_on()?;\n    Ok(())\n// Do request stuff\n}\n```\n\nYes, you can mix and match the slice with anything that implements [`ToGoogleScope`] trait.\n\n## Credits\n\nThanks [`heapunderfl0w`](https://github.com/heapunderfl0w) for the proc macro idea instead of shitty Jinja2 implementation!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelessnesses%2Ftlns-google-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimelessnesses%2Ftlns-google-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelessnesses%2Ftlns-google-oauth2/lists"}