standard_id 0.18.0 → 0.19.0

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: e940f3a408f896e103acb15090e6dbbe52500265942d2160ee5973b2b2ee6754
4
- data.tar.gz: 5fba33203f9c224003a98df57939ba6aee1d82db5329b6d476a6dd0b22c2c6a2
3
+ metadata.gz: 3d3af31455bcc5b445cb7398d0d4bc2d4fac8ee7e246bcdc437796419af80284
4
+ data.tar.gz: 167ef5777acbc1de9bf7ecbb9d9e30f95597094566b6268f48c56d1d462c8d37
5
5
  SHA512:
6
- metadata.gz: f6ff1ad388785ef7f39f0b762c9dc9698dbe2466f62ec7c6383c91351dfb364bd3f63cdd690047e977b5ffc82bcf2ca049cde0e22c6ac774dba6fab0d5ef22c5
7
- data.tar.gz: d57fe7efc78a2daed02cd7912b346ab8f631d71c8446f1421909fab440d4b86a2c96e60d866cefa51fb6602de69ae7a952065f24261d1e317e7ca823ee316883
6
+ metadata.gz: 68bf2f44b3791c46a08500da1c2c91e0878c4b7b009a810fc761d450aeffdc5c007bf2ecef3e2b1a1193ad09313aac528489925215ec7cb23bdbbdef8df4d3c3
7
+ data.tar.gz: d5116af139011d0cc8d5955489f751bf3dc8592e5e5474b55ce62178add8d828041e952f272a79a52adf7e20238dac02cadd22a8faa28b49277d789320b5897f
@@ -8,6 +8,16 @@ module StandardId
8
8
 
9
9
  skip_before_action :validate_content_type!
10
10
 
11
+ # OAuth-flow params consumed by this controller and the SocialFlow.
12
+ # Everything else is forwarded to SOCIAL_AUTH_COMPLETED subscribers as
13
+ # `original_request_params` so host apps can attach attribution
14
+ # (UTM, campaign IDs, deep-link slugs) to the signing-in account.
15
+ RESERVED_CALLBACK_PARAMS = %w[
16
+ id_token code scope scopes audience redirect_uri flow
17
+ state nonce provider controller action format
18
+ authenticity_token utf8 _method
19
+ ].freeze
20
+
11
21
  def callback
12
22
  provider_response = get_user_info_from_provider(flow: resolve_flow_for(provider.provider_name))
13
23
  social_info = provider_response[:user_info]
@@ -28,6 +38,7 @@ module StandardId
28
38
  social_info:,
29
39
  provider_tokens:,
30
40
  account:,
41
+ original_request_params: forwarded_request_params
31
42
  )
32
43
  render json: token_response, status: :ok
33
44
  end
@@ -40,6 +51,12 @@ module StandardId
40
51
  flow_param = params[:flow].to_s.downcase
41
52
  flow_param == "web" ? :web : :mobile
42
53
  end
54
+
55
+ # The `except` list is the trust boundary — non-reserved values are
56
+ # host-supplied opaque attribution data, never interpreted by the gem.
57
+ def forwarded_request_params
58
+ params.to_unsafe_h.stringify_keys.except(*RESERVED_CALLBACK_PARAMS)
59
+ end
43
60
  end
44
61
  end
45
62
  end
@@ -1,3 +1,3 @@
1
1
  module StandardId
2
- VERSION = "0.18.0"
2
+ VERSION = "0.19.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryl Sim