Skip to content

Commit 0e286c1

Browse files
authored
Prepare for 0.2.0 (#217)
- **Use correct hash style in test** - **Disregard AbcSize for Local::decrypt** - **Include tapioca in the rbnacl appraisal** - **Update RBI files** - **README lint pass, remove extra closing parens** - **Update development dependencies** - **Update appraisal to 2.5.0** - **Update OpenSSL to ~> 3.3** - **Generate RBIs again** - **Remove defunct shims** - **Add shim for multi_json ParseError** - **Update changelog**
1 parent 0aa5037 commit 0e286c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+757
-79399
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ commands:
3434
appraisal: << parameters.appraisal >>
3535
- restore_cache:
3636
keys:
37-
- gem-cache-v15-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}
37+
- gem-cache-v16-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}
3838
- run:
3939
name: "Configure Bundler"
4040
command : |
@@ -91,7 +91,7 @@ jobs:
9191
- checkout
9292
- restore_cache:
9393
keys:
94-
- &gem-cache gem-cache-v15-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}
94+
- &gem-cache gem-cache-v16-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}
9595
- install-bundler:
9696
appraisal: rbnacl
9797
- run:

.rubocop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
require:
2-
- rubocop-performance
3-
- rubocop-rspec
1+
plugins:
42
- rubocop-sorbet
3+
- rubocop-rspec
4+
- rubocop-performance
55

66
AllCops:
77
TargetRubyVersion: 3.1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Remove support for ruby/openssl 3.0.x
66
- Refactor how version protocols are implemented to greatly improve sorbet coverage
77
- `Paseto.rbnacl?` is replaced by `Paseto::HAS_RBNACL`
8+
- Fix decoding of multibyte characters in payloads, #216 thanks to @pelted @levicole
89

910
## [0.1.2]
1011

Gemfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ source 'https://rubygems.org'
55
gemspec
66

77
group :development do
8-
# https://github.com/thoughtbot/appraisal/pull/205
9-
# Move back into the gemspec after Thoughtbot releases a fixed version
10-
gem 'appraisal', '~> 2', github: 'thoughtbot/appraisal', ref: 'b200e636903700098bef25f4f51dbc4c46e4c04c'
8+
gem 'appraisal', '~> 2.5'
119

1210
gem 'bundler', '~> 2'
1311
gem 'debug', '>= 1.0'
1412
gem 'parlour'
15-
gem 'tapioca', '~> 0.12.0'
13+
gem 'tapioca', '~> 0.16.11'
1614
end
1715

1816
gem 'oj'
@@ -21,10 +19,10 @@ gem 'rake', '~> 13'
2119
gem 'reek'
2220
gem 'rspec', '~> 3'
2321
gem 'rspec_junit_formatter'
24-
gem 'rubocop', '~> 1.59'
25-
gem 'rubocop-performance', '~> 1.20'
26-
gem 'rubocop-rspec', '~> 2.29'
27-
gem 'rubocop-sorbet', '~> 0.8'
22+
gem 'rubocop', '~> 1.75', require: false
23+
gem 'rubocop-performance', '~> 1.25', require: false
24+
gem 'rubocop-rspec', '~> 3.5', require: false
25+
gem 'rubocop-sorbet', '~> 0.10', require: false
2826
gem 'simplecov', '~> 0'
2927
gem 'simplecov_json_formatter'
3028
gem 'sorbet', '~> 0'

Gemfile.lock

Lines changed: 60 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
GIT
2-
remote: https://github.com/thoughtbot/appraisal.git
3-
revision: b200e636903700098bef25f4f51dbc4c46e4c04c
4-
ref: b200e636903700098bef25f4f51dbc4c46e4c04c
5-
specs:
6-
appraisal (2.4.1)
7-
bundler
8-
rake
9-
thor (>= 0.14.0)
10-
111
PATH
122
remote: .
133
specs:
144
ruby-paseto (0.1.2)
155
multi_json (~> 1.15.0)
16-
openssl (~> 3.1)
6+
openssl (~> 3.3)
177
sorbet-runtime
188
zeitwerk
199

2010
GEM
2111
remote: https://rubygems.org/
2212
specs:
13+
appraisal (2.5.0)
14+
bundler
15+
rake
16+
thor (>= 0.14.0)
2317
ast (2.4.2)
18+
benchmark (0.4.0)
2419
bigdecimal (3.1.7)
2520
commander (4.6.0)
2621
highline (~> 2.0.0)
@@ -57,19 +52,21 @@ GEM
5752
dry-inflector (~> 1.0)
5853
dry-logic (~> 1.4)
5954
zeitwerk (~> 2.6)
60-
erubi (1.12.0)
55+
erubi (1.13.1)
6156
highline (2.0.3)
6257
io-console (0.7.2)
6358
irb (1.12.0)
6459
rdoc
6560
reline (>= 0.4.2)
66-
json (2.7.2)
67-
language_server-protocol (3.17.0.3)
61+
json (2.10.2)
62+
language_server-protocol (3.17.0.4)
63+
lint_roller (1.1.0)
64+
logger (1.7.0)
6865
multi_json (1.15.0)
6966
netrc (0.11.0)
7067
oj (3.16.3)
7168
bigdecimal (>= 3.0)
72-
openssl (3.2.0)
69+
openssl (3.3.0)
7370
parallel (1.24.0)
7471
parallel_tests (4.5.2)
7572
parallel
@@ -78,27 +75,29 @@ GEM
7875
parser
7976
rainbow (~> 3.0)
8077
sorbet-runtime (>= 0.5)
81-
parser (3.3.0.5)
78+
parser (3.3.8.0)
8279
ast (~> 2.4.1)
8380
racc
84-
prettier_print (1.2.1)
85-
prism (0.24.0)
81+
prism (1.4.0)
8682
psych (5.1.2)
8783
stringio
8884
racc (1.7.3)
8985
rainbow (3.1.1)
9086
rake (13.1.0)
91-
rbi (0.1.9)
92-
prism (>= 0.18.0, < 0.25)
87+
rbi (0.3.2)
88+
prism (~> 1.0)
89+
rbs (>= 3.4.4)
9390
sorbet-runtime (>= 0.5.9204)
91+
rbs (3.9.2)
92+
logger
9493
rdoc (6.6.3.1)
9594
psych (>= 4.0.0)
9695
reek (6.3.0)
9796
dry-schema (~> 1.13.0)
9897
parser (~> 3.3.0)
9998
rainbow (>= 2.0, < 4.0)
10099
rexml (~> 3.1)
101-
regexp_parser (2.9.0)
100+
regexp_parser (2.10.0)
102101
reline (0.5.0)
103102
io-console (~> 0.5)
104103
rexml (3.2.6)
@@ -117,35 +116,29 @@ GEM
117116
rspec-support (3.13.1)
118117
rspec_junit_formatter (0.6.0)
119118
rspec-core (>= 2, < 4, != 2.12.0)
120-
rubocop (1.59.0)
119+
rubocop (1.75.2)
121120
json (~> 2.3)
122-
language_server-protocol (>= 3.17.0)
121+
language_server-protocol (~> 3.17.0.2)
122+
lint_roller (~> 1.1.0)
123123
parallel (~> 1.10)
124-
parser (>= 3.2.2.4)
124+
parser (>= 3.3.0.2)
125125
rainbow (>= 2.2.2, < 4.0)
126-
regexp_parser (>= 1.8, < 3.0)
127-
rexml (>= 3.2.5, < 4.0)
128-
rubocop-ast (>= 1.30.0, < 2.0)
126+
regexp_parser (>= 2.9.3, < 3.0)
127+
rubocop-ast (>= 1.44.0, < 2.0)
129128
ruby-progressbar (~> 1.7)
130-
unicode-display_width (>= 2.4.0, < 3.0)
131-
rubocop-ast (1.30.0)
132-
parser (>= 3.2.1.0)
133-
rubocop-capybara (2.20.0)
134-
rubocop (~> 1.41)
135-
rubocop-factory_bot (2.25.1)
136-
rubocop (~> 1.41)
137-
rubocop-performance (1.20.2)
138-
rubocop (>= 1.48.1, < 2.0)
139-
rubocop-ast (>= 1.30.0, < 2.0)
140-
rubocop-rspec (2.29.1)
141-
rubocop (~> 1.40)
142-
rubocop-capybara (~> 2.17)
143-
rubocop-factory_bot (~> 2.22)
144-
rubocop-rspec_rails (~> 2.28)
145-
rubocop-rspec_rails (2.28.2)
146-
rubocop (~> 1.40)
147-
rubocop-sorbet (0.8.0)
148-
rubocop (>= 0.90.0)
129+
unicode-display_width (>= 2.4.0, < 4.0)
130+
rubocop-ast (1.44.1)
131+
parser (>= 3.3.7.2)
132+
prism (~> 1.4)
133+
rubocop-performance (1.25.0)
134+
lint_roller (~> 1.1)
135+
rubocop (>= 1.75.0, < 2.0)
136+
rubocop-ast (>= 1.38.0, < 2.0)
137+
rubocop-rspec (3.5.0)
138+
lint_roller (~> 1.1)
139+
rubocop (~> 1.72, >= 1.72.1)
140+
rubocop-sorbet (0.10.0)
141+
rubocop (>= 1)
149142
ruby-progressbar (1.13.0)
150143
simplecov (0.22.0)
151144
docile (~> 1.1)
@@ -160,37 +153,39 @@ GEM
160153
sorbet-static-and-runtime (0.5.11332)
161154
sorbet (= 0.5.11332)
162155
sorbet-runtime (= 0.5.11332)
163-
spoom (1.2.4)
156+
spoom (1.6.1)
164157
erubi (>= 1.10.0)
158+
prism (>= 0.28.0)
159+
rbi (>= 0.2.3)
165160
sorbet-static-and-runtime (>= 0.5.10187)
166-
syntax_tree (>= 6.1.1)
167161
thor (>= 0.19.2)
168162
stringio (3.1.0)
169-
syntax_tree (6.2.0)
170-
prettier_print (>= 1.2.0)
171-
tapioca (0.12.0)
163+
tapioca (0.16.11)
164+
benchmark
172165
bundler (>= 2.2.25)
173166
netrc (>= 0.11.0)
174167
parallel (>= 1.21.0)
175-
rbi (>= 0.1.4, < 0.2)
176-
sorbet-static-and-runtime (>= 0.5.10820)
177-
spoom (~> 1.2.0, >= 1.2.0)
168+
rbi (~> 0.2)
169+
sorbet-static-and-runtime (>= 0.5.11087)
170+
spoom (>= 1.2.0)
178171
thor (>= 1.2.0)
179172
yard-sorbet
180173
thor (1.3.1)
181174
timecop (0.9.8)
182-
unicode-display_width (2.5.0)
183-
yard (0.9.36)
184-
yard-sorbet (0.8.1)
185-
sorbet-runtime (>= 0.5)
186-
yard (>= 0.9)
175+
unicode-display_width (3.1.4)
176+
unicode-emoji (~> 4.0, >= 4.0.4)
177+
unicode-emoji (4.0.4)
178+
yard (0.9.37)
179+
yard-sorbet (0.9.0)
180+
sorbet-runtime
181+
yard
187182
zeitwerk (2.6.13)
188183

189184
PLATFORMS
190185
x86_64-linux
191186

192187
DEPENDENCIES
193-
appraisal (~> 2)!
188+
appraisal (~> 2.5)
194189
bundler (~> 2)
195190
debug (>= 1.0)
196191
oj
@@ -200,15 +195,15 @@ DEPENDENCIES
200195
reek
201196
rspec (~> 3)
202197
rspec_junit_formatter
203-
rubocop (~> 1.59)
204-
rubocop-performance (~> 1.20)
205-
rubocop-rspec (~> 2.29)
206-
rubocop-sorbet (~> 0.8)
198+
rubocop (~> 1.75)
199+
rubocop-performance (~> 1.25)
200+
rubocop-rspec (~> 3.5)
201+
rubocop-sorbet (~> 0.10)
207202
ruby-paseto!
208203
simplecov (~> 0)
209204
simplecov_json_formatter
210205
sorbet (~> 0)
211-
tapioca (~> 0.12.0)
206+
tapioca (~> 0.16.11)
212207
timecop (~> 0)
213208

214209
BUNDLED WITH

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ Then, run `bundle install` and `require 'paseto'`.
3131
## Supported PASETO versions
3232

3333
`paseto` supports these PASETO versions and purposes:
34-
| purpose | v4 | v3 |
35-
| ---------| ---- | ---- |
36-
| `local` |||
37-
| `public` |||
34+
| purpose | v4 | v3 |
35+
| -------- | --- | --- |
36+
| `local` | | |
37+
| `public` | | |
3838

3939
## Support for PASERK types
4040

4141
| | v4 | v3 |
4242
| ----------------------------------------------------------------------------------------------------------------------------- | --- | --- |
43-
| [`lid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/lid.md) |||
44-
| [`sid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/sid.md) |||
45-
| [`pid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/pid.md) |||
46-
| [`local`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local.md) |||
47-
| [`secret`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret.md) |||
48-
| [`public`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/public.md) |||
49-
| [`seal`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/seal.md) |||
50-
| [`local-wrap`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local-wrap.md) |||
51-
| [`secret-wrap`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret-wrap.md) |||
52-
| [`local-pw`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local-pw.md) |||
53-
| [`secret-pw`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret-pw.md) |||
43+
| [`lid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/lid.md) | | |
44+
| [`sid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/sid.md) | | |
45+
| [`pid`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/pid.md) | | |
46+
| [`local`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local.md) | | |
47+
| [`secret`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret.md) | | |
48+
| [`public`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/public.md) | | |
49+
| [`seal`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/seal.md) | | |
50+
| [`local-wrap`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local-wrap.md) | | |
51+
| [`secret-wrap`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret-wrap.md) | | |
52+
| [`local-pw`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/local-pw.md) | | |
53+
| [`secret-pw`](https://github.com/paseto-standard/paserk/blob/8cc4934687a3c9235387d005fb79eec33f43166d/types/secret-pw.md) | | |
5454

5555
## Implementation Guideline compliance
5656

@@ -482,17 +482,17 @@ hash = { data: 'data' }
482482
payload = crypt.encode(hash)
483483

484484
# Require presence
485-
crypt.decode(payload, verify_jti: true)) # => Paseto::InvalidTokenIdentifier
485+
crypt.decode(payload, verify_jti: true) # => Paseto::InvalidTokenIdentifier
486486

487487
# Require exact value
488488
hash[:jti] = 'foo'
489489
payload = crypt.encode(payload: hash)
490-
crypt.decode(payload, verify_jti: 'foo')) # { 'data' => ... }
491-
crypt.decode(payload, verify_jti: 'bar')) # Paseto::InvalidTokenIdentifier
490+
crypt.decode(payload, verify_jti: 'foo') # { 'data' => ... }
491+
crypt.decode(payload, verify_jti: 'bar') # Paseto::InvalidTokenIdentifier
492492

493493
# Or something more complex
494494
jti_proc = ->(jti) { jti == 'bar'}
495-
crypt.decode(payload, verify_jti: jti_proc)) # Paseto::InvalidTokenIdentifier
495+
crypt.decode(payload, verify_jti: jti_proc) # Paseto::InvalidTokenIdentifier
496496
```
497497

498498
## Development

gemfiles/rbnacl.gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ gem "rake", "~> 13"
88
gem "reek"
99
gem "rspec", "~> 3"
1010
gem "rspec_junit_formatter"
11-
gem "rubocop", "~> 1.59"
12-
gem "rubocop-performance", "~> 1.20"
13-
gem "rubocop-rspec", "~> 2.29"
14-
gem "rubocop-sorbet", "~> 0.8"
11+
gem "rubocop", "~> 1.75", require: false
12+
gem "rubocop-performance", "~> 1.25", require: false
13+
gem "rubocop-rspec", "~> 3.5", require: false
14+
gem "rubocop-sorbet", "~> 0.10", require: false
1515
gem "simplecov", "~> 0"
1616
gem "simplecov_json_formatter"
1717
gem "sorbet", "~> 0"

0 commit comments

Comments
 (0)