Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add verb-dependent token mode #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pboling merged 2 commits into ruby-oauth:main from mrj:request-dependent-modes
Sep 8, 2025
Merged

Conversation

mrj
Copy link
Contributor

@mrj mrj commented Sep 8, 2025
edited
Loading

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.

pboling reacted with heart emoji
Copy link

coveralls commented Sep 8, 2025
edited
Loading

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

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

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.

Copy link
Member

pboling commented Sep 8, 2025

I'll fix the style in post ;) Merging

mrj reacted with heart emoji

@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
Reviewers

@pboling pboling pboling approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /