[PR #356] [MERGED] Add custom auth URLs and simplify get/etc methods #410

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/356
Author: @marioortizmanero
Created: 7/30/2022
Status: Merged
Merged: 1/4/2023
Merged by: @ramsayleung

Base: masterHead: config-base


📝 Commits (4)

  • 8ce9791 Prefix URLs
  • 9434b88 Switch to String
  • e6b141e Simplify request methods in base client
  • 4cabf6a Rename endpoint to api for consistency

📊 Changes

8 files changed (+196 additions, -194 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 doc/uml/trait_hierarchy.plantuml (+3 -2)
📝 src/auth_code.rs (+2 -1)
📝 src/auth_code_pkce.rs (+2 -1)
📝 src/clients/base.rs (+81 -121)
📝 src/clients/mod.rs (+47 -8)
📝 src/clients/oauth.rs (+49 -55)
📝 src/lib.rs (+11 -6)

📄 Description

Description

This adds a configurable prefix URL for authentication.

I've also simplified the request methods in the base client. We don't really need get if it's only used in endpoint_get. We can also extend post_form to auth_post, which also prepends the auth URL for convenience, just like endpoint_get. Finally, I've renamed endpoint_get and similars to api_get for consistency and because it's clearer and much shorter.

Motivation and Context

See #350

Dependencies

None

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

I've modified the endpoint_url test, and added another one for auth_url.

Is this change properly documented?

TODO


🔄 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/356 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 7/30/2022 **Status:** ✅ Merged **Merged:** 1/4/2023 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `config-base` --- ### 📝 Commits (4) - [`8ce9791`](https://github.com/ramsayleung/rspotify/commit/8ce9791b4cc92c8cfe05cca58068cbcebbf56e07) Prefix URLs - [`9434b88`](https://github.com/ramsayleung/rspotify/commit/9434b88367d3f5cbca7ba170e0ae6203a14b6622) Switch to `String` - [`e6b141e`](https://github.com/ramsayleung/rspotify/commit/e6b141e3662ff03a8287e85dad7e756dea5799bd) Simplify request methods in base client - [`4cabf6a`](https://github.com/ramsayleung/rspotify/commit/4cabf6a0e8099a6c56fd1919b1fcb6e7c4b5e465) Rename `endpoint` to `api` for consistency ### 📊 Changes **8 files changed** (+196 additions, -194 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `doc/uml/trait_hierarchy.plantuml` (+3 -2) 📝 `src/auth_code.rs` (+2 -1) 📝 `src/auth_code_pkce.rs` (+2 -1) 📝 `src/clients/base.rs` (+81 -121) 📝 `src/clients/mod.rs` (+47 -8) 📝 `src/clients/oauth.rs` (+49 -55) 📝 `src/lib.rs` (+11 -6) </details> ### 📄 Description ## Description This adds a configurable prefix URL for authentication. I've also simplified the request methods in the base client. We don't really need `get` if it's only used in `endpoint_get`. We can also extend `post_form` to `auth_post`, which also prepends the auth URL for convenience, just like `endpoint_get`. Finally, I've renamed `endpoint_get` and similars to `api_get` for consistency and because it's clearer and much shorter. ## Motivation and Context See #350 ## Dependencies None ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## How has this been tested? I've modified the `endpoint_url` test, and added another one for `auth_url`. ## Is this change properly documented? TODO --- <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:38 +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#410
No description provided.