standard_audit 0.13.2 → 0.13.3

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: 5904e6e332f04e94ece55c2be87dc02fd2e243d846b5a7ded70e40af18831996
4
- data.tar.gz: eca2147536455ac8dec6b640c272b701468946568c9dde1173cd373cdac2572d
3
+ metadata.gz: 77f38f95622eab13dc70d4376ad9694a3bbb03d3d54f5f2c43f63012e041ea23
4
+ data.tar.gz: 5d68228d9da02a23808db8cc2588dc358df1dc7f7a82d86da4447d98038f6411
5
5
  SHA512:
6
- metadata.gz: 62aaf894a1583cbee375ea6184fee0a66bdaf9823d2ccae9212fcb0339ad992741e0b00d0f9a88a83c6fc9325c9beb25c1e8a400df806a1ff9ed9447504814d2
7
- data.tar.gz: aac06818dd7aac827e96d4e6c82a03d26d7ddc7897d51313770d13297296f7e855268d8eac062cef12fcb7c693bc636f2a8e342f13df690313f846d9c8536fce
6
+ metadata.gz: c5ca114c4894594f1e0de803d0d0e207bd308f887e130237af3d967a4ed33bc476ac72f28b1cff8b83af5f2d5c56e158542a917c560680c96e3f686ec339c6ec
7
+ data.tar.gz: 991e7cbfd6c21c73f54bc1bc1ed64aa1df8faaa2a6d44dfdf75222ab79911eb462de275ca086d74ef72108db70bad6df1f8c9f65fab9ec7ea115c0bb5bb99f1e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.13.3] - 2026-10-21
11
+
12
+ ### Fixed
13
+
14
+ - The default `scope_extractor` returns the payload's `scope:` only when it is a
15
+ record (responds to `to_global_id`). standard_id publishes `scope:` as a
16
+ Symbol or String (the OAuth scope or auth plane), and the old default passed it
17
+ to `to_global_id`, so those events failed to write (`NoMethodError`,
18
+ fundbright-web FUNDBRIGHT-WEB-41). A non-record scope now falls through to
19
+ `current_scope_resolver`, like an absent one. A custom `scope_extractor` and an
20
+ explicit `scope:` on `StandardAudit.record` are unchanged.
21
+
10
22
  ## [0.13.2] - 2026-10-02
11
23
 
12
24
  ### Fixed
data/README.md CHANGED
@@ -508,7 +508,7 @@ StandardAudit.configure(baseline: true) do |config|
508
508
  # Defaults shown below.
509
509
  config.actor_extractor = ->(payload) { payload[:actor] }
510
510
  config.target_extractor = ->(payload) { payload[:target] }
511
- config.scope_extractor = ->(payload) { payload[:scope] }
511
+ config.scope_extractor = ->(payload) { payload[:scope] } # default keeps it only if it responds to to_global_id
512
512
 
513
513
  # -- Current Attribute Resolvers --
514
514
  # Fallbacks used when payload values are nil.
@@ -24,7 +24,15 @@ module StandardAudit
24
24
 
25
25
  @actor_extractor = ->(payload) { payload[:actor] }
26
26
  @target_extractor = ->(payload) { payload[:target] }
27
- @scope_extractor = ->(payload) { payload[:scope] }
27
+ # Only a record can be a scope (it is stored by GlobalID). Payloads also
28
+ # use `scope:` for other things: standard_id publishes the OAuth scope
29
+ # or auth plane there as a Symbol/String, which would raise NoMethodError
30
+ # on `to_global_id` at write time. Anything else falls through to
31
+ # `current_scope_resolver`.
32
+ @scope_extractor = ->(payload) {
33
+ scope = payload[:scope]
34
+ scope if scope.respond_to?(:to_global_id)
35
+ }
28
36
 
29
37
  # Tries StandardId's `Current.account` first, then the Rails-generator
30
38
  # convention `Current.user`. Each is respond_to?-guarded, so an app that
@@ -1,3 +1,3 @@
1
1
  module StandardAudit
2
- VERSION = "0.13.2"
2
+ VERSION = "0.13.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryl Sim