omniauth-identity 3.0.8 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +45 -35
- data/lib/omniauth-identity/version.rb +1 -1
- data/lib/omniauth/identity/models/active_record.rb +3 -0
- data/lib/omniauth/identity/models/couch_potato.rb +3 -1
- data/lib/omniauth/identity/models/mongoid.rb +2 -0
- data/lib/omniauth/identity/models/nobrainer.rb +2 -1
- data/lib/omniauth/identity/models/sequel.rb +4 -4
- data/spec/omniauth/identity/models/active_record_spec.rb +1 -0
- data/spec/omniauth/identity/models/sequel_spec.rb +1 -0
- data/spec/omniauth/strategies/identity_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eaf9c4edfdb4716551abeeb233e63716d4bbb6a2c90d921129d05e06434c3ed
|
4
|
+
data.tar.gz: ccb786b04aa010387b3d4d7ae369038a3760d52a1b9a7077e76e3051d364ca1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdbb4c0951fca595a37d1efc13491c6eaba328d77cae2184624260b9bb643c6483a0d167296a36ab168d0dd2afafbc8a3be9df1dfeb6ba9fc7cd83556c02b1c3
|
7
|
+
data.tar.gz: 9d8385b53f5e46ed414f59c6a9acbcb62734b94df6b86224e0fa401da349cd44c1af57ff54d0ec01c100d2ccd8e003ea1c062eb1a7d772b404d82c0c2eda579b
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
8
8
|
|
9
9
|
## [Unreleased]
|
10
10
|
|
11
|
+
## [3.0.9] - 2021-06-16
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- \[Sequel\] Fixes loading the Sequel adapter, issue reported as [#112](https://github.com/omniauth/omniauth-identity/issues/112)
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- 📝 Document the Database adapters and drivers the gem currently works with
|
20
|
+
|
11
21
|
## [3.0.8] - 2021-03-24
|
12
22
|
|
13
23
|
### Fixed
|
data/README.md
CHANGED
@@ -21,6 +21,15 @@ This gem is compatible with, as of Feb 2021, version 3:
|
|
21
21
|
|
22
22
|
* Latest released version of omniauth, v2.0.2
|
23
23
|
* Ruby 2.4, 2.5, 2.6, 2.7, 3.0, ruby-head
|
24
|
+
* At least 5 different database ORM adapters, which connect to 15 different database clients!
|
25
|
+
|
26
|
+
| Databases | Adapter Libraries |
|
27
|
+
|--------- | -------- |
|
28
|
+
| MySQL, PostgreSQL, SQLite3 | [ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html) |
|
29
|
+
| CouchDB | [CouchPotato](https://github.com/langalex/couch_potato) |
|
30
|
+
| MongoDB | [Mongoid](https://github.com/mongodb/mongoid) |
|
31
|
+
| RethinkDB | [NoBrainer](http://nobrainer.io/) |
|
32
|
+
| ADO, Amalgalite, IBM_DB, JDBC, MySQL, Mysql2, ODBC, Oracle, PostgreSQL, SQLAnywhere, SQLite3, and TinyTDS | [Sequel](http://sequel.jeremyevans.net) |
|
24
33
|
|
25
34
|
## Installation
|
26
35
|
|
@@ -171,7 +180,7 @@ end
|
|
171
180
|
```
|
172
181
|
|
173
182
|
NOTE: In the above example, `MyCustomClass` must have a class method called `auth_key` that returns
|
174
|
-
|
183
|
+
the default (`email`) or custom `auth_key` to use.
|
175
184
|
|
176
185
|
## Customizing Registration Failure
|
177
186
|
|
@@ -273,40 +282,41 @@ Please contribute some documentation if you have the gumption! The maintainer's
|
|
273
282
|
3. Commit your changes (`git commit -am ‘Added some feature’`)
|
274
283
|
4. Push to the branch (`git push origin my-new-feature`)
|
275
284
|
5. Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
285
|
+
- NOTE: In order to run *all* the tests you will need to have the following databases installed, configured, and running.
|
286
|
+
1. [RethinkDB](https://rethinkdb.com), an open source, real-time, web database, [installed](https://rethinkdb.com/docs/install/) and [running](https://rethinkdb.com/docs/start-a-server/), e.g.
|
287
|
+
```bash
|
288
|
+
brew install rethinkdb
|
289
|
+
rethinkdb
|
290
|
+
```
|
291
|
+
2. [MongoDB](https://docs.mongodb.com/manual/administration/install-community/)
|
292
|
+
```bash
|
293
|
+
brew tap mongodb/brew
|
294
|
+
brew install mongodb-community@4.4
|
295
|
+
mongod --config /usr/local/etc/mongod.conf
|
296
|
+
```
|
297
|
+
3. [CouchDB](https://couchdb.apache.org) (download the .app)
|
298
|
+
|
299
|
+
To run all tests on all databases:
|
300
|
+
```bash
|
301
|
+
bundle exec rake
|
302
|
+
```
|
303
|
+
To run a specific DB:
|
304
|
+
```bash
|
305
|
+
# CouchDB / CouchPotato
|
306
|
+
bundle exec rspec spec spec_orms --tag 'couchdb'
|
307
|
+
|
308
|
+
# ActiveRecord and Sequel, as they both use the in-memory SQLite driver.
|
309
|
+
bundle exec rspec spec spec_orms --tag 'sqlite3'
|
310
|
+
|
311
|
+
# NOTE - mongoid and nobrainer specs can't be isolated with "tag" because it still loads everything,
|
312
|
+
# and the two libraries are fundamentally incompatible.
|
313
|
+
|
314
|
+
# MongoDB / Mongoid
|
315
|
+
bundle exec rspec spec_orms/mongoid_spec.rb
|
316
|
+
|
317
|
+
# RethinkDB / NoBrainer
|
318
|
+
bundle exec rspec spec_orms/nobrainer_spec.rb
|
319
|
+
```
|
310
320
|
6. Create new Pull Request
|
311
321
|
|
312
322
|
## License
|
@@ -5,6 +5,9 @@ require 'active_record'
|
|
5
5
|
module OmniAuth
|
6
6
|
module Identity
|
7
7
|
module Models
|
8
|
+
# ActiveRecord is an ORM for MySQL, PostgreSQL, and SQLite3:
|
9
|
+
# https://guides.rubyonrails.org/active_record_basics.html
|
10
|
+
# NOTE: ActiveRecord is based on ActiveModel.
|
8
11
|
class ActiveRecord < ::ActiveRecord::Base
|
9
12
|
include ::OmniAuth::Identity::Model
|
10
13
|
include ::OmniAuth::Identity::SecurePassword
|
@@ -5,9 +5,11 @@ require 'couch_potato'
|
|
5
5
|
module OmniAuth
|
6
6
|
module Identity
|
7
7
|
module Models
|
8
|
-
#
|
8
|
+
# CouchPotato is an ORM adapter for CouchDB:
|
9
|
+
# https://github.com/langalex/couch_potato
|
9
10
|
# NOTE: CouchPotato is based on ActiveModel.
|
10
11
|
# NOTE: CouchPotato::Persistence must be included before OmniAuth::Identity::Models::CouchPotatoModule
|
12
|
+
# NOTE: Includes "Module" in the name for invalid legacy reasons. Rename only with a major version bump.
|
11
13
|
module CouchPotatoModule
|
12
14
|
def self.included(base)
|
13
15
|
base.class_eval do
|
@@ -5,7 +5,8 @@ require 'nobrainer'
|
|
5
5
|
module OmniAuth
|
6
6
|
module Identity
|
7
7
|
module Models
|
8
|
-
#
|
8
|
+
# NoBrainer is an ORM adapter for RethinkDB:
|
9
|
+
# http://nobrainer.io/
|
9
10
|
# NOTE: NoBrainer is based on ActiveModel.
|
10
11
|
module NoBrainer
|
11
12
|
def self.included(base)
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'sequel'
|
4
4
|
|
5
5
|
module OmniAuth
|
6
6
|
module Identity
|
7
7
|
module Models
|
8
|
-
#
|
8
|
+
# Sequel is an ORM adapter for the following databases:
|
9
|
+
# ADO, Amalgalite, IBM_DB, JDBC, MySQL, Mysql2, ODBC, Oracle, PostgreSQL, SQLAnywhere, SQLite3, and TinyTDS
|
10
|
+
# The homepage is: http://sequel.jeremyevans.net/
|
9
11
|
# NOTE: Sequel is *not* based on ActiveModel, but supports the API we need, except for `persisted?`:
|
10
12
|
# * create
|
11
13
|
# * save
|
@@ -22,8 +24,6 @@ module OmniAuth
|
|
22
24
|
|
23
25
|
has_secure_password
|
24
26
|
|
25
|
-
alias_method :persisted?, :valid?
|
26
|
-
|
27
27
|
def self.auth_key=(key)
|
28
28
|
super
|
29
29
|
validates_uniqueness_of :key, case_sensitive: false
|
@@ -14,6 +14,7 @@ RSpec.describe(OmniAuth::Identity::Models::ActiveRecord, sqlite3: true) do
|
|
14
14
|
columns: OmniAuth::Identity::Model::SCHEMA_ATTRIBUTES | %w[provider password_digest],
|
15
15
|
connection_params: { adapter: 'sqlite3', encoding: 'utf8', database: ':memory:' }
|
16
16
|
) do
|
17
|
+
auth_key :email
|
17
18
|
def flower
|
18
19
|
'🌸'
|
19
20
|
end
|
@@ -18,6 +18,7 @@ RSpec.describe(OmniAuth::Identity::Models::Sequel, sqlite3: true) do
|
|
18
18
|
before do
|
19
19
|
sequel_test_identity = Class.new(Sequel::Model(:sequel_test_identities)) do
|
20
20
|
include ::OmniAuth::Identity::Models::Sequel
|
21
|
+
auth_key :email
|
21
22
|
end
|
22
23
|
stub_const('SequelTestIdentity', sequel_test_identity)
|
23
24
|
end
|
@@ -17,6 +17,7 @@ RSpec.describe OmniAuth::Strategies::Identity, sqlite3: true do
|
|
17
17
|
columns: OmniAuth::Identity::Model::SCHEMA_ATTRIBUTES | %w[provider password_digest],
|
18
18
|
connection_params: { adapter: 'sqlite3', encoding: 'utf8', database: ':memory:' }
|
19
19
|
) do
|
20
|
+
auth_key :email
|
20
21
|
def balloon
|
21
22
|
'🎈'
|
22
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-identity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bcrypt
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: 1.3.6
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.2.
|
163
|
+
rubygems_version: 3.2.17
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Traditional username/password based authentication system for OmniAuth
|