Skip to content

Commit 09bad6c

Browse files
authored
Linter fixes and changelog (#28)
* Linter fixes and changelog * Extend metadata * fix gemspec * Reference this pr
1 parent 4d1b11b commit 09bad6c

36 files changed

+121
-63
lines changed

.rubocop_todo.yml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-02-15 17:10:47 UTC using RuboCop version 1.72.1.
3+
# on 2025-02-16 07:54:09 UTC using RuboCop version 1.72.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# This cop supports safe autocorrection (--autocorrect).
11-
Lint/AmbiguousOperatorPrecedence:
12-
Exclude:
13-
- 'spec/jwe/alg_spec.rb'
14-
159
# Offense count: 6
1610
Lint/DuplicateMethods:
1711
Exclude:
@@ -45,13 +39,6 @@ Style/ExpandPathArguments:
4539
Exclude:
4640
- 'jwe.gemspec'
4741

48-
# Offense count: 34
49-
# This cop supports unsafe autocorrection (--autocorrect-all).
50-
# Configuration parameters: EnforcedStyle.
51-
# SupportedStyles: always, always_true, never
52-
Style/FrozenStringLiteralComment:
53-
Enabled: false
54-
5542
# Offense count: 2
5643
# This cop supports safe autocorrection (--autocorrect).
5744
Style/IfUnlessModifier:
@@ -64,19 +51,3 @@ Style/IfUnlessModifier:
6451
Style/PerlBackrefs:
6552
Exclude:
6653
- 'lib/jwe.rb'
67-
68-
# Offense count: 8
69-
# This cop supports unsafe autocorrection (--autocorrect-all).
70-
# Configuration parameters: Mode.
71-
Style/StringConcatenation:
72-
Exclude:
73-
- 'spec/jwe/alg_spec.rb'
74-
- 'spec/jwe_spec.rb'
75-
76-
# Offense count: 1
77-
# This cop supports safe autocorrection (--autocorrect).
78-
# Configuration parameters: WordRegex.
79-
# SupportedStyles: percent, brackets
80-
Style/WordArray:
81-
EnforcedStyle: percent
82-
MinSize: 7

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
## [v1.0.0](https://github.com/jwt/ruby-jwe/tree/v1.0.0) (NEXT)
4+
5+
[Full Changelog](https://github.com/jwt/ruby-jwe/compare/v0.4.0...master)
6+
7+
**Features:**
8+
9+
- Support Ruby 3.4 (#26)(https://github.com/jwt/ruby-jwe/pull/26)
10+
- Drop support for Ruby versions prior to 2.5 (#27)(https://github.com/jwt/ruby-jwe/pull/27)
11+
12+
**Fixes and enhancements:**
13+
14+
- Refreshed codebase (CI and linter fixes) (#27)(https://github.com/jwt/ruby-jwe/pull/27), (#28)(https://github.com/jwt/ruby-jwe/pull/28)

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gemspec

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# JWE
22

33
[![Build Status](https://github.com/jwt/ruby-jwe/workflows/test/badge.svg?branch=master)](https://github.com/jwt/ruby-jwe/actions)
4+
[![Gem Version](https://badge.fury.io/rb/jwe.svg)](https://badge.fury.io/rb/jwe)
5+
46
A ruby implementation of the [RFC 7516 JSON Web Encryption (JWE)](https://tools.ietf.org/html/rfc7516) standard.
57

68
## Installing

Rakefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
begin
2-
require 'rspec/core/rake_task'
3-
RSpec::Core::RakeTask.new(:spec)
4-
task default: :spec
5-
rescue LoadError
6-
puts 'Where is RSpec?'
7-
end
1+
# frozen_string_literal: true
2+
3+
require 'bundler/setup'
4+
5+
require 'bundler/gem_tasks'
6+
require 'rspec/core/rake_task'
7+
8+
RSpec::Core::RakeTask.new(:spec)
9+
task default: :spec

jwe.gemspec

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
lib = File.expand_path('../lib/', __FILE__)
24
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
35
require 'jwe/version'
@@ -9,14 +11,19 @@ Gem::Specification.new do |s|
911
s.description = 'A Ruby implementation of the RFC 7516 JSON Web Encryption (JWE) standard'
1012
s.authors = ['Francesco Boffa']
1113
s.email = '[email protected]'
12-
s.homepage = 'http://github.com/aomega08/jwe'
14+
s.homepage = 'https://github.com/jwt/ruby-jwe'
1315
s.license = 'MIT'
1416

1517
s.files = `git ls-files`.split("\n")
1618
s.require_paths = %w[lib]
1719

1820
s.required_ruby_version = '>= 2.5.0'
19-
s.metadata['rubygems_mfa_required'] = 'true'
21+
22+
s.metadata = {
23+
'bug_tracker_uri' => 'https://github.com/jwt/ruby-jwe/issues',
24+
'changelog_uri' => "https://github.com/jwt/ruby-jwe/blob/v#{JWE::VERSION}/CHANGELOG.md",
25+
'rubygems_mfa_required' => 'true'
26+
}
2027

2128
s.add_dependency 'base64'
2229
end

lib/jwe.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'base64'
24
require 'json'
35
require 'openssl'
@@ -17,7 +19,7 @@ class BadCEK < RuntimeError; end
1719
class InvalidData < RuntimeError; end
1820

1921
VALID_ALG = ['RSA1_5', 'RSA-OAEP', 'RSA-OAEP-256', 'A128KW', 'A192KW', 'A256KW', 'dir', 'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW', 'A128GCMKW', 'A192GCMKW', 'A256GCMKW', 'PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW'].freeze
20-
VALID_ENC = ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512', 'A128GCM', 'A192GCM', 'A256GCM'].freeze
22+
VALID_ENC = %w[A128CBC-HS256 A192CBC-HS384 A256CBC-HS512 A128GCM A192GCM A256GCM].freeze
2123
VALID_ZIP = ['DEF'].freeze
2224

2325
class << self

lib/jwe/alg.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'jwe/alg/a128_kw'
24
require 'jwe/alg/a192_kw'
35
require 'jwe/alg/a256_kw'

lib/jwe/alg/a128_kw.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'jwe/alg/aes_kw'
24

35
module JWE

lib/jwe/alg/a192_kw.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'jwe/alg/aes_kw'
24

35
module JWE

0 commit comments

Comments
 (0)