redpen-rails 0.1.0 → 0.1.2
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 +8 -0
- data/app/controllers/redpen/notes_controller.rb +8 -1
- data/lib/redpen/engine.rb +6 -2
- data/lib/redpen/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: 28bef384bf0816760a2312e367eb019fe05615fb2fc3dc214785f354bc8608e3
|
|
4
|
+
data.tar.gz: b9ac0d19df074e91d0a494c1eb3d23113e11a3023bc842e6a49d944b435442e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c6c9601879d15fd5b46636bb8a1285698666fae5a363f9cbfd7b0566fc2b0866de0a4757d82c863fc0aa5003bed64f2f318bcf980dc49006dd4c84e8ddf32f1
|
|
7
|
+
data.tar.gz: 6987d5b87a81e471c58fd0d83a7100e0ed33c5a59556dcbfa97a5d8b55d1f27227f4465b3d37a09e8f326d66b458a6df4185c26e770567d7f0c5247051af646f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2 — 2026-09-18
|
|
4
|
+
|
|
5
|
+
**Security.** `NotesController` asked `Redpen.annotatable` about `params[:path]` whenever the query named one, while `create` wrote the note to `note[path]` and `destroy` removed whatever note the id named. A signed-in author allowed on any one page could therefore add a note to, or delete a note from, a page they may not pen, by naming their own page in the query. The gate now asks about the page the request actually touches: the query's path for the index, the note's own path for create and destroy. Resolving and reopening were never affected. Found reviewing Curated Connections' landing pages.
|
|
6
|
+
|
|
7
|
+
## 0.1.1 — 2026-09-16
|
|
8
|
+
|
|
9
|
+
Helpers register in `to_prepare` instead of an engine initializer. A host that loads `ActionController::Base` during boot (Curated Connections requires a lib from `application.rb` that does) fired the `on_load` hook before the autoloader existed, and `Redpen::RailHelper` failed to resolve. Found on the first day of the second host.
|
|
10
|
+
|
|
3
11
|
## 0.1.0 — 2026-09-16
|
|
4
12
|
|
|
5
13
|
First extraction, from nityesh.com. Notes pinned to elements by path + CSS selector, a pen UI as one Stimulus controller, resolve/reopen as a resolution resource, `redpen_rail` and `redpen_inject` helpers, `redpen:install` and `redpen:views` generators. Sprockets and Propshaft, import maps only.
|
|
@@ -26,8 +26,15 @@ module Redpen
|
|
|
26
26
|
@note ||= Note.find(params[:id])
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# The page the gate is asked about is the page this request reads or writes: the
|
|
30
|
+
# query's path for the index, the note's own path for create and destroy. Taking it
|
|
31
|
+
# from anywhere else would let a request pass the gate for one page and land on another.
|
|
29
32
|
def path
|
|
30
|
-
@path ||=
|
|
33
|
+
@path ||= case action_name
|
|
34
|
+
when "index" then params[:path]
|
|
35
|
+
when "create" then note_params[:path]
|
|
36
|
+
else note.path
|
|
37
|
+
end
|
|
31
38
|
end
|
|
32
39
|
|
|
33
40
|
def note_params
|
data/lib/redpen/engine.rb
CHANGED
|
@@ -25,8 +25,12 @@ module Redpen
|
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
# `redpen_rail` and `redpen_inject` in every host view and controller.
|
|
29
|
-
initializer
|
|
28
|
+
# `redpen_rail` and `redpen_inject` in every host view and controller. Not an
|
|
29
|
+
# initializer: a host that loads ActionController::Base at boot (an initializer
|
|
30
|
+
# referencing it, a lib required from application.rb) would fire the hook before
|
|
31
|
+
# the autoloader exists, and Redpen::RailHelper would not resolve. to_prepare runs
|
|
32
|
+
# once the autoloader is up, and again on every reload in development.
|
|
33
|
+
config.to_prepare do
|
|
30
34
|
ActiveSupport.on_load(:action_controller_base) { helper Redpen::RailHelper }
|
|
31
35
|
end
|
|
32
36
|
end
|
data/lib/redpen/version.rb
CHANGED