Skip to content

Commit

Permalink
Fix Style/MultilineIfModifier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinj authored and excpt committed Oct 3, 2021
1 parent a4270e8 commit 06812af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
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

0 comments on commit 06812af

Please sign in to comment.