3948 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
2ee0068d77 Bundle update 2021-05-05 18:20:38 -03:00
Carlos Antonio da Silva
57d1a1d381 Release v4.8.0 v4.8.0 2021-04-29 08:52:33 -03:00
Carlos Antonio da Silva
5d5636f03a Merge pull request #5369 from heartcombo/ca-lockable-reset-attempts
Create a model hook around the lockable warden hook to reset attempts
2021-04-02 15:52:43 -03:00
Carlos Antonio da Silva
a3ae35e9c9 Create a model hook around the lockable warden hook to reset attempts
Resetting failed attempts after sign in happened inside a warden hook
specific for the lockable module, but that was hidden inside the hook
implementation and didn't allow any user customization.

One such customization needed for example is to direct these updates to
a write DB when using a multi-DB setup. With the logic hidden in the
warden hook this wasn't possible, now that it's exposed in a model
method much like trackable, we can override the model method to wrap it
in a connection switch block for example, point to a write DB, and
simply call `super`.

Closes #5310
Related to #5264 and #5133
2021-04-02 15:45:25 -03:00
Carlos Antonio da Silva
e8e0c27599 Revert "Lock bundler to 2.2.9 instead of latest"
This reverts commit 1ba53dc369.

Let's give the latest bundler (2.2.15 as of today) a try again.
2021-03-30 21:53:57 -03:00
Carlos Antonio da Silva
429afcbe8a Bundle update 2021-03-30 21:53:56 -03:00
Carlos Antonio da Silva
ef9a2f4104 Use minitest helpers to check if objects respond to certain methods 2021-03-22 18:43:19 -03:00
Carlos Antonio da Silva
0cd72a56f9 Merge pull request #5347 from heartcombo/ca-build
Support Ruby 3+ officially, remove final Rails 6.1 deprecations, drop test dependency for XML serialization
2021-02-16 17:35:19 -03:00
Carlos Antonio da Silva
1ba53dc369 Lock bundler to 2.2.9 instead of latest
2.2.10 is causing the dependency resolution on Rails 6-0-stable to fail:

```
  Bundler could not find compatible versions for gem "railties":
    In Gemfile-rails-6-0:
      devise was resolved to 4.7.3, which depends on
        railties (>= 4.1.0)

      rails was resolved to 6.0.3.5, which depends on
        railties (= 6.0.3.5)

      responders (~> 3.0) was resolved to 3.0.1, which depends on
        railties (>= 5.0)
  Took  27.49 seconds
```

https://github.com/heartcombo/devise/runs/1905780158?check_suite_focus=true#step:5:23

The `railties` version 6.0.3.5 should work, given the other two are
using >= declarations, but it fails in 2.2.10.

Downgrading to 2.2.9 works.
2021-02-15 16:33:14 -03:00
Carlos Antonio da Silva
faef12cf2b Use the 6-0-stable version of Rails to fix issue with JSON responses
The test suite was failing on Rails 6.0 + Ruby 3 with errors like:

    Expected "{\"errors\":\"#<ActiveModel::Errors:0x000055f2e6cb8188>\"}"
    to include "{\"errors\":{".

The ActiveModel::Errors object wasn't being serialized to JSON as
expected, and this only happened with that combination of Ruby/Rails.

Upon further investigation, this was caused by a change in Ruby and
fixed in Rails in this PR: https://github.com/rails/rails/pull/39697
(which describes in more details the exact same problem and links to the
Ruby bug tracker with more information).

That fix was backported to 6-0-stable in June 2020, but hasn't been
officially released in a stable version yet: (there have been only
security fixes since then for 6.0)
75f6539d0e

Since the branch contains the fix, I'm pointing directly to it to get
the tests passing. We can't tell if there'll be a new stable 6.0 release
at this point, but hopefully yes, in which case we can go back at
pointing to it.
2021-02-15 16:33:03 -03:00
Carlos Antonio da Silva
c82a381f29 Bundle update 2021-02-15 14:45:04 -03:00
Carlos Antonio da Silva
a793472a3e Replace XML with JSON serialization across the test suite
This allows us to remove the dependency on the XML serializer provided
by the external `activemodel-serializers-xml` gem, and eliminates the
following deprecation warning:

    DEPRECATION WARNING: ActiveModel::Errors#to_xml is deprecated and
    will be removed in Rails 6.2.

Please note: this does not mean Devise doesn't support XML, it simply
means our test suite will use JSON to test non-navigatable formats
instead of XML, for simplicity. Devise's job is not to test object
serialization, so as long as your objects properly serialize to
XML/JSON/any other format, it should work out of the box.
2021-02-15 14:40:05 -03:00
Carlos Antonio da Silva
ad91686b62 Test on Ruby 3+ with Rails 6+
And remove dupe entry in the exclude matrix.

In order to get Ruby 3 working we needed to install `rexml` as part of
the test dependencies, only done on the main Gemfile (Rails 6.1) and the
6.0 versions. (which are the only ones supported by Ruby 3.)

Devise itself doesn't require `rexml` as it does nothing with it, but a
dependency we use during tests seem to require it. I was able to track
it down to omniauth-openid -> rack-openid -> ruby-openid requiring it:

    13a88ad644/lib/openid/yadis/xrds.rb (L1)

So while we have tests using omniauth-openid, we'll need this require in
place as well. Ideally that upstream version of ruby-openid should have
it, but it seems that one isn't updated in a while.
2021-02-15 14:34:36 -03:00
Carlos Antonio da Silva
1bb5fcbbec Merge pull request #5339 from ghiculescu/rails-deprecation
Fix deprecation warning on Rails 6.1

Related changes in Rails:
https://github.com/rails/rails/pull/38256
https://github.com/rails/rails/pull/38536
2021-02-02 21:27:31 -03:00
Alex Ghiculescu
80423c8f01 Fix deprecation warning on Rails 6.1 2021-02-02 15:37:45 -07:00
Carlos Antonio da Silva
743b6937e2 Merge pull request #5327 from heartcombo/ca-omniauth-2
Improve OmniAuth version check to allow anything from 1.0 forward
2021-02-01 17:30:37 -03:00
Carlos Antonio da Silva
e16d60d0fe Expand the release notes with more info about the OmniAuth v2 upgrade
I'm sure more people will hit issues so I'm trying to add more guidance
here about how to upgrade... maybe that should be in its own wiki but
I'll keep it all in the changelog for now.
2021-02-01 12:01:24 -03:00
Carlos Antonio da Silva
9d16f33c7b Revert "Explicitly set OmniAuth to 1.x in the Gemfiles for now"
This reverts commit 628f2fb2be.

We should be run green on OmniAuth 2.x now.
2021-02-01 11:51:23 -03:00
Carlos Antonio da Silva
c9a0f896cc Merge branch 'master' into ca-omniauth-2 2021-02-01 11:50:38 -03:00
Carlos Antonio da Silva
aa8d89579a Merge pull request #5338 from heartcombo/ca-build
Move build to GitHub Actions
2021-02-01 11:49:36 -03:00
Carlos Antonio da Silva
210c62af38 Add changelog about moving to GitHub Actions 2021-02-01 11:44:42 -03:00
Carlos Antonio da Silva
3048fe0960 Prevent Bundler 2.x. with Rails 4.x versions 2021-02-01 10:10:26 -03:00
Carlos Antonio da Silva
628f2fb2be Explicitly set OmniAuth to 1.x in the Gemfiles for now
The build is breaking with 2.x (which is expected), so this is a step to
get it to green on GA.
2021-01-31 10:19:06 -03:00
Carlos Antonio da Silva
13ba27497b Use the latest 2.x patch version for each Ruby, remove ruby-head
ruby-head was always in allowed failures with travis anyway, and we
never really paid much attention to it, so let's just remove it entirely
for now.
2021-01-31 10:08:57 -03:00
Carlos Antonio da Silva
7386f419e3 Use latest bundler on Gemfile.lock
Bundler 1.x uses git instead of https by default and we don't have that
github source setting in the Gemfile, but this should work.
2021-01-31 10:05:03 -03:00
Carlos Antonio da Silva
e07932c181 Rename gemfiles to keep consistency 2021-01-31 09:54:47 -03:00
Carlos Antonio da Silva
d0eafe70dc Remove the lock gemfiles from the previous versions
Keep only the lock for the main Gemfile to keep Devise consistent with
the other heartcombo libs.
2021-01-31 09:51:20 -03:00
Carlos Antonio da Silva
7e6da424e2 Move from Travis to GitHub Actions 2021-01-29 16:59:14 -03:00
AsbahIshaq
81bf3ad8c1 changed support to supports (#5334)
Co-authored-by: Asbah Ishaq <asbahishaq>
2021-01-24 08:51:09 -03:00
Carlos Antonio da Silva
51c05a5b21 Add changelog entry for OmniAuth 2 support
And a note/warning about how it might break apps that don't update their
integration accordingly as OmniAuth now expects.
2021-01-22 09:28:05 -03:00
Carlos Antonio da Silva
1d138dd40c Simplify OmniAuth version check by trying to load the gem with the necessary version 2021-01-22 09:16:58 -03:00
Carlos Antonio da Silva
c43ae8cb47 Merge branch 'master' into ca-omniauth-2 2021-01-19 15:22:57 -03:00
Carlos Antonio da Silva
cd60c747cc Update to latest released omniauth* gems
omniauth-openid v2.0.1 was just released opening support for omniauth
v2, so we can bundle update everything from the released gems now.
2021-01-19 15:21:26 -03:00
Jordan Owens
837baaf2e1 Update omniauthable tests for OmniAuth 2.0 (#5331) 2021-01-19 15:19:55 -03:00
Carlos Antonio da Silva
e0395367e4 Merge pull request #5333 from ghiculescu/patch-1
Fix Rails default log level in Readme
2021-01-18 21:53:46 -03:00
Carlos Antonio da Silva
fb17e2755f Move Rails 6.1 to the main Gemfile instead of an extra one
We have the gemfiles/* to test other versions of Rails, but keep the
most recent one in the main Gemfile.
2021-01-18 21:52:07 -03:00
Alex Ghiculescu
f4462cd85e Fix Rails default log level
This changed in 229fd2a02f - the advice about changing your log level still stands though.
2021-01-18 16:51:23 -06:00
Carlos Antonio da Silva
8bb358cf80 Improve OmniAuth version check to allow anything from 1.0 forward
This should enable people to try OmniAuth 2 currently in pre-release.
2021-01-07 09:21:15 -03:00
Ryunosuke Sato
98fc5e8e39 Test on rails 6.1 (#5323)
* Make test for validation to be Rails 6.1 compatible

The `ActiveModel::Errors` has been changed in Rails 6.1.
https://github.com/rails/rails/pull/32313

* Add gemfile for Rails 6.1

* Add CI matrix for Rails 6.1
2021-01-04 20:17:58 -03:00
Carlos Antonio da Silva
dfbed22cee Merge pull request #5315 from bipashant/master
Add missing period to devise.registrations.updated_but_not_signed_in
2020-11-23 08:10:22 -03:00
Bibek Sharma Chapagain
fd03f9e353 Added missing full stop "." on registrations.updated_but_not_signed_in. 2020-11-23 12:21:22 +11:00
Carlos Antonio da Silva
a19e78cdb4 Merge pull request #5306 from janz93/cleanup
Add to-do to cleanup rack/rails session bug fix when supporting Rails 5.2+ only
2020-11-22 21:42:48 -03:00
Jan Zaydowicz
b88af5d65e chore: add expiry note for old rack/rails session bug fix
Seven year ago rails `session.keys` could be empty if the session was
not loaded yet.

To prevent an error the removed code was introduced
https://github.com/heartcombo/devise/issues/2660

Since then rails changed the behaviour and makes sure that the session
is loaded before someone wants to access any session keys
3498aacbbe

Which means the `session.empty?` is not needed anymore once Rails 5.2+
and upwards only supported.
2020-11-22 12:33:30 +01:00
Carlos Antonio da Silva
45b831c4ea Release 4.7.3 2020-09-20 21:24:01 -03:00
Carlos Antonio da Silva
f12be553cc Update changelog [ci skip] 2020-09-20 10:45:10 -03:00
Carlos Antonio da Silva
4896a9b41a Update bundle 2020-09-20 10:43:42 -03:00
mune
eed641d2be Add spaces around method arguments when setting default values
Closes #5288
2020-08-31 18:15:45 -03:00
Carlos Antonio da Silva
97aa37bb50 Use assert_empty minitest helper 2020-08-27 18:40:03 -03:00
Carlos Antonio da Silva
15135f7dc6 User assert_includes/refute_includes minitest helpers 2020-08-27 18:38:26 -03:00
Carlos Antonio da Silva
e39b9b9134 Fix order of arguments for assert_equal on tests
Use `assert_equal expected, actual` for proper error messages in case of
failures.
2020-08-27 18:24:17 -03:00