Skip to content

Make parameters filter more strict #811

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
Apr 4, 2016

Conversation

Tensho
Copy link
Contributor

@Tensho Tensho commented Apr 1, 2016

@@ -1,7 +1,7 @@
module Doorkeeper
class Engine < Rails::Engine
initializer "doorkeeper.params.filter" do |app|
app.config.filter_parameters += [:client_secret, :code, :token]
app.config.filter_parameters << /^(client_secret|code|authentication_token|access_token|refresh_token)$/

Choose a reason for hiding this comment

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

Line is too long. [110/80]

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested rewrite:

parameters = %w(client_secret code authentication_token access_token refresh_token)
app.config.filter_parameters << /^(#{Regexp.union parameters})$/

@tute
Copy link
Contributor

tute commented Apr 2, 2016

Thank you, @Tensho! Can you please:

Then I'll merge this in. Thank you very much! :)

@Tensho Tensho force-pushed the strict-match-filter-parameters branch from b19e517 to 29b1693 Compare April 4, 2016 06:47
@@ -1,7 +1,8 @@
module Doorkeeper
class Engine < Rails::Engine
initializer "doorkeeper.params.filter" do |app|
app.config.filter_parameters += [:client_secret, :code, :token]
parameters = %w(client_secret code authentication_token access_token refresh_token)

Choose a reason for hiding this comment

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

Line is too long. [89/80]

@tute tute merged commit 38419b0 into doorkeeper-gem:master Apr 4, 2016
@tute
Copy link
Contributor

tute commented Apr 4, 2016

Thank you!

@Tensho Tensho deleted the strict-match-filter-parameters branch April 5, 2016 08:09
rhryniow pushed a commit to Ipsos-Tivian/tivian-cxi-doorkeeper that referenced this pull request Mar 12, 2025
…-parameters

Make parameters filter more strict
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.

3 participants