apiphobic-tokens 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 398930feeba2fd22da7cd12b8fd98db020bc8179bdb7b32bbee6c4869334156e
4
- data.tar.gz: 183cb8213657af6d911722be1ca9ad5fb81ccb60ab7e13e6faa26b05c183febe
3
+ metadata.gz: cfdcea174929f4bc35d14489cc907975cc52b7bdadde0685d149fe170bcef040
4
+ data.tar.gz: d9ef964a93b454acb6924d778e77c43b3aa863fdb3e4c99dbc634f85262f01a3
5
5
  SHA512:
6
- metadata.gz: 1310e6558cdaeb6e765cacb814d6466ec04034cb9b8d29954416d6ddc497a0de17b903ec8dd75e6979b07c825f2d12e28727b1c4e8a1d40b65c8f633ef805cee
7
- data.tar.gz: fdfa3decb6156e1ee068ebd45b5875b830f0d21cf3b7797ebc94691044f85a9c66138e145526f4afc4faa8c4fa6893e74a9382556114dd1321cecc078aef27f2
6
+ metadata.gz: 1d2dfabbb167d21ed16940580db4b6c25ce0d97b96bd80ae9be9dc3b9fd908ac47468f8510ddb6a4784319ebe953164a43088e030a2293e9d71223cdf37472c5
7
+ data.tar.gz: 07b4557ae1ee5fdd39ee0ead41ac95eb63222d2c14a78fd00029308d3e08f5f736a98ed24f10b750169735e1482a6e7582e3712d91014d59e828129c4c8a1fca
checksums.yaml.gz.sig CHANGED
Binary file
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2016 The Kompanee, Ltd
1
+ Copyright (c) 2010-2019 The Kompanee, Ltd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -10,7 +10,6 @@ require 'apiphobic/tokens/configurable'
10
10
  require 'apiphobic/tokens/json_web_tokens/null'
11
11
  require 'apiphobic/tokens/role_predicable'
12
12
 
13
- # rubocop:disable Metrics/ClassLength
14
13
  module Apiphobic
15
14
  module Tokens
16
15
  class JsonWebToken
@@ -47,11 +46,11 @@ class JsonWebToken
47
46
  new(data: data, headers: headers)
48
47
  end
49
48
 
50
- # rubocop:disable Metrics/ParameterLists, Metrics/LineLength
51
- def self.build(id: SecureRandom.uuid,
49
+ # rubocop:disable Metrics/ParameterLists
50
+ def self.build(audience_id:,
51
+ id: SecureRandom.uuid,
52
52
  audience: configuration.default_audience,
53
- audience_id:,
54
- expiration: Time.now.utc.to_i + (60 * configuration.default_expiration_in_minutes),
53
+ expiration: Time.now.utc.to_i + (60 * configuration.default_expiration_in_minutes), # rubocop:disable Layout/LineLength
55
54
  issuer: configuration.default_issuer,
56
55
  issued_at: Time.now.utc,
57
56
  not_before: Time.now.utc,
@@ -76,7 +75,7 @@ class JsonWebToken
76
75
  },
77
76
  )
78
77
  end
79
- # rubocop:enable Metrics/ParameterLists, Metrics/LineLength
78
+ # rubocop:enable Metrics/ParameterLists
80
79
 
81
80
  def available?
82
81
  not_before <= (Time.now.to_i + configuration.default_availability_leeway_in_seconds)
@@ -114,7 +113,7 @@ class JsonWebToken
114
113
  end
115
114
 
116
115
  def valid_id?
117
- id =~ /[a-f0-9]{8}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{12}/i
116
+ id =~ /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i
118
117
  end
119
118
 
120
119
  def valid_issuer?
@@ -323,4 +322,3 @@ class JsonWebToken
323
322
  end
324
323
  end
325
324
  end
326
- # rubocop:enable Metrics/ClassLength
@@ -5,7 +5,7 @@ module Tokens
5
5
  module RolePredicable
6
6
  def method_missing(name, *args)
7
7
  if role_predicates.include?(name)
8
- roles.map(&:to_s).include?(name.to_s.gsub(/\?\z/, ''))
8
+ roles.map(&:to_s).include?(name.to_s.delete_suffix('?'))
9
9
  else
10
10
  super
11
11
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Apiphobic
4
4
  module Tokens
5
- VERSION = '1.1.1'
5
+ VERSION = '1.2.0'
6
6
  end
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiphobic-tokens
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
@@ -10,28 +10,34 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDqjCCApKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBNMREwDwYDVQQDDAhydWJ5
14
- Z2VtczEjMCEGCgmSJomT8ixkARkWE2xpdmluZ2hpZ2hvbnRoZWJsb2cxEzARBgoJ
15
- kiaJk/IsZAEZFgNjb20wHhcNMTcwODAyMjI1OTM1WhcNMTgwODAyMjI1OTM1WjBN
16
- MREwDwYDVQQDDAhydWJ5Z2VtczEjMCEGCgmSJomT8ixkARkWE2xpdmluZ2hpZ2hv
17
- bnRoZWJsb2cxEzARBgoJkiaJk/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUA
18
- A4IBDwAwggEKAoIBAQDtLa7+7p49gW15OgOyRZad/F92iZcMdDjZ2kAxZlviXgVe
19
- PCtjfdURobH+YMdt++6eRkE25utIFqHyN51Shxfdc21T3fPQe/ZEoMyiJK4tYzbh
20
- 7VjNJG4ldvKKpS1p7iVz9imnyTxNwb0JaIOsOFCA04T0u6aCQi2acNvAPLviXk0q
21
- xJ/CKjI4QUTZKVrBt8Q1Egrp2yzmEnSNftDuTbBb8m4vDR+w325CwbKCgycHJ1/g
22
- YZ3FO76TzJuRVbsYS/bU5XKHVEpkeFmWBqEXsk4DuUIWLa6WZEJcoZf+YP+1pycG
23
- 7YqSbydpINtEdopD+EEI+g+zNJ4nSI8/eQcQyEjBAgMBAAGjgZQwgZEwCQYDVR0T
24
- BAIwADALBgNVHQ8EBAMCBLAw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1hbrebt+vAEAGczgw1Ri
36
+ rkLM6y+BHQdkOTj3VG4MjIU8D4h1Z73Exzxds/VbVKMEz+8JrFjGJ/tYa0PZ8U5p
37
+ 3yXL4G6eW3rdBW/OiLF7GgG2o26d02OMzf4+ubUVS5LQDOcd4vgNPLWzJSBt1YIh
38
+ TgBsED7Me5YdMVXxtTWYsF1VMzaL9hReD3UXGcxe
33
39
  -----END CERTIFICATE-----
34
- date: 2018-06-15 00:00:00.000000000 Z
40
+ date: 2022-07-09 00:00:00.000000000 Z
35
41
  dependencies:
36
42
  - !ruby/object:Gem::Dependency
37
43
  name: json-jwt
@@ -53,28 +59,28 @@ dependencies:
53
59
  requirements:
54
60
  - - "~>"
55
61
  - !ruby/object:Gem::Version
56
- version: '3.1'
62
+ version: '4.0'
57
63
  type: :runtime
58
64
  prerelease: false
59
65
  version_requirements: !ruby/object:Gem::Requirement
60
66
  requirements:
61
67
  - - "~>"
62
68
  - !ruby/object:Gem::Version
63
- version: '3.1'
69
+ version: '4.0'
64
70
  - !ruby/object:Gem::Dependency
65
71
  name: rspec
66
72
  requirement: !ruby/object:Gem::Requirement
67
73
  requirements:
68
74
  - - "~>"
69
75
  - !ruby/object:Gem::Version
70
- version: '3.7'
76
+ version: '3.11'
71
77
  type: :development
72
78
  prerelease: false
73
79
  version_requirements: !ruby/object:Gem::Requirement
74
80
  requirements:
75
81
  - - "~>"
76
82
  - !ruby/object:Gem::Version
77
- version: '3.7'
83
+ version: '3.11'
78
84
  - !ruby/object:Gem::Dependency
79
85
  name: rspeckled
80
86
  requirement: !ruby/object:Gem::Requirement
@@ -131,11 +137,17 @@ files:
131
137
  - lib/apiphobic/tokens/null.rb
132
138
  - lib/apiphobic/tokens/role_predicable.rb
133
139
  - lib/apiphobic/tokens/version.rb
134
- homepage: ''
140
+ homepage: https://github.com/thekompanee/apiphobic-tokens
135
141
  licenses:
136
142
  - MIT
137
143
  metadata:
138
144
  allowed_push_host: https://rubygems.org
145
+ bug_tracker_uri: https://github.com/thekompanee/apiphobic-tokens/issues
146
+ changelog_uri: https://github.com/thekompanee/apiphobic-tokens/blob/master/CHANGELOG.md
147
+ documentation_uri: https://github.com/thekompanee/apiphobic-tokens/tree/releases/v1.2.0
148
+ homepage_uri: https://github.com/thekompanee/apiphobic-tokens
149
+ source_code_uri: https://github.com/thekompanee/apiphobic-tokens
150
+ wiki_uri: https://github.com/thekompanee/apiphobic-tokens/wiki
139
151
  post_install_message:
140
152
  rdoc_options: []
141
153
  require_paths:
@@ -151,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
163
  - !ruby/object:Gem::Version
152
164
  version: '0'
153
165
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.7.6
166
+ rubygems_version: 3.3.7
156
167
  signing_key:
157
168
  specification_version: 4
158
169
  summary: API Tokens
metadata.gz.sig CHANGED
Binary file