Skip to content
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

Adding client id to strong parameters #1296

Merged

Conversation

linhdangduy
Copy link
Contributor

@linhdangduy linhdangduy commented Aug 11, 2019

Summary

Adding client_id parameter to permitted strong parameters.

As the needs of #1287 , in development environment, setting:

config.action_controller.action_on_unpermitted_parameters = :raise

to raise error if unpermitted parameters are sent to controller.
But currently, at authorizations_controller, the required client_id parameter is used at server.client_via_uid, not included in strong parameter list. So we cannot use above setting.

Solving by:

  • passingclient_id to permitted parameters. Then get client at pre_authorization, not by using server.client_via_uid.

Comment:

@linhdangduy linhdangduy force-pushed the add_client_id_to_strong_parameters branch 2 times, most recently from 36278e3 to 623fadc Compare August 11, 2019 05:37
@linhdangduy linhdangduy changed the title Adding client id to strong parameters and limiting access to attributes of pre_authorization Adding client id to strong parameters Aug 11, 2019
@linhdangduy linhdangduy force-pushed the add_client_id_to_strong_parameters branch from 623fadc to 292a954 Compare August 11, 2019 05:44
@linhdangduy linhdangduy force-pushed the add_client_id_to_strong_parameters branch from 292a954 to a3458b0 Compare August 11, 2019 23:12
@linhdangduy
Copy link
Contributor Author

Done squash commits to a single 1️⃣commit.

@nbulaj
Copy link
Member

nbulaj commented Aug 12, 2019

Hi @linhdangduy . Thanks for the contribution <3

@nbulaj nbulaj merged commit 98a4036 into doorkeeper-gem:master Aug 12, 2019
@linhdangduy linhdangduy deleted the add_client_id_to_strong_parameters branch August 13, 2019 11:32
edwardkerry added a commit to alphagov/signon that referenced this pull request Feb 25, 2020
As of doorkeeper-gem/doorkeeper#1296 Doorkeeper's
PreAuthorization controller is no longer passed the Client upon instantiation,
but instead retrieves it during validation.

To ensure that the we can access the application via the client, we explicitly
call pre_auth.authorizable in order to invoke `validate_client`
https://github.com/linhdangduy/doorkeeper/blob/a3458b00d89fb79e0f0a4efc733124c3bfe56db6/lib/doorkeeper/oauth/pre_authorization.rb#L71
edwardkerry added a commit to alphagov/signon that referenced this pull request Feb 28, 2020
As of doorkeeper-gem/doorkeeper#1296 Doorkeeper's
PreAuthorization controller is no longer passed the Client upon instantiation,
but instead retrieves it during validation.

To ensure that the we can access the application via the client, we explicitly
call pre_auth.authorizable in order to invoke `validate_client`
https://github.com/linhdangduy/doorkeeper/blob/a3458b00d89fb79e0f0a4efc733124c3bfe56db6/lib/doorkeeper/oauth/pre_authorization.rb#L71
edwardkerry added a commit to alphagov/signon that referenced this pull request Feb 28, 2020
As of doorkeeper-gem/doorkeeper#1296 Doorkeeper's
PreAuthorization controller is no longer passed the Client upon instantiation,
but instead retrieves it during validation.

To ensure that the we can access the application via the client, we explicitly
call pre_auth.authorizable in order to invoke `validate_client`
https://github.com/linhdangduy/doorkeeper/blob/a3458b00d89fb79e0f0a4efc733124c3bfe56db6/lib/doorkeeper/oauth/pre_authorization.rb#L71
edwardkerry added a commit to alphagov/signon that referenced this pull request Mar 2, 2020
As of doorkeeper-gem/doorkeeper#1296 Doorkeeper's
PreAuthorization controller is no longer passed the Client upon instantiation,
but instead retrieves it during validation.

To ensure that the we can access the application via the client, we explicitly
call pre_auth.authorizable in order to invoke `validate_client`
https://github.com/linhdangduy/doorkeeper/blob/a3458b00d89fb79e0f0a4efc733124c3bfe56db6/lib/doorkeeper/oauth/pre_authorization.rb#L71
edwardkerry added a commit to alphagov/signon that referenced this pull request Mar 2, 2020
As of doorkeeper-gem/doorkeeper#1296 Doorkeeper's
PreAuthorization controller is no longer passed the Client upon instantiation,
but instead retrieves it during validation.

To ensure that the we can access the application via the client, we explicitly
call pre_auth.authorizable in order to invoke `validate_client`
https://github.com/linhdangduy/doorkeeper/blob/a3458b00d89fb79e0f0a4efc733124c3bfe56db6/lib/doorkeeper/oauth/pre_authorization.rb#L71
giraffate added a commit to giraffate/doorkeeper that referenced this pull request Apr 2, 2020
In doorkeeper-gem#1296, `Doorkeeper::Server#client_via_uid` was removed. However,
this method looks public. If this method is used, `NoMethodError`
happens when upgrading.
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.

None yet

2 participants