rodauth 2.24.0 → 2.25.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: 3db9ca9b25c4acd3e2b16cfca4a9efbc95758242e5030cbb33502440df4dbc15
4
- data.tar.gz: e77ffff24d840adc1a17d162e58f76f99b363f063c070229315f45766d71a96a
3
+ metadata.gz: 934d5c19d29c583ebc73a057ba96a1c321741a64c965b22f4a243a42f56eab81
4
+ data.tar.gz: 6398ec3d3bc1ee36a2195909b545ba5df9f0282c5a5b9136babb3538f21cb98e
5
5
  SHA512:
6
- metadata.gz: 46064d3008752765daec092f037dc3d3b2b85a6f2a9c9a9b6fe1b4abec1cc9764d7c157adc736844ccbdde68f78a7b303225da5fe6caa895f650a9102b2cf271
7
- data.tar.gz: fadc40b635e868e0b59f61faa566447f294e4fc174b0620e06bac1766c4fb6c1ce0944548d413443bc699c128b7c59d9f5c6dc7175fb46c2f9c3d1404e698c8e
6
+ metadata.gz: 32bae60cf66d97326397f3429d74ac2e7093afae74c59191bba5013ad6c7ec46782ddfa54c0a28b9a68c38cbf52b7e5071cd9d4eb7e434e5632c70842658120c
7
+ data.tar.gz: b157ffa28b3f539c7618d747ab8cee321de6fbfdac11c603176b325ce54d10294a9b8860715a27c08e7d6128928e78d51e8f776b0201fcadec99075354c32f51
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 2.25.0 (2022-06-22)
2
+
3
+ * Support disabling routes by passing nil/false to *_route methods (janko) (#245)
4
+
1
5
  === 2.24.0 (2022-05-24)
2
6
 
3
7
  * Work around implicit null byte check added in bcrypt 3.1.18 by checking password requirements before other password checks (jeremyevans)
@@ -37,3 +37,15 @@ setting:
37
37
 
38
38
  # ...
39
39
  end
40
+
41
+ There are cases where you may want to disable certain routes. For example, you
42
+ may want to enable the create_account feature to allow creating admins, but
43
+ only make it possible programmatically via internal requests. In this case,
44
+ you should set the corresponding <tt>*_route</tt> method to +nil+:
45
+
46
+ plugin :rodauth, name: :admin do
47
+ enable :create_account
48
+
49
+ # disable the /create-account route
50
+ create_account_route nil
51
+ end
@@ -0,0 +1,8 @@
1
+ = New Features
2
+
3
+ * You can now disable routing to specific routes by calling the
4
+ related *_route configuration method with nil or false. The main
5
+ reason you would want to do this is if you want to load a feature,
6
+ but only want to use it for internal requests (using the
7
+ internal_request feature), and not have the feature's routes exposed
8
+ to users.
@@ -402,7 +402,10 @@ module Rodauth
402
402
  db.extension :date_arithmetic if use_date_arithmetic?
403
403
  route_hash= {}
404
404
  self.class.routes.each do |meth|
405
- route_hash["/#{send("#{meth.to_s.sub(/\Ahandle_/, '')}_route")}"] = meth
405
+ route_meth = "#{meth.to_s.sub(/\Ahandle_/, '')}_route"
406
+ if route = send(route_meth)
407
+ route_hash["/#{route}"] = meth
408
+ end
406
409
  end
407
410
  self.class.route_hash = route_hash.freeze
408
411
  end
@@ -6,7 +6,7 @@ module Rodauth
6
6
  MAJOR = 2
7
7
 
8
8
  # The minor version of Rodauth, updated for new feature releases of Rodauth.
9
- MINOR = 24
9
+ MINOR = 25
10
10
 
11
11
  # The patch version of Rodauth, updated only for bug fixes from the last
12
12
  # feature release.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.24.0
4
+ version: 2.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -340,6 +340,7 @@ extra_rdoc_files:
340
340
  - doc/release_notes/2.22.0.txt
341
341
  - doc/release_notes/2.23.0.txt
342
342
  - doc/release_notes/2.24.0.txt
343
+ - doc/release_notes/2.25.0.txt
343
344
  - doc/release_notes/2.3.0.txt
344
345
  - doc/release_notes/2.4.0.txt
345
346
  - doc/release_notes/2.5.0.txt
@@ -451,6 +452,7 @@ files:
451
452
  - doc/release_notes/2.22.0.txt
452
453
  - doc/release_notes/2.23.0.txt
453
454
  - doc/release_notes/2.24.0.txt
455
+ - doc/release_notes/2.25.0.txt
454
456
  - doc/release_notes/2.3.0.txt
455
457
  - doc/release_notes/2.4.0.txt
456
458
  - doc/release_notes/2.5.0.txt