Movatterモバイル変換


[0]ホーム

URL:


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

[HttpClient] Add new bearer option#30547

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromdunglas:httpclient-bearer
Mar 14, 2019

Conversation

@dunglas
Copy link
Member

@dunglasdunglas commentedMar 13, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Add a new "auth_bearer" option to set the corresponding flavor of theAuthorization header as defined in RFC 6750 and used in OAuth (and others).

Also rename "auth" to "auth_basic" for consistency as discussed with@nicolas-grekas.

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMar 13, 2019
edited
Loading

I thought about it, but do we really need it, when the alternative is that one?
$client->request(..., ['bearer' => $bearer]);
vs
$client->request(..., ['headers' => ['authorization: Bearer '.$bearer]]);

Yes, it's shorter, but adding the option means added burden when implementing the interface.

@nicolas-grekasnicolas-grekas added this to thenext milestoneMar 13, 2019
@dunglas
Copy link
MemberAuthor

dunglas commentedMar 13, 2019
edited
Loading

Using a Bearer token is very common when requesting an API (more common than Basic). Also, it can be error prone (for instance, your example is wrong because theB ofBearer must be uppercased according to the RFC).

@dunglas
Copy link
MemberAuthor

Regarding the burden, as this trait isn't internal, it should not be a big deal.

@fabpot
Copy link
Member

Thank you@dunglas.

@fabpotfabpot merged commitf79ef21 intosymfony:masterMar 14, 2019
fabpot added a commit that referenced this pull requestMar 14, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes#30547).Discussion----------[HttpClient] Add new bearer option| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes<!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | n/aAdd a new "auth_bearer" option to set the corresponding flavor of the `Authorization` header as defined in RFC 6750 and used in OAuth (and others).Also rename "auth" to "auth_basic" for consistency as discussed with@nicolas-grekas.Commits-------f79ef21 [HttpClient] Add new bearer option
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@weaverryanweaverryanweaverryan approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

7 participants

@dunglas@nicolas-grekas@fabpot@javiereguiluz@weaverryan@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp