Commit 1f6a709
Implement enforce_private_server_bundles security feature and add comprehensive test
Add security enforcement logic:
- When enforce_private_server_bundles is enabled, server bundles skip public path fallbacks
- Server bundles return private paths even if they don't exist (preventing public fallback)
- Add server_bundle_private_path helper that respects server_bundle_output_path configuration
- Add enforce_private_server_bundles? helper for clean configuration access
Add comprehensive test coverage:
- Test that enforcement prevents fallback to public paths when enabled
- Mock File.exist? to verify private path is returned even when public path exists
- Update mock_bundle_configs to include enforce_private_server_bundles default (false)
- All 54 tests pass, including new enforcement test
Security benefit:
- Prevents accidental serving of server bundles from public directories
- Ensures server-side code remains private even when deployment scripts fail
- Opt-in feature (defaults to false) for backwards compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 5917285 commit 1f6a709
File tree
2 files changed
+43
-0
lines changed- lib/react_on_rails
- spec/react_on_rails
2 files changed
+43
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
144 | 158 | | |
145 | 159 | | |
146 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
171 | 200 | | |
172 | 201 | | |
173 | 202 | | |
| |||
0 commit comments