Skip to content

Add QueryParam auth plugin support #267

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
merged 1 commit into from
Jul 5, 2018
Merged

Add QueryParam auth plugin support #267

merged 1 commit into from
Jul 5, 2018

Conversation

soullivaneuh
Copy link
Contributor

@soullivaneuh soullivaneuh commented Jun 27, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #265
Documentation php-http/documentation#238
License MIT

What's in this PR?

Add missing support for the QueryParam auth plugin.

Why?

Because there is no reason to not have it. :-D

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Great. Thank you

@soullivaneuh
Copy link
Contributor Author

@Nyholm I have an issue with the always empty params array.

I'm investigating, but if you have a clue to give... ;-)

@Nyholm
Copy link
Member

Nyholm commented Jun 27, 2018

I have an issue with the always empty params array.

Which line?

@soullivaneuh
Copy link
Contributor Author

@Nyholm https://github.com/php-http/HttplugBundle/pull/267/files#diff-850942b3ba24ab03a40aaa81b6152852R544

In a nutshell, params is always present as an empty array event if not filled. But validateAuthenticationType does not except params unless for query_params.

But I'm not sure we can remove it from the config if the array is empty. 🤔

@Nyholm
Copy link
Member

Nyholm commented Jun 27, 2018

Be more pragmatic =)

Write a special case for query_params in validateAuthenticationType.

@soullivaneuh
Copy link
Contributor Author

@Nyholm The issue is params is always present as an empty array: https://github.com/php-http/HttplugBundle/pull/267/files#diff-850942b3ba24ab03a40aaa81b6152852R544

So yes, I can just unset params if the value is empty on validateAuthenticationType, but I consider that quite ugly and params will always be present on the final configuration.

Or maybe the idea you have is different?

@soullivaneuh
Copy link
Contributor Author

@Nyholm I did an unset on the validation. Does it seem ok to you?

The other fails are note related AFAIK.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

I think it is okey. I let other maintainers give their opinion as well.

I think that error is unrelated. I check later.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks for this pull request.the risk with query parameters for credentials is that they show up in all kind of access logs from the server, proxies and the browser history. its not much of an injection risk like other things with query parameters (if i can trick you to login with somebody's account, that is not an issue - the injection problem is when i can trick you to click a link that executes some operation with your own login).

can you please provide a pull request for php-http/documentation to document this feature as well? maybe add the warning about passwords showing up in access logs and the browser history?

@Nyholm did a bunch of cleanup on master, but afaik there is still something failing for some versions. could you rebase on master nonetheless?

@soullivaneuh
Copy link
Contributor Author

the risk with query parameters for credentials is that they show up in all kind of access logs from the server

I totally agree! But the targeted API maintainer does not seems to be agree. BTW, the maintainer is Google, f*ck yeah! :trollface:

They is a risk, but I don't think we should log the emitted request on production.

I'll take a look for the documentation and the rebase.

@soullivaneuh
Copy link
Contributor Author

Please see php-http/documentation#238.

@soullivaneuh
Copy link
Contributor Author

Is anything missing to get this merged and released?

@Nyholm
Copy link
Member

Nyholm commented Jul 5, 2018

Thank you for the ping.
You are all good. Thank you for the work!

@Nyholm Nyholm merged commit ec01a67 into php-http:master Jul 5, 2018
@soullivaneuh soullivaneuh deleted the query-param-auth branch July 5, 2018 15:25
@soullivaneuh
Copy link
Contributor Author

Thank you for the merge @Nyholm !

May we have a new release? :-)

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.

QueryParams auth not supported
3 participants