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

Fix Style/MultilineIfModifier issues #447

Merged
merged 1 commit into from Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Expand Up @@ -134,12 +134,6 @@ Style/ModuleFunction:
- 'lib/jwt/algos.rb'
- 'lib/jwt/signature.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/MultilineIfModifier:
Exclude:
- 'spec/integration/readme_examples_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/MutableConstant:
Expand Down
26 changes: 14 additions & 12 deletions spec/integration/readme_examples_spec.rb
Expand Up @@ -65,18 +65,20 @@
]
end

it 'RSASSA-PSS' do
rsa_private = OpenSSL::PKey::RSA.generate 2048
rsa_public = rsa_private.public_key

token = JWT.encode payload, rsa_private, 'PS256'
decoded_token = JWT.decode token, rsa_public, true, algorithm: 'PS256'

expect(decoded_token).to eq [
{ 'data' => 'test' },
{ 'alg' => 'PS256' }
]
end if ::Gem::Version.new(OpenSSL::VERSION) >= ::Gem::Version.new('2.1')
if ::Gem::Version.new(OpenSSL::VERSION) >= ::Gem::Version.new('2.1')
it 'RSASSA-PSS' do
rsa_private = OpenSSL::PKey::RSA.generate 2048
rsa_public = rsa_private.public_key

token = JWT.encode payload, rsa_private, 'PS256'
decoded_token = JWT.decode token, rsa_public, true, algorithm: 'PS256'

expect(decoded_token).to eq [
{ 'data' => 'test' },
{ 'alg' => 'PS256' }
]
end
end
end

context 'claims' do
Expand Down