standard_id 0.66.0 → 0.66.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/app/controllers/standard_id/api/userinfo_controller.rb +15 -6
- 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: a5888f19201531026c10e1a91dd295dd1b5ed5b90fb4ddf139b3560489ba6797
|
|
4
|
+
data.tar.gz: d9515e19686e5fe874c72f9f610cdd7d5299686de1c6f94047c69be2782eb960
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90d7ab7ef2886e75311f4e1ffa76030965191914e80ec8f828c9a3b890b89f191ff2f75e9122547b8482f0301078de3b9e8c97f1b71866bf0254adc20749488d
|
|
7
|
+
data.tar.gz: 36de0dee3ada0ff656ff8e4fe74409791a689b24beac28ff62e1c0d9786779d26f2df4804c395277c1b1aeaff9ed7dc50ab1855220620cee7ceacb3c175797e5
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.66.1] - 2026-11-25
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`GET /userinfo` no longer 500s when the host's account model lacks an optional attribute.**
|
|
15
|
+
The `name` and `email` claims (with `email_verified`, which depends on `email`) are now read only
|
|
16
|
+
when the account responds to them, and omitted otherwise, as OIDC allows for every claim but
|
|
17
|
+
`sub`. Previously an Account without `name` raised `NoMethodError` for every caller.
|
|
18
|
+
`email_verified` is also omitted, rather than sent as `false`, when the account has no email.
|
|
19
|
+
|
|
10
20
|
## [0.66.0] - 2026-11-25
|
|
11
21
|
|
|
12
22
|
### Added
|
|
@@ -16,22 +16,31 @@ module StandardId
|
|
|
16
16
|
|
|
17
17
|
private
|
|
18
18
|
|
|
19
|
+
# OIDC userinfo claims other than `sub` are optional: a claim whose
|
|
20
|
+
# attribute the host's account model doesn't define is omitted, not
|
|
21
|
+
# sent as null and not a NoMethodError.
|
|
19
22
|
def build_userinfo_response(account)
|
|
23
|
+
email = optional_attribute(account, :email)
|
|
24
|
+
|
|
20
25
|
{
|
|
21
26
|
sub: account_sub(account),
|
|
22
|
-
name: account
|
|
23
|
-
email:
|
|
24
|
-
email_verified: email_verified?(
|
|
25
|
-
updated_at: account
|
|
27
|
+
name: optional_attribute(account, :name),
|
|
28
|
+
email: email,
|
|
29
|
+
email_verified: email.present? ? email_verified?(email) : nil,
|
|
30
|
+
updated_at: optional_attribute(account, :updated_at)&.to_i
|
|
26
31
|
}.compact
|
|
27
32
|
end
|
|
28
33
|
|
|
34
|
+
def optional_attribute(account, attribute)
|
|
35
|
+
account.public_send(attribute) if account.respond_to?(attribute)
|
|
36
|
+
end
|
|
37
|
+
|
|
29
38
|
def account_sub(account)
|
|
30
39
|
account.id.to_s
|
|
31
40
|
end
|
|
32
41
|
|
|
33
|
-
def email_verified?(
|
|
34
|
-
identifier = StandardId::EmailIdentifier.find_by(value:
|
|
42
|
+
def email_verified?(email)
|
|
43
|
+
identifier = StandardId::EmailIdentifier.find_by(value: email)
|
|
35
44
|
identifier&.verified_at.present?
|
|
36
45
|
end
|
|
37
46
|
end
|
data/lib/standard_id/version.rb
CHANGED