jwt 1.5.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +20 -0
- data/.ebert.yml +18 -0
- data/.gitignore +11 -0
- data/.reek.yml +40 -0
- data/.rspec +1 -0
- data/.rubocop.yml +98 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +476 -0
- data/Gemfile +3 -0
- data/LICENSE +7 -0
- data/Manifest +3 -1
- data/README.md +478 -0
- data/Rakefile +8 -15
- data/lib/jwt/algos/ecdsa.rb +35 -0
- data/lib/jwt/algos/eddsa.rb +23 -0
- data/lib/jwt/algos/hmac.rb +33 -0
- data/lib/jwt/algos/rsa.rb +19 -0
- data/lib/jwt/algos/unsupported.rb +16 -0
- data/lib/jwt/decode.rb +49 -0
- data/lib/jwt/default_options.rb +15 -0
- data/lib/jwt/encode.rb +51 -0
- data/lib/jwt/error.rb +16 -0
- data/lib/jwt/security_utils.rb +51 -0
- data/lib/jwt/signature.rb +50 -0
- data/lib/jwt/verify.rb +102 -0
- data/lib/jwt/version.rb +24 -0
- data/lib/jwt.rb +33 -203
- data/ruby-jwt.gemspec +31 -0
- data/spec/fixtures/certs/ec256-private.pem +8 -0
- data/spec/fixtures/certs/ec256-public.pem +4 -0
- data/spec/fixtures/certs/ec256-wrong-private.pem +8 -0
- data/spec/fixtures/certs/ec256-wrong-public.pem +4 -0
- data/spec/fixtures/certs/ec384-private.pem +9 -0
- data/spec/fixtures/certs/ec384-public.pem +5 -0
- data/spec/fixtures/certs/ec384-wrong-private.pem +9 -0
- data/spec/fixtures/certs/ec384-wrong-public.pem +5 -0
- data/spec/fixtures/certs/ec512-private.pem +10 -0
- data/spec/fixtures/certs/ec512-public.pem +6 -0
- data/spec/fixtures/certs/ec512-wrong-private.pem +10 -0
- data/spec/fixtures/certs/ec512-wrong-public.pem +6 -0
- data/spec/fixtures/certs/rsa-1024-private.pem +15 -0
- data/spec/fixtures/certs/rsa-1024-public.pem +6 -0
- data/spec/fixtures/certs/rsa-2048-private.pem +27 -0
- data/spec/fixtures/certs/rsa-2048-public.pem +9 -0
- data/spec/fixtures/certs/rsa-2048-wrong-private.pem +27 -0
- data/spec/fixtures/certs/rsa-2048-wrong-public.pem +9 -0
- data/spec/fixtures/certs/rsa-4096-private.pem +51 -0
- data/spec/fixtures/certs/rsa-4096-public.pem +14 -0
- data/spec/integration/readme_examples_spec.rb +202 -0
- data/spec/jwt/verify_spec.rb +232 -0
- data/spec/jwt_spec.rb +236 -384
- data/spec/spec_helper.rb +28 -0
- metadata +187 -26
- data/jwt.gemspec +0 -34
- data/lib/jwt/json.rb +0 -32
- data/spec/helper.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fca109273d0c036454af123d30bb3eb75f0de39
|
4
|
+
data.tar.gz: 8848296d35465d3411f71d882da73ef05663f6a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213d4ea31197a90be8b8cd08ea92dee4659f47b884bc3571440697db979cf98b04e3d1cf487bc94a7a8a8f3f29ee34ebf48d7cc5bd9cfa9f2ca65a092bb2c3d3
|
7
|
+
data.tar.gz: 530335d90320cdc5501cc1f67984502f79a390641b904567971ad4858a285128cc4702dbf54d505324bcb1ea3ecdf5675057c942e9709ecf0f17b4099229c04d
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
engines:
|
2
|
+
rubocop:
|
3
|
+
enabled: true
|
4
|
+
golint:
|
5
|
+
enabled: false
|
6
|
+
gofmt:
|
7
|
+
enabled: false
|
8
|
+
eslint:
|
9
|
+
enabled: false
|
10
|
+
csslint:
|
11
|
+
enabled: false
|
12
|
+
|
13
|
+
ratings:
|
14
|
+
paths:
|
15
|
+
- lib/**
|
16
|
+
- "**.rb"
|
17
|
+
|
18
|
+
exclude_paths:
|
19
|
+
- spec/**/*
|
20
|
+
- vendor/**/*
|
data/.ebert.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
styleguide: excpt/linters
|
2
|
+
engines:
|
3
|
+
reek:
|
4
|
+
enabled: true
|
5
|
+
fixme:
|
6
|
+
enabled: true
|
7
|
+
rubocop:
|
8
|
+
enabled: true
|
9
|
+
channel: rubocop-0-49
|
10
|
+
duplication:
|
11
|
+
config:
|
12
|
+
languages:
|
13
|
+
- ruby
|
14
|
+
enabled: true
|
15
|
+
remark-lint:
|
16
|
+
enabled: true
|
17
|
+
exclude_paths:
|
18
|
+
- spec
|
data/.gitignore
ADDED
data/.reek.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
TooManyStatements:
|
3
|
+
max_statements: 10
|
4
|
+
UncommunicativeMethodName:
|
5
|
+
reject:
|
6
|
+
- !ruby/regexp /^[a-z]$/
|
7
|
+
- !ruby/regexp /[0-9]$/
|
8
|
+
UncommunicativeParameterName:
|
9
|
+
reject:
|
10
|
+
- !ruby/regexp /^.$/
|
11
|
+
- !ruby/regexp /[0-9]$/
|
12
|
+
- !ruby/regexp /^_/
|
13
|
+
UncommunicativeVariableName:
|
14
|
+
reject:
|
15
|
+
- !ruby/regexp /^.$/
|
16
|
+
- !ruby/regexp /[0-9]$/
|
17
|
+
UtilityFunction:
|
18
|
+
enabled: false
|
19
|
+
LongParameterList:
|
20
|
+
enabled: false
|
21
|
+
DuplicateMethodCall:
|
22
|
+
max_calls: 2
|
23
|
+
IrresponsibleModule:
|
24
|
+
enabled: false
|
25
|
+
NestedIterators:
|
26
|
+
max_allowed_nesting: 2
|
27
|
+
PrimaDonnaMethod:
|
28
|
+
enabled: false
|
29
|
+
UnusedParameters:
|
30
|
+
enabled: false
|
31
|
+
FeatureEnvy:
|
32
|
+
enabled: false
|
33
|
+
ControlParameter:
|
34
|
+
enabled: false
|
35
|
+
UnusedPrivateMethod:
|
36
|
+
enabled: false
|
37
|
+
InstanceVariableAssumption:
|
38
|
+
exclude:
|
39
|
+
- !ruby/regexp /Controller$/
|
40
|
+
- !ruby/regexp /Mailer$/s
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'bin/**/*'
|
4
|
+
- 'db/**/*'
|
5
|
+
- 'config/**/*'
|
6
|
+
- 'script/**/*'
|
7
|
+
|
8
|
+
Rails:
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
Style/AlignParameters:
|
12
|
+
EnforcedStyle: with_fixed_indentation
|
13
|
+
|
14
|
+
Style/CaseIndentation:
|
15
|
+
EnforcedStyle: end
|
16
|
+
|
17
|
+
Style/AsciiComments:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Style/IndentHash:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Style/CollectionMethods:
|
24
|
+
Enabled: true
|
25
|
+
PreferredMethods:
|
26
|
+
inject: 'inject'
|
27
|
+
|
28
|
+
Style/Documentation:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/BlockDelimiters:
|
32
|
+
Exclude:
|
33
|
+
- spec/**/*_spec.rb
|
34
|
+
|
35
|
+
Style/BracesAroundHashParameters:
|
36
|
+
Exclude:
|
37
|
+
- spec/**/*_spec.rb
|
38
|
+
|
39
|
+
Style/GuardClause:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/IfUnlessModifier:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/SpaceInsideHashLiteralBraces:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
Style/Lambda:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
Style/RaiseArgs:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Style/SignalException:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Metrics/AbcSize:
|
58
|
+
Max: 20
|
59
|
+
|
60
|
+
Metrics/ClassLength:
|
61
|
+
Max: 100
|
62
|
+
|
63
|
+
Metrics/ModuleLength:
|
64
|
+
Max: 100
|
65
|
+
|
66
|
+
Metrics/LineLength:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Metrics/MethodLength:
|
70
|
+
Max: 15
|
71
|
+
|
72
|
+
Style/SingleLineBlockParams:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
Lint/EndAlignment:
|
76
|
+
EnforcedStyleAlignWith: variable
|
77
|
+
|
78
|
+
Style/FormatString:
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Style/MultilineMethodCallIndentation:
|
82
|
+
EnforcedStyle: indented
|
83
|
+
|
84
|
+
Style/MultilineOperationIndentation:
|
85
|
+
EnforcedStyle: indented
|
86
|
+
|
87
|
+
Style/WordArray:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
Style/RedundantSelf:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
Style/AlignHash:
|
94
|
+
Enabled: true
|
95
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
96
|
+
|
97
|
+
Style/TrivialAccessors:
|
98
|
+
AllowPredicates: true
|
data/.travis.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
sudo: required
|
2
|
+
cache: bundler
|
3
|
+
dist: trusty
|
4
|
+
language: ruby
|
5
|
+
rvm:
|
6
|
+
- 2.2.0
|
7
|
+
- 2.3.0
|
8
|
+
- 2.4.0
|
9
|
+
script: "bundle exec rspec && bundle exec codeclimate-test-reporter"
|
10
|
+
before_install:
|
11
|
+
- sudo add-apt-repository ppa:chris-lea/libsodium -y
|
12
|
+
- sudo apt-get update -q
|
13
|
+
- sudo apt-get install libsodium-dev -y
|
14
|
+
- gem install bundler
|