descope 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/publish-gem.yaml +30 -5
  3. data/Gemfile +3 -3
  4. data/Gemfile.lock +12 -20
  5. data/README.md +18 -3
  6. data/descope.gemspec +25 -20
  7. data/examples/ruby/.ruby-version +1 -0
  8. data/examples/ruby/access_key_app.rb +4 -3
  9. data/examples/ruby/enchantedlink_app.rb +1 -0
  10. data/examples/ruby/magiclink_app.rb +1 -0
  11. data/examples/ruby/management/.ruby-version +1 -0
  12. data/examples/ruby/management/Gemfile +2 -2
  13. data/examples/ruby/management/access_key_app.rb +2 -0
  14. data/examples/ruby/management/audit_app.rb +32 -8
  15. data/examples/ruby/management/authz_app.rb +1 -0
  16. data/examples/ruby/management/flow_app.rb +1 -0
  17. data/examples/ruby/management/permission_app.rb +3 -2
  18. data/examples/ruby/management/role_app.rb +3 -2
  19. data/examples/ruby/management/tenant_app.rb +1 -0
  20. data/examples/ruby/management/user_app.rb +1 -0
  21. data/examples/ruby/oauth_app.rb +1 -0
  22. data/examples/ruby/otp_app.rb +38 -12
  23. data/examples/ruby/password_app.rb +8 -7
  24. data/examples/ruby/saml_app.rb +1 -0
  25. data/examples/ruby/version_check.rb +17 -0
  26. data/examples/ruby-on-rails-api/descope/Gemfile +3 -1
  27. data/examples/ruby-on-rails-api/descope/Gemfile.lock +121 -90
  28. data/examples/ruby-on-rails-api/descope/README.md +18 -18
  29. data/examples/ruby-on-rails-api/descope/app/assets/builds/application.css +20092 -23
  30. data/examples/ruby-on-rails-api/descope/app/assets/builds/application.js +0 -1
  31. data/examples/ruby-on-rails-api/descope/app/assets/builds/components/index.js +0 -14
  32. data/examples/ruby-on-rails-api/descope/package-lock.json +1021 -19306
  33. data/examples/ruby-on-rails-api/descope/package.json +8 -16
  34. data/examples/ruby-on-rails-api/descope/yarn.lock +459 -10641
  35. data/lib/descope/api/v1/auth/otp.rb +21 -14
  36. data/lib/descope/api/v1/auth.rb +17 -20
  37. data/lib/descope/api/v1/management/audit.rb +24 -0
  38. data/lib/descope/api/v1/management/common.rb +1 -0
  39. data/lib/descope/mixins/common.rb +5 -2
  40. data/lib/descope/mixins/validation.rb +21 -6
  41. data/lib/descope/version.rb +1 -1
  42. data/spec/integration/lib.descope/api/v1/auth/otp_spec.rb +72 -7
  43. data/spec/integration/lib.descope/api/v1/management/audit_spec.rb +36 -0
  44. data/spec/integration/lib.descope/api/v1/management/roles_spec.rb +1 -1
  45. data/spec/lib.descope/api/v1/auth/otp_spec.rb +176 -18
  46. data/spec/lib.descope/api/v1/auth_spec.rb +1 -1
  47. data/spec/lib.descope/api/v1/management/audit_spec.rb +92 -0
  48. metadata +25 -133
  49. data/examples/ruby-on-rails-api/descope/app/assets/builds/reportWebVitals.js +0 -211
  50. data/examples/ruby-on-rails-api/descope/app/assets/builds/reportWebVitals.js.map +0 -7
@@ -3,7 +3,7 @@ source "https://rubygems.org"
3
3
  ruby "3.3.0"
4
4
 
5
5
  # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6
- gem "rails", "~> 7.1.3"
6
+ gem "rails", "~> 7.1.3.2"
7
7
 
8
8
  gem 'descope', path: '../../../..'
9
9
 
@@ -63,5 +63,7 @@ group :development do
63
63
 
64
64
  # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
65
65
  # gem "spring"
66
+ gem 'rubocop-rails', '2.24.1', require: false
67
+ gem "rdoc", ">= 6.6.3.1", require: false
66
68
  end
67
69
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../../..
3
3
  specs:
4
- descope (1.0.4)
4
+ descope (1.0.5)
5
5
  addressable (~> 2.8)
6
6
  jwt (~> 2.7)
7
7
  rest-client (~> 2.1)
@@ -11,35 +11,35 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (7.1.3)
15
- actionpack (= 7.1.3)
16
- activesupport (= 7.1.3)
14
+ actioncable (7.1.3.2)
15
+ actionpack (= 7.1.3.2)
16
+ activesupport (= 7.1.3.2)
17
17
  nio4r (~> 2.0)
18
18
  websocket-driver (>= 0.6.1)
19
19
  zeitwerk (~> 2.6)
20
- actionmailbox (7.1.3)
21
- actionpack (= 7.1.3)
22
- activejob (= 7.1.3)
23
- activerecord (= 7.1.3)
24
- activestorage (= 7.1.3)
25
- activesupport (= 7.1.3)
20
+ actionmailbox (7.1.3.2)
21
+ actionpack (= 7.1.3.2)
22
+ activejob (= 7.1.3.2)
23
+ activerecord (= 7.1.3.2)
24
+ activestorage (= 7.1.3.2)
25
+ activesupport (= 7.1.3.2)
26
26
  mail (>= 2.7.1)
27
27
  net-imap
28
28
  net-pop
29
29
  net-smtp
30
- actionmailer (7.1.3)
31
- actionpack (= 7.1.3)
32
- actionview (= 7.1.3)
33
- activejob (= 7.1.3)
34
- activesupport (= 7.1.3)
30
+ actionmailer (7.1.3.2)
31
+ actionpack (= 7.1.3.2)
32
+ actionview (= 7.1.3.2)
33
+ activejob (= 7.1.3.2)
34
+ activesupport (= 7.1.3.2)
35
35
  mail (~> 2.5, >= 2.5.4)
36
36
  net-imap
37
37
  net-pop
38
38
  net-smtp
39
39
  rails-dom-testing (~> 2.2)
40
- actionpack (7.1.3)
41
- actionview (= 7.1.3)
42
- activesupport (= 7.1.3)
40
+ actionpack (7.1.3.2)
41
+ actionview (= 7.1.3.2)
42
+ activesupport (= 7.1.3.2)
43
43
  nokogiri (>= 1.8.5)
44
44
  racc
45
45
  rack (>= 2.2.4)
@@ -47,35 +47,35 @@ GEM
47
47
  rack-test (>= 0.6.3)
48
48
  rails-dom-testing (~> 2.2)
49
49
  rails-html-sanitizer (~> 1.6)
50
- actiontext (7.1.3)
51
- actionpack (= 7.1.3)
52
- activerecord (= 7.1.3)
53
- activestorage (= 7.1.3)
54
- activesupport (= 7.1.3)
50
+ actiontext (7.1.3.2)
51
+ actionpack (= 7.1.3.2)
52
+ activerecord (= 7.1.3.2)
53
+ activestorage (= 7.1.3.2)
54
+ activesupport (= 7.1.3.2)
55
55
  globalid (>= 0.6.0)
56
56
  nokogiri (>= 1.8.5)
57
- actionview (7.1.3)
58
- activesupport (= 7.1.3)
57
+ actionview (7.1.3.2)
58
+ activesupport (= 7.1.3.2)
59
59
  builder (~> 3.1)
60
60
  erubi (~> 1.11)
61
61
  rails-dom-testing (~> 2.2)
62
62
  rails-html-sanitizer (~> 1.6)
63
- activejob (7.1.3)
64
- activesupport (= 7.1.3)
63
+ activejob (7.1.3.2)
64
+ activesupport (= 7.1.3.2)
65
65
  globalid (>= 0.3.6)
66
- activemodel (7.1.3)
67
- activesupport (= 7.1.3)
68
- activerecord (7.1.3)
69
- activemodel (= 7.1.3)
70
- activesupport (= 7.1.3)
66
+ activemodel (7.1.3.2)
67
+ activesupport (= 7.1.3.2)
68
+ activerecord (7.1.3.2)
69
+ activemodel (= 7.1.3.2)
70
+ activesupport (= 7.1.3.2)
71
71
  timeout (>= 0.4.0)
72
- activestorage (7.1.3)
73
- actionpack (= 7.1.3)
74
- activejob (= 7.1.3)
75
- activerecord (= 7.1.3)
76
- activesupport (= 7.1.3)
72
+ activestorage (7.1.3.2)
73
+ actionpack (= 7.1.3.2)
74
+ activejob (= 7.1.3.2)
75
+ activerecord (= 7.1.3.2)
76
+ activesupport (= 7.1.3.2)
77
77
  marcel (~> 1.0)
78
- activesupport (7.1.3)
78
+ activesupport (7.1.3.2)
79
79
  base64
80
80
  bigdecimal
81
81
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -87,10 +87,11 @@ GEM
87
87
  tzinfo (~> 2.0)
88
88
  addressable (2.8.6)
89
89
  public_suffix (>= 2.0.2, < 6.0)
90
+ ast (2.4.2)
90
91
  base64 (0.2.0)
91
- bigdecimal (3.1.6)
92
+ bigdecimal (3.1.7)
92
93
  bindex (0.8.1)
93
- bootsnap (1.17.1)
94
+ bootsnap (1.18.3)
94
95
  msgpack (~> 1.2)
95
96
  builder (3.2.4)
96
97
  concurrent-ruby (1.2.3)
@@ -99,22 +100,21 @@ GEM
99
100
  cssbundling-rails (1.4.0)
100
101
  railties (>= 6.0.0)
101
102
  date (3.3.4)
102
- debug (1.9.1)
103
+ debug (1.9.2)
103
104
  irb (~> 1.10)
104
105
  reline (>= 0.3.8)
105
106
  domain_name (0.6.20240107)
106
- drb (2.2.0)
107
- ruby2_keywords
107
+ drb (2.2.1)
108
108
  erubi (1.12.0)
109
109
  globalid (1.2.1)
110
110
  activesupport (>= 6.1)
111
111
  http-accept (1.7.0)
112
112
  http-cookie (1.0.5)
113
113
  domain_name (~> 0.5)
114
- i18n (1.14.1)
114
+ i18n (1.14.4)
115
115
  concurrent-ruby (~> 1.0)
116
116
  io-console (0.7.2)
117
- irb (1.11.1)
117
+ irb (1.12.0)
118
118
  rdoc
119
119
  reline (>= 0.4.2)
120
120
  jbuilder (2.11.5)
@@ -122,7 +122,10 @@ GEM
122
122
  activesupport (>= 5.0.0)
123
123
  jsbundling-rails (1.3.0)
124
124
  railties (>= 6.0.0)
125
- jwt (2.7.1)
125
+ json (2.7.2)
126
+ jwt (2.8.1)
127
+ base64
128
+ language_server-protocol (3.17.0.3)
126
129
  loofah (2.22.0)
127
130
  crass (~> 1.0.2)
128
131
  nokogiri (>= 1.12.0)
@@ -131,44 +134,48 @@ GEM
131
134
  net-imap
132
135
  net-pop
133
136
  net-smtp
134
- marcel (1.0.2)
137
+ marcel (1.0.4)
135
138
  mime-types (3.5.2)
136
139
  mime-types-data (~> 3.2015)
137
- mime-types-data (3.2024.0206)
140
+ mime-types-data (3.2024.0305)
138
141
  mini_mime (1.1.5)
139
- minitest (5.21.2)
142
+ minitest (5.22.3)
140
143
  msgpack (1.7.2)
141
144
  mutex_m (0.2.0)
142
- net-imap (0.4.9.1)
145
+ net-imap (0.4.10)
143
146
  date
144
147
  net-protocol
145
148
  net-pop (0.1.2)
146
149
  net-protocol
147
150
  net-protocol (0.2.2)
148
151
  timeout
149
- net-smtp (0.4.0.1)
152
+ net-smtp (0.5.0)
150
153
  net-protocol
151
154
  netrc (0.11.0)
152
- nio4r (2.7.0)
153
- nokogiri (1.16.2-aarch64-linux)
155
+ nio4r (2.7.1)
156
+ nokogiri (1.16.3-aarch64-linux)
154
157
  racc (~> 1.4)
155
- nokogiri (1.16.2-arm-linux)
158
+ nokogiri (1.16.3-arm-linux)
156
159
  racc (~> 1.4)
157
- nokogiri (1.16.2-arm64-darwin)
160
+ nokogiri (1.16.3-arm64-darwin)
158
161
  racc (~> 1.4)
159
- nokogiri (1.16.2-x86-linux)
162
+ nokogiri (1.16.3-x86-linux)
160
163
  racc (~> 1.4)
161
- nokogiri (1.16.2-x86_64-darwin)
164
+ nokogiri (1.16.3-x86_64-darwin)
162
165
  racc (~> 1.4)
163
- nokogiri (1.16.2-x86_64-linux)
166
+ nokogiri (1.16.3-x86_64-linux)
164
167
  racc (~> 1.4)
168
+ parallel (1.24.0)
169
+ parser (3.3.0.5)
170
+ ast (~> 2.4.1)
171
+ racc
165
172
  psych (5.1.2)
166
173
  stringio
167
- public_suffix (5.0.4)
174
+ public_suffix (5.0.5)
168
175
  puma (6.4.2)
169
176
  nio4r (~> 2.0)
170
177
  racc (1.7.3)
171
- rack (3.0.9.1)
178
+ rack (3.0.10)
172
179
  rack-session (2.0.0)
173
180
  rack (>= 3.0.0)
174
181
  rack-test (2.1.0)
@@ -176,20 +183,20 @@ GEM
176
183
  rackup (2.1.0)
177
184
  rack (>= 3)
178
185
  webrick (~> 1.8)
179
- rails (7.1.3)
180
- actioncable (= 7.1.3)
181
- actionmailbox (= 7.1.3)
182
- actionmailer (= 7.1.3)
183
- actionpack (= 7.1.3)
184
- actiontext (= 7.1.3)
185
- actionview (= 7.1.3)
186
- activejob (= 7.1.3)
187
- activemodel (= 7.1.3)
188
- activerecord (= 7.1.3)
189
- activestorage (= 7.1.3)
190
- activesupport (= 7.1.3)
186
+ rails (7.1.3.2)
187
+ actioncable (= 7.1.3.2)
188
+ actionmailbox (= 7.1.3.2)
189
+ actionmailer (= 7.1.3.2)
190
+ actionpack (= 7.1.3.2)
191
+ actiontext (= 7.1.3.2)
192
+ actionview (= 7.1.3.2)
193
+ activejob (= 7.1.3.2)
194
+ activemodel (= 7.1.3.2)
195
+ activerecord (= 7.1.3.2)
196
+ activestorage (= 7.1.3.2)
197
+ activesupport (= 7.1.3.2)
191
198
  bundler (>= 1.15.0)
192
- railties (= 7.1.3)
199
+ railties (= 7.1.3.2)
193
200
  rails-dom-testing (2.2.0)
194
201
  activesupport (>= 5.0.0)
195
202
  minitest
@@ -197,18 +204,20 @@ GEM
197
204
  rails-html-sanitizer (1.6.0)
198
205
  loofah (~> 2.21)
199
206
  nokogiri (~> 1.14)
200
- railties (7.1.3)
201
- actionpack (= 7.1.3)
202
- activesupport (= 7.1.3)
207
+ railties (7.1.3.2)
208
+ actionpack (= 7.1.3.2)
209
+ activesupport (= 7.1.3.2)
203
210
  irb
204
211
  rackup (>= 1.0.0)
205
212
  rake (>= 12.2)
206
213
  thor (~> 1.0, >= 1.2.2)
207
214
  zeitwerk (~> 2.6)
208
- rake (13.1.0)
209
- rdoc (6.6.2)
215
+ rainbow (3.1.1)
216
+ rake (13.2.1)
217
+ rdoc (6.6.3.1)
210
218
  psych (>= 4.0.0)
211
- reline (0.4.2)
219
+ regexp_parser (2.9.0)
220
+ reline (0.5.1)
212
221
  io-console (~> 0.5)
213
222
  rest-client (2.1.0)
214
223
  http-accept (>= 1.7.0, < 2.0)
@@ -216,7 +225,26 @@ GEM
216
225
  mime-types (>= 1.16, < 4.0)
217
226
  netrc (~> 0.8)
218
227
  retryable (3.0.5)
219
- ruby2_keywords (0.0.5)
228
+ rexml (3.2.6)
229
+ rubocop (1.63.0)
230
+ json (~> 2.3)
231
+ language_server-protocol (>= 3.17.0)
232
+ parallel (~> 1.10)
233
+ parser (>= 3.3.0.2)
234
+ rainbow (>= 2.2.2, < 4.0)
235
+ regexp_parser (>= 1.8, < 3.0)
236
+ rexml (>= 3.2.5, < 4.0)
237
+ rubocop-ast (>= 1.31.1, < 2.0)
238
+ ruby-progressbar (~> 1.7)
239
+ unicode-display_width (>= 2.4.0, < 3.0)
240
+ rubocop-ast (1.31.2)
241
+ parser (>= 3.3.0.4)
242
+ rubocop-rails (2.24.1)
243
+ activesupport (>= 4.2.0)
244
+ rack (>= 1.1)
245
+ rubocop (>= 1.33.0, < 2.0)
246
+ rubocop-ast (>= 1.31.1, < 2.0)
247
+ ruby-progressbar (1.13.0)
220
248
  sprockets (4.2.1)
221
249
  concurrent-ruby (~> 1.0)
222
250
  rack (>= 2.2.4, < 4)
@@ -224,23 +252,24 @@ GEM
224
252
  actionpack (>= 5.2)
225
253
  activesupport (>= 5.2)
226
254
  sprockets (>= 3.0.0)
227
- sqlite3 (1.7.0-aarch64-linux)
228
- sqlite3 (1.7.0-arm-linux)
229
- sqlite3 (1.7.0-arm64-darwin)
230
- sqlite3 (1.7.0-x86-linux)
231
- sqlite3 (1.7.0-x86_64-darwin)
232
- sqlite3 (1.7.0-x86_64-linux)
255
+ sqlite3 (1.7.3-aarch64-linux)
256
+ sqlite3 (1.7.3-arm-linux)
257
+ sqlite3 (1.7.3-arm64-darwin)
258
+ sqlite3 (1.7.3-x86-linux)
259
+ sqlite3 (1.7.3-x86_64-darwin)
260
+ sqlite3 (1.7.3-x86_64-linux)
233
261
  stimulus-rails (1.3.3)
234
262
  railties (>= 6.0.0)
235
263
  stringio (3.1.0)
236
- thor (1.3.0)
264
+ thor (1.3.1)
237
265
  timeout (0.4.1)
238
- turbo-rails (1.5.0)
266
+ turbo-rails (2.0.5)
239
267
  actionpack (>= 6.0.0)
240
268
  activejob (>= 6.0.0)
241
269
  railties (>= 6.0.0)
242
270
  tzinfo (2.0.6)
243
271
  concurrent-ruby (~> 1.0)
272
+ unicode-display_width (2.5.0)
244
273
  web-console (4.2.1)
245
274
  actionview (>= 6.0.0)
246
275
  activemodel (>= 6.0.0)
@@ -251,7 +280,7 @@ GEM
251
280
  websocket-extensions (>= 0.1.0)
252
281
  websocket-extensions (0.1.5)
253
282
  zache (0.13.1)
254
- zeitwerk (2.6.12)
283
+ zeitwerk (2.6.13)
255
284
 
256
285
  PLATFORMS
257
286
  aarch64-linux
@@ -269,7 +298,9 @@ DEPENDENCIES
269
298
  jbuilder
270
299
  jsbundling-rails
271
300
  puma (>= 5.0)
272
- rails (~> 7.1.3)
301
+ rails (~> 7.1.3.2)
302
+ rdoc (>= 6.6.3.1)
303
+ rubocop-rails (= 2.24.1)
273
304
  sprockets-rails
274
305
  sqlite3 (~> 1.4)
275
306
  stimulus-rails
@@ -7,29 +7,29 @@ Add Descope's Ruby SDK to add authentication to a Rails 7 + React.js app. The pr
7
7
 
8
8
  1. Install dependencies:
9
9
 
10
- ```
11
- bundle install
12
- ```
13
-
14
- 3. Client Setup
15
-
16
- Create a ```.env``` file in the root directory of the `client` folder and add your Descope [Project ID](https://app.descope.com/settings/project) in the file:
10
+ ```
11
+ bundle install
12
+ ```
17
13
 
18
- ```
19
- REACT_APP_PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
20
- ```
14
+ 2. Client Setup
21
15
 
22
- > **NOTE**: If you're running your flask server on a different port than 3000, change the ```"proxy":"http://127.0.0.1:3000/"``` value to wherever your server is hosted. You can edit the proxy value in your client package.json file.
16
+ Create a ```.env``` file in the root directory of the `client` folder and add your Descope [Project ID](https://app.descope.com/settings/project) in the file:
17
+
18
+ ```toml
19
+ REACT_APP_PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
20
+ ```
23
21
 
24
- 4. Server Setup
22
+ > **NOTE**: If you're running your flask server on a different port than 3000, change the ```"proxy":"http://127.0.0.1:3000/"``` value to wherever your server is hosted. You can edit the proxy value in your client package.json file.
25
23
 
26
- Since this app also showcases roles, it will require you to set them up in the Descope Console.
24
+ 3. Server Setup
27
25
 
28
- - Create two different [roles]((https://app.descope.com/authorization)) called "teacher" and "student" <br>
29
- - Create a ```.env``` file in the server folder and add your project id in the file:
30
- ```
31
- PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
32
- ```
26
+ Since this app also showcases roles, it will require you to set them up in the Descope Console.
27
+
28
+ - Create two different [roles]((https://app.descope.com/authorization)) called "teacher" and "student" <br>
29
+ - Create a ```.env``` file in the server folder and add your project id in the file:
30
+ ```toml
31
+ PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
32
+ ```
33
33
 
34
34
  ## 🔮 Running the Application
35
35