[PR #207] [CLOSED] [WIP] Auth restructure #313

Closed
opened 2026-02-27 20:24:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/207
Author: @marioortizmanero
Created: 4/29/2021
Status: Closed

Base: separate-cratesHead: auth-rewrite


📝 Commits (10+)

📊 Changes

46 files changed (+3877 additions, -3977 deletions)

View changed files

📝 .github/workflows/ci.yml (+7 -29)
.travis.yml (+0 -25)
📝 Cargo.toml (+27 -36)
examples/auth_code.rs (+55 -0)
examples/auth_code_pkce.rs (+47 -0)
📝 examples/client_creds.rs (+10 -14)
examples/current_user_recently_played.rs (+0 -51)
📝 examples/oauth_tokens.rs (+7 -12)
📝 examples/pagination_async.rs (+6 -36)
📝 examples/pagination_manual.rs (+6 -36)
📝 examples/pagination_sync.rs (+6 -36)
examples/track.rs (+0 -42)
examples/tracks.rs (+0 -42)
📝 examples/ureq/device.rs (+6 -36)
📝 examples/ureq/me.rs (+6 -36)
📝 examples/ureq/search.rs (+17 -47)
📝 examples/ureq/seek_track.rs (+6 -36)
📝 examples/webapp/src/main.rs (+71 -78)
📝 examples/with_refresh_token.rs (+11 -26)
rspotify-http/Cargo.toml (+54 -0)

...and 26 more files

📄 Description

TODO:

  • Implement everything listed in #173 for the new interface. This also allows us to remove derive_builder completely from the library.
  • Split the http module into a different crate
  • Implement PKCE authentication (maybe for another PR?)
  • Export some parts of the library as top-level imports (requested in #127, but we might want to add more?)
  • Declare a common Config struct with things like token_cached or token_refreshing for #135. The former is implemented here, but the latter is left as a TODO.
  • Fix the examples
  • Rename tests like album.rs into client_credentials.rs, teaching about the authentication process instead.
  • Fix the tests
  • Make sure the endpoints are distributed properly into the different clients, and same for the tests.
  • Tidy up and self-review
  • Try to keep as few things from the Rspotify clients as possible in rspotify-http
  • Update changelog
  • Update documentation
  • Make sure the feature collision feature still works

Note that this only really separates the rspotify-http crate, as I don't think moving the auth logic to a separate crate is really worth it. We can discuss it but I'm not sure it's necessary at all.


Closes #207
Closes #208


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/207 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 4/29/2021 **Status:** ❌ Closed **Base:** `separate-crates` ← **Head:** `auth-rewrite` --- ### 📝 Commits (10+) - [`05f906b`](https://github.com/ramsayleung/rspotify/commit/05f906bc1092b8105047ce7ecbbf7062dfdc18d7) moving http to a new crate - [`68d625f`](https://github.com/ramsayleung/rspotify/commit/68d625f584069f34f8016324adf4c036a0a556f9) rspotify-http now working more or less - [`bbbb3af`](https://github.com/ramsayleung/rspotify/commit/bbbb3af82ce1cc7a0c79f7c15d4decd978f287e1) moving endpoints to respective traits - [`1a4487b`](https://github.com/ramsayleung/rspotify/commit/1a4487b121922f7014e7d11e8f117c3f6aaa1422) hit a wall with `impl` - [`61edf5d`](https://github.com/ramsayleung/rspotify/commit/61edf5dbb6acfdf42b01dd7b8369a0311a051d4b) it compiles... but at what cost - [`82f1825`](https://github.com/ramsayleung/rspotify/commit/82f1825ed87c3c88bac0d164aac552c2ad1616ae) format - [`b47f273`](https://github.com/ramsayleung/rspotify/commit/b47f27379025867084c49d1cf3286c4bdd8e8430) numerous fixes - [`1107624`](https://github.com/ramsayleung/rspotify/commit/1107624f380de0a8ef573f701e6b4aa44224ac15) some fixes - [`3a0bb68`](https://github.com/ramsayleung/rspotify/commit/3a0bb68db68477278a751516292e577692c14fd9) Merge with master - [`02c4c0c`](https://github.com/ramsayleung/rspotify/commit/02c4c0ce571da5184ad00333d632086289f46f0b) format ### 📊 Changes **46 files changed** (+3877 additions, -3977 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+7 -29) ➖ `.travis.yml` (+0 -25) 📝 `Cargo.toml` (+27 -36) ➕ `examples/auth_code.rs` (+55 -0) ➕ `examples/auth_code_pkce.rs` (+47 -0) 📝 `examples/client_creds.rs` (+10 -14) ➖ `examples/current_user_recently_played.rs` (+0 -51) 📝 `examples/oauth_tokens.rs` (+7 -12) 📝 `examples/pagination_async.rs` (+6 -36) 📝 `examples/pagination_manual.rs` (+6 -36) 📝 `examples/pagination_sync.rs` (+6 -36) ➖ `examples/track.rs` (+0 -42) ➖ `examples/tracks.rs` (+0 -42) 📝 `examples/ureq/device.rs` (+6 -36) 📝 `examples/ureq/me.rs` (+6 -36) 📝 `examples/ureq/search.rs` (+17 -47) 📝 `examples/ureq/seek_track.rs` (+6 -36) 📝 `examples/webapp/src/main.rs` (+71 -78) 📝 `examples/with_refresh_token.rs` (+11 -26) ➕ `rspotify-http/Cargo.toml` (+54 -0) _...and 26 more files_ </details> ### 📄 Description TODO: - [x] Implement everything listed in #173 for the new interface. This also allows us to remove `derive_builder` completely from the library. - [x] Split the http module into a different crate - [ ] Implement PKCE authentication (maybe for another PR?) - [x] Export some parts of the library as top-level imports (requested in #127, but we might want to add more?) - [x] Declare a common `Config` struct with things like `token_cached` or `token_refreshing` for #135. The former is implemented here, but the latter is left as a TODO. - [x] Fix the examples - [x] Rename tests like `album.rs` into `client_credentials.rs`, teaching about the authentication process instead. - [x] Fix the tests - [x] Make sure the endpoints are distributed properly into the different clients, and same for the tests. - [ ] Tidy up and self-review - [ ] Try to keep as few things from the Rspotify clients as possible in `rspotify-http` - [ ] Update changelog - [x] Update documentation - [x] Make sure the feature collision feature still works Note that this only really separates the `rspotify-http` crate, as I don't think moving the auth logic to a separate crate is really worth it. We can discuss it but I'm not sure it's necessary at all. --- Closes #207 Closes #208 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#313
No description provided.