-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate 'X-SPREE-TOKEN' header 2 #3029
Deprecate 'X-SPREE-TOKEN' header 2 #3029
Conversation
c94fb91
to
33b020b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for completing this PR, @twist900 ! 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a code formatting comment, but overall it's a great work.
I'm also not sure if it's better to squash commits since git looking at the last commit alone outside this PR could look like we are adding the spree_token
into an already existing bearer_token
instead of the opposite. What do you think?
end | ||
helper_method :api_key | ||
|
||
def bearer_token | ||
pattern = /^Bearer / | ||
header = request.headers["Authorization"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove one space after header
, it's aligned to pattern
on the line above but if that line changes in the future we'll be forced to change this one as well and this is not ideal for git history. What do you think?
33b020b
to
41a30ee
Compare
Move from custom X-Spree-Token header to Authorization header. Keep support of the deprecated X-Spree-Token header for backward compatibility.
41a30ee
to
88068cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰 Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes, thanks!
Description
This PR is a continuation of #2996. It keeps the X-SPREE-TOKEN alongside the newly introduced bearer authorization token for backward compatibility. A deprecation message is displayed when the X-SPREE-TOKEN header is detected.
Also, it fixes some linting issue.
ref #2934
Checklist: