omniauth 2.4.0 → 2.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bddaf279c8ba5ce1bca9cb80c8c5cd73b541b7dcda1c2adfde1767077b9233f4
4
- data.tar.gz: bb344106bc102d803528d8070d046f2230f18a4d1deb000aff8f83459ffe3cd0
3
+ metadata.gz: b7036401ab6a24195d5ff7d7ac8f114afcb314cd0b3685d6fbfddcd424e4b077
4
+ data.tar.gz: 50e616b975bee533a46b2a4a81ec15cb83dbfc72cc8d3e3f2dfb9bf48301c95a
5
5
  SHA512:
6
- metadata.gz: 1630c220c39715558036324880226c351541be17bfaa86b772a3ad9e5c2d3e2049d971b158a25738dc228c6da614506dee69eecdd30391fddd61e9b431502f5f
7
- data.tar.gz: 701902a0b78c8b62dea137fe0fafa811800a16f2cf8e29499e3ff7dc53a72165c4d779ff4098c312ca3382646742b8ff49c3098fb1b04c6bd9624083d1b69f50
6
+ metadata.gz: 7f391a82e4ca6ae19f91ee32f14421d9ac55a84d0f524561c52d52045ab162b64b8e6454745a5881b68fff7db6324e20abaa7cac498f28d94b512dc8762d0fbe
7
+ data.tar.gz: e00fd21d830f23003aad6e804dab073340a9fdc9ad8ded15880e3057ab73c0db3fa5a00b549f7c0e0b282c0b393112d4fe01f11ffb20e7b59de6fc426fc1a66a
data/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  [coveralls]: https://coveralls.io/r/omniauth/omniauth
17
17
 
18
18
  This is the documentation for the in-development branch of OmniAuth.
19
- You can find the documentation for the latest stable release [here](https://github.com/omniauth/omniauth/tree/v2.4.0)
19
+ You can find the documentation for the latest stable release [here](https://github.com/omniauth/omniauth/tree/v2.4.1)
20
20
 
21
21
  ## An Introduction
22
22
  OmniAuth is a library that standardizes multi-provider authentication for
@@ -381,9 +381,10 @@ end
381
381
 
382
382
  OmniAuth then stores the origin and params of the latest 3 sign-ins under
383
383
  their keys in `session['omniauth.sign_ins']`, and gives each callback its
384
- own. It still sets `omniauth.origin` and `omniauth.params` in the session
385
- for the latest sign-in, and falls back to them when a callback's key isn't
386
- remembered.
384
+ own. The origin moves from `omniauth.origin` into the sign-in, so an
385
+ abandoned sign-in's origin never reaches the next one. `omniauth.params`
386
+ still holds the latest sign-in's params, and a callback whose key isn't
387
+ remembered gets those, and no origin.
387
388
 
388
389
  The session is often a 4 KB cookie, so each sign-in stores only what it
389
390
  needs: no origin when there isn't one, no params when they're empty, and
@@ -25,6 +25,11 @@ module OmniAuth
25
25
  # size, and a few large ones would overflow a cookie session.
26
26
  MAX_REMEMBERED_PARAMS_BYTESIZE = 512
27
27
 
28
+ # The session key of the request phase's origin, frozen so moving it
29
+ # doesn't make a new string in every request phase: unlike
30
+ # session[...], delete has no fast path for a string literal.
31
+ ORIGIN_KEY = 'omniauth.origin'.freeze
32
+
28
33
  # Remembers the current request phase's sign-in under key, which the
29
34
  # provider sends back to the callback: the strategy's own data, plus
30
35
  # the origin and params OmniAuth stored, under "origin" and "params",
@@ -82,8 +87,13 @@ module OmniAuth
82
87
  # Adds the origin and params stored for the current request phase to
83
88
  # sign_in, leaving out an empty origin, empty params, and params too
84
89
  # large to keep.
90
+ #
91
+ # The origin moves out of omniauth.origin into the sign-in. Otherwise,
92
+ # if this sign-in were abandoned, the next one would get its origin
93
+ # whenever it has no origin param or referer of its own. So a second
94
+ # sign-in remembered in the same request phase gets no origin.
85
95
  def add_origin_and_params(sign_in)
86
- origin = session['omniauth.origin']
96
+ origin = session.delete(ORIGIN_KEY)
87
97
  params = session['omniauth.params']
88
98
  sign_in['origin'] = origin unless origin.nil? || origin.empty?
89
99
  sign_in['params'] = params if params && !params.empty? && params_small_enough?(params)
@@ -1,3 +1,3 @@
1
1
  module OmniAuth
2
- VERSION = '2.4.0'.freeze
2
+ VERSION = '2.4.1'.freeze
3
3
  end
data/sig/omniauth.rbs CHANGED
@@ -465,6 +465,8 @@ module OmniAuth
465
465
 
466
466
  MAX_REMEMBERED_PARAMS_BYTESIZE: Integer
467
467
 
468
+ ORIGIN_KEY: String
469
+
468
470
  # Remembers the current request phase's sign-in under key, which the
469
471
  # provider sends back to the callback: the strategy's own data, plus
470
472
  # the origin and params under "origin" and "params".
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Berlin