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

Add configuration option "use_application_secret" #3

Merged

Conversation

uxtronaut
Copy link
Contributor

This should allow the configuration setting use_application_secret which will then use the grant token's application secret when generating the JWT. I believe this was mentioned in Issue #2

encryption_method :rs512
end

token = Doorkeeper::JWT.generate({application: {secret: secret_key}})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant curly braces around a hash parameter.
Space inside { missing.
Space inside } missing.

@heavysixer
Copy link

+1

@@ -18,7 +18,11 @@ def self.token_payload(opts = {})
Doorkeeper::JWT.configuration.token_payload.call opts
end

def self.secret_key
def self.secret_key(opts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

private (on line 15) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chriswarren I'm not sure if you want me to change this one or not... I noticed that hound was complaining about single-quotes which are being used often in other files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't worry about it.

expect(subject.use_application_secret).to be false
end

it 'changes the value of secret_key to the applicatin\'s secret' do
Copy link
Collaborator

Choose a reason for hiding this comment

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

application - missing the O

@chriswarren
Copy link
Collaborator

Looks good. Can you fix the typo in the test description and then I'll get it merged in?

Thanks for adding this.

@uxtronaut
Copy link
Contributor Author

Thanks @chriswarren

@heavysixer
Copy link

@chriswarren would love to see this merged. I have immediate use for this fix.

Thanks!

@chriswarren chriswarren merged commit ff5e4cd into doorkeeper-gem:master Feb 17, 2016
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

4 participants