forest_admin_rails 1.38.3 → 1.39.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: 833b87be7c464c040284316f54eabb82c6b7c0cf7747dd85dcee60a416a6f10e
4
- data.tar.gz: 909e3069f216dba315c57a3b61d3ab7c18c53fced59b9771d95e2c6df2599faf
3
+ metadata.gz: fe017cbbf141336641a4e5f66f021847c8661488287db1beab964580c3c0d4ba
4
+ data.tar.gz: e4f542012d6d98544c9a1fc75a12a44de07883f1551eb18dc8743cfa1b3b5a65
5
5
  SHA512:
6
- metadata.gz: 33f1013081c9fa328af9de7f7399bf2ea7fa4a78b527a077046ba8e8c4d10f517e3b7c0f78d6f6fb53a310600e99565f95d57a9f64ec92354f57fe8fbdc35826
7
- data.tar.gz: 8047789034367bee3ad92bca50053bf071487e4d74ea0034b6ae24deae64d1875a3e4d6d9202bfb825bd869daeaddff0b43c14ca6292323ef54a3848d5fb95ff
6
+ metadata.gz: b10ddc9ea4acd4087c6ebea7e30d9ab7667eb68034d98b0ed7295257c22a14736e7bac3bce9e18a2989b772b72587b7af7e4993c7a1357c761513735b5ed871a
7
+ data.tar.gz: ff99052059e50e2792098179bed5379d0ad0899e4fad6280982de0aa9ecd0dd291ca10f8e726371fcdcbe667c0146470fe7728ac2ec4d0432a955854aeb0535e
@@ -34,6 +34,27 @@ module ForestAdminRails
34
34
  agent_factory.setup(ForestAdminRails.config)
35
35
  load_configuration
36
36
  load_cors
37
+ load_correlation_id
38
+ end
39
+ end
40
+
41
+ # Echo the agent-generated correlation id on every response (mirrors the Node agent's
42
+ # router.use(correlationIdMiddleware)); CORS exposure of the header is handled in load_cors.
43
+ #
44
+ # Ahead of ShowExceptions rather than at the end of the stack: a Rack middleware can only add a header
45
+ # to a response it sees returned, so sitting under the exception handlers meant error responses they
46
+ # build on the way out never carried the id.
47
+ def load_correlation_id
48
+ middleware = ForestAdminAgent::Http::CorrelationIdMiddleware
49
+
50
+ begin
51
+ # The application's stack, not the engine's: ShowExceptions lives there, and an
52
+ # insert_before recorded on the engine's own (empty) proxy raises when it is applied.
53
+ Rails.application.config.middleware.insert_before ActionDispatch::ShowExceptions, middleware
54
+ rescue StandardError
55
+ # No ShowExceptions in this stack (or already gone): the id still reaches every response the app
56
+ # returns normally.
57
+ config.middleware.use middleware
37
58
  end
38
59
  end
39
60
 
@@ -102,7 +123,8 @@ module ForestAdminRails
102
123
  hostnames += ENV['CORS_ORIGINS'].split(',') if ENV['CORS_ORIGINS']
103
124
 
104
125
  origins hostnames
105
- resource '*', headers: :any, methods: :any, credentials: true, max_age: 86_400
126
+ resource '*', headers: :any, methods: :any, credentials: true, max_age: 86_400,
127
+ expose: [ForestAdminAgent::Http::CorrelationId::HEADER]
106
128
  end
107
129
  end
108
130
  end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRails
2
- VERSION = "1.38.3"
2
+ VERSION = "1.39.0"
3
3
  end
@@ -34,6 +34,9 @@ module ForestAdminRails
34
34
  setting :disable_route_cache, default: false
35
35
  setting :rpc_max_polling_threads, default: nil
36
36
  setting :workflow_executor_url, default: nil
37
+ # { database: <ActiveRecord config or URL>, schema:, table_name:, redact: } — setting `database`
38
+ # turns the audit trail on: every change is captured and the `/_audit-trail` routes are registered.
39
+ setting :audit_trail, default: nil
37
40
 
38
41
  if defined?(Rails::Railtie)
39
42
  # logic for cors middleware,... here // or it might be into Engine
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.38.3
4
+ version: 1.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-08-14 00:00:00.000000000 Z
12
+ date: 2026-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: base64