standard_id 0.4.0 → 0.5.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 +4 -4
- data/app/controllers/standard_id/api/base_controller.rb +1 -0
- data/app/controllers/standard_id/web/base_controller.rb +1 -0
- data/app/models/standard_id/authorization_code.rb +2 -1
- data/lib/standard_id/current_attributes.rb +1 -1
- data/lib/standard_id/events.rb +1 -0
- data/lib/standard_id/oauth/authorization_code_authorization_flow.rb +3 -2
- data/lib/standard_id/oauth/authorization_code_flow.rb +4 -0
- data/lib/standard_id/oauth/subflows/social_login_grant.rb +2 -1
- data/lib/standard_id/oauth/subflows/traditional_code_grant.rb +1 -0
- data/lib/standard_id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 956fc621df693ec184f7d65482d96c4f25d99ae55274b68681c9c6b892bde095
|
|
4
|
+
data.tar.gz: 0d5c39a196c8c9e8c99adb24fa61552698672f3df4a5bcf3d06d03b2b61e6a46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 584c37aa6aa46abe4a576297d6d754e5632c4b710c59dd1bd2b6f8d7c5c17ac86a8aef109df15fe3de720a7d1be405af31441f833a914b3bc8bfea264b296da5
|
|
7
|
+
data.tar.gz: 1733a94c80aba6290cc5eabbe7df67f4ff145c5af18e8cb9202cd3d598b5e5569039fc729cdfed3eacfee55908fe36bf4801e706da7c0e8b544666383b7b6863
|
|
@@ -16,7 +16,7 @@ module StandardId
|
|
|
16
16
|
|
|
17
17
|
before_validation :set_issued_and_expiry, on: :create
|
|
18
18
|
|
|
19
|
-
def self.issue!(plaintext_code:, client_id:, redirect_uri:, scope: nil, audience: nil, account: nil, code_challenge: nil, code_challenge_method: nil, metadata: {})
|
|
19
|
+
def self.issue!(plaintext_code:, client_id:, redirect_uri:, scope: nil, audience: nil, account: nil, code_challenge: nil, code_challenge_method: nil, nonce: nil, metadata: {})
|
|
20
20
|
create!(
|
|
21
21
|
account: account,
|
|
22
22
|
code_hash: hash_for(plaintext_code),
|
|
@@ -26,6 +26,7 @@ module StandardId
|
|
|
26
26
|
audience: audience,
|
|
27
27
|
code_challenge: code_challenge,
|
|
28
28
|
code_challenge_method: code_challenge_method,
|
|
29
|
+
nonce: nonce,
|
|
29
30
|
issued_at: Time.current,
|
|
30
31
|
expires_at: Time.current + default_ttl,
|
|
31
32
|
metadata: metadata || {}
|
data/lib/standard_id/events.rb
CHANGED
|
@@ -129,6 +129,7 @@ module StandardId
|
|
|
129
129
|
enriched[:ip_address] ||= ::Current.ip_address if ::Current.respond_to?(:ip_address) && ::Current.ip_address.present?
|
|
130
130
|
enriched[:user_agent] ||= ::Current.user_agent if ::Current.respond_to?(:user_agent) && ::Current.user_agent.present?
|
|
131
131
|
enriched[:current_account] ||= ::Current.account if ::Current.respond_to?(:account) && ::Current.account.present?
|
|
132
|
+
enriched[:scope] ||= ::Current.scope if ::Current.respond_to?(:scope) && ::Current.scope.present?
|
|
132
133
|
end
|
|
133
134
|
|
|
134
135
|
enriched.merge(payload)
|
|
@@ -2,7 +2,7 @@ module StandardId
|
|
|
2
2
|
module Oauth
|
|
3
3
|
class AuthorizationCodeAuthorizationFlow < AuthorizationFlow
|
|
4
4
|
expect_params :client_id, :audience
|
|
5
|
-
permit_params :scope, :redirect_uri, :state, :connection, :prompt, :organization, :invitation, :code_challenge, :code_challenge_method
|
|
5
|
+
permit_params :scope, :redirect_uri, :state, :connection, :prompt, :organization, :invitation, :code_challenge, :code_challenge_method, :nonce
|
|
6
6
|
|
|
7
7
|
private
|
|
8
8
|
|
|
@@ -39,7 +39,8 @@ module StandardId
|
|
|
39
39
|
audience: audience,
|
|
40
40
|
state: state,
|
|
41
41
|
code_challenge: flow_params[:code_challenge],
|
|
42
|
-
code_challenge_method: flow_params[:code_challenge_method]
|
|
42
|
+
code_challenge_method: flow_params[:code_challenge_method],
|
|
43
|
+
nonce: flow_params[:nonce]
|
|
43
44
|
}
|
|
44
45
|
end
|
|
45
46
|
end
|
|
@@ -31,7 +31,8 @@ module StandardId
|
|
|
31
31
|
audience: params[:audience],
|
|
32
32
|
state: params[:state],
|
|
33
33
|
code_challenge: params[:code_challenge],
|
|
34
|
-
code_challenge_method: params[:code_challenge_method]
|
|
34
|
+
code_challenge_method: params[:code_challenge_method],
|
|
35
|
+
nonce: params[:nonce]
|
|
35
36
|
}.compact
|
|
36
37
|
|
|
37
38
|
# Remove code_challenge_method if code_challenge is not present
|
data/lib/standard_id/version.rb
CHANGED