Migrate off httr to tinyoauth (curl + serverSocket)#6
Merged
Conversation
- authenticate.R: client-credentials + user flow via tinyoauth, with oauth_import_httr() carrying over an existing .httr-oauth (no re-login) - tracks.R: endpoints use tinyoauth::oauth_request (no httr RETRY/content) - DESCRIPTION: Imports tinyoauth + Remotes; Depends R (>= 4.0); httr/jsonlite kept until the remaining endpoint files are migrated - Verified live: get_spotify_access_token() + get_track()
- All endpoint files use tinyoauth::oauth_request (Bearer header, retry, JSON parse); removed httr RETRY/GET/content/config/stop_for_status everywhere - authenticate.R on tinyoauth with oauth_import_httr() .httr-oauth carry-over - DESCRIPTION: Imports trimmed to tinyoauth only (dropped httr + jsonlite), Remotes: cornball-ai/tinyoauth; package doc imports dropped - Fixed two pre-existing latent bugs surfaced by live testing: get_artist() 'id=' typo and get_album() stray undefined playlist_id line - Verified live across ~15 endpoints (catalog, user, search, browse, paginated)
* Fix get_shows_episodes() sending market twice market was baked into the URL (?market=) and ALSO passed via query=, so tinyoauth::oauth_request()'s paste0(url, '?', qs) produced '.../episodes?market=US?market=US'. Spotify parsed the market as 'US?market=US' and returned HTTP 400 'Invalid market parameter'. Build the path only and let oauth_request add the query, matching the other shows.R functions. * Bump version to 0.2.3.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces tinyspotifyr's
httrbackend with tinyoauth.What changed
authenticate.R):get_spotify_access_token()(client-credentials) andget_spotify_authorization_code()(user flow, cache + refresh) now run on tinyoauth. An existing httr.httr-oauthis carried over viatinyoauth::oauth_import_httr()— no re-login, so MixtapeR/lc40 keep working.httr::RETRY/GET/content/config/stop_for_statusreplaced bytinyoauth::oauth_request()(Bearer header, retry, JSON parse).httr, jsonlitetotinyoauthalone (curl + jsonlite live under tinyoauth).httr's ~9 recursive deps gone.get_artist()(id=typo) andget_album()(stray undefinedplaylist_idline). Both errored only at call time, so were never caught.Verification
R CMD check: 0 errors, 0 notes (1 WARNING = the maintainer-change carried from 0.2.3).tinyoauth isn't on CRAN yet, so this is on a branch with
Remotes: cornball-ai/tinyoauth. Do not CRAN-submit until tinyoauth is published. Installs fine from GitHub now. CI may be red until tinyoauth is on CRAN (r-ci won't resolve the Remotes dep).