rodauth 2.15.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/README.rdoc +21 -0
- data/doc/release_notes/2.16.0.txt +20 -0
- data/lib/rodauth/features/internal_request.rb +4 -0
- data/lib/rodauth/version.rb +1 -1
- data/lib/rodauth.rb +11 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03b165b6104e72c5c2ea6d76b3b0bf53380d4eacd90cbdab80b9fd655d80f1c4
|
4
|
+
data.tar.gz: af12c12c4bdf9aa47ffd0a34bd7df2858c006edcafa257e60ddd28c962d62630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11f3050e692d426c409a061c4f23489208618613868653a59fad982fd66b62ec4c9fe5b320b390f3789b5fc3d704d2d3ac99d9105bc54f9ee33dcfaa690dfd2
|
7
|
+
data.tar.gz: 811fb60b3f055d59866cf3b262ab197e8cf80a1ca7291724e756c58a99f1cdaddf994a73a500cdcff03f600fd1333e49cf3d1830cc9f10d01af641648c9fd930
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 2.16.0 (2021-08-23)
|
2
|
+
|
3
|
+
* Add Rodauth.lib for using Rodauth as a library (jeremyevans)
|
4
|
+
|
5
|
+
* Make internal_request feature work if the configuration uses only_json? true (janko) (#176)
|
6
|
+
|
1
7
|
=== 2.15.0 (2021-07-27)
|
2
8
|
|
3
9
|
* Add path_class_methods feature, for getting paths/URLs using class methods (jeremyevans)
|
data/README.rdoc
CHANGED
@@ -1073,6 +1073,27 @@ methods on that class to perform actions on behalf of a user. See the
|
|
1073
1073
|
{internal request feature documentation}[rdoc-ref:doc/internal_request.rdoc]
|
1074
1074
|
for details.
|
1075
1075
|
|
1076
|
+
== Using Rodauth as a Library
|
1077
|
+
|
1078
|
+
Rodauth was designed to serve as an authentication framework for Rack applications.
|
1079
|
+
However, Rodauth can be used purely as a library outside of a web application. You
|
1080
|
+
can do this by requiring +rodauth+, and using the +Rodauth.lib+ method to return
|
1081
|
+
a <tt>Rodauth::Auth</tt> subclass, which you can call methods on. You pass the
|
1082
|
+
+Rodauth.lib+ method an optional hash of Rodauth plugin options and a Rodauth
|
1083
|
+
configuration block:
|
1084
|
+
|
1085
|
+
require 'rodauth'
|
1086
|
+
rodauth = Rodauth.lib do
|
1087
|
+
enable :create_account, :change_password
|
1088
|
+
end
|
1089
|
+
rodauth.create_account(login: 'foo@example.com', password: '...')
|
1090
|
+
rodauth.change_password(account_id: 24601, password: '...')
|
1091
|
+
|
1092
|
+
This supports builds on top of the internal_request support (it implicitly loads
|
1093
|
+
the internal_request feature before processing the configuration block), and
|
1094
|
+
allows the use of Rodauth in non-web applications. Note that you still have to
|
1095
|
+
setup a Sequel::Database connection for Rodauth to use for data storage.
|
1096
|
+
|
1076
1097
|
=== With Multiple Configurations
|
1077
1098
|
|
1078
1099
|
Rodauth supports using multiple rodauth configurations in the same
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= New Features
|
2
|
+
|
3
|
+
* Rodauth.lib has been added for using Rodauth purely as a library,
|
4
|
+
useful in non-web applications:
|
5
|
+
|
6
|
+
require 'rodauth'
|
7
|
+
rodauth = Rodauth.lib do
|
8
|
+
enable :create_account, :change_password
|
9
|
+
end
|
10
|
+
rodauth.create_account(login: 'foo@example.com', password: '...')
|
11
|
+
rodauth.change_password(account_id: 24601, password: '...')
|
12
|
+
|
13
|
+
This is built on top of the internal_request feature, and works by
|
14
|
+
creating a Roda application with the rodauth plugin, and returning
|
15
|
+
the related Rodauth::Auth class.
|
16
|
+
|
17
|
+
= Other Improvements
|
18
|
+
|
19
|
+
* The internal_request feature now works correctly for configurations
|
20
|
+
where only_json? is set to true.
|
data/lib/rodauth/version.rb
CHANGED
data/lib/rodauth.rb
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
5
|
module Rodauth
|
6
|
+
def self.lib(opts={}, &block)
|
7
|
+
require 'roda'
|
8
|
+
c = Class.new(Roda)
|
9
|
+
c.plugin(:rodauth, opts) do
|
10
|
+
enable :internal_request
|
11
|
+
instance_exec(&block)
|
12
|
+
end
|
13
|
+
c.freeze
|
14
|
+
c.rodauth
|
15
|
+
end
|
16
|
+
|
6
17
|
def self.load_dependencies(app, opts={})
|
7
18
|
json_opt = opts.fetch(:json, app.opts[:rodauth_json])
|
8
19
|
if json_opt
|
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.
|
4
|
+
version: 2.16.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: 2021-
|
11
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -329,6 +329,7 @@ extra_rdoc_files:
|
|
329
329
|
- doc/release_notes/2.13.0.txt
|
330
330
|
- doc/release_notes/2.14.0.txt
|
331
331
|
- doc/release_notes/2.15.0.txt
|
332
|
+
- doc/release_notes/2.16.0.txt
|
332
333
|
- doc/release_notes/2.2.0.txt
|
333
334
|
- doc/release_notes/2.3.0.txt
|
334
335
|
- doc/release_notes/2.4.0.txt
|
@@ -429,6 +430,7 @@ files:
|
|
429
430
|
- doc/release_notes/2.13.0.txt
|
430
431
|
- doc/release_notes/2.14.0.txt
|
431
432
|
- doc/release_notes/2.15.0.txt
|
433
|
+
- doc/release_notes/2.16.0.txt
|
432
434
|
- doc/release_notes/2.2.0.txt
|
433
435
|
- doc/release_notes/2.3.0.txt
|
434
436
|
- doc/release_notes/2.4.0.txt
|