Skip to content

Conversation

mrj
Copy link
Contributor

@mrj mrj commented Sep 8, 2025

The Instagram API uses :query token mode for GET requests and :header mode for POST and DELETE requests, not only for endpoint calls but for getting and refreshing long-lived tokens. So instead of a fixed mode, an AccessToken needs its mode to to be request-verb-dependent. This PR implement this.

Two things I haven't done:

  1. Allow the mode to also be dependent on the path and even other options, and
  2. Test an invalid mode. I couldn't work out how to stop RSpec using
block_is_expected.to raise_error("invalid :mode option of #{mode}")

from earlier in the spec file. Not that important given that the normal mode-switching works.

@coveralls
Copy link

coveralls commented Sep 8, 2025

Pull Request Test Coverage Report for Build 17541833529

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 17540447593: 0.0%
Covered Lines: 520
Relevant Lines: 520

💛 - Coveralls

@pboling
Copy link
Member

pboling commented Sep 8, 2025

@mrj Thanks for this. Reviewing it now, but just noticing that the three failures are probably due to RuboCop style.

First try:

bin/rake rubocop_gradual:autocorrect

If it fails you can either fix them, or punt them into the future, and run:

bin/rake rubocop_gradual:force_update

@pboling
Copy link
Member

pboling commented Sep 8, 2025

@mrj Also, we are working on things at the same time, so please rebase on latest main!

Copy link
Member

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just needs rebase and style linting.

@pboling
Copy link
Member

pboling commented Sep 8, 2025

I'll fix the style in post ;) Merging

@pboling pboling merged commit 69210d5 into ruby-oauth:main Sep 8, 2025
33 of 36 checks passed
@pboling pboling mentioned this pull request Sep 8, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants