fix(github): 1.0.1 - gate the setup page behind node auth
Measured on .100: every other connector answered 401 on its page unauthenticated (websearch/filesystem/webhook/time) while plugin_github handed out the form shell. The page is a credential control surface, so it now calls sx_require_node_auth() exactly like every ?action= does; an open node (no BOT_PASSWORD) stays open, which is the documented single-user default. tests/cgi.py asserts the 401 as a real CGI.
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-16 12:41:15
Commite6c02501
Parents37983df4
Changed files
plugin.json+1−1■■
src/gh.h+1−1■■
src/plugin_github.c+6−0■■■■■
tests/cgi.py+6−0■■■■■
4 files+14−2
Diff
plugin.json+1−1■■
index cb6ac2e..29ea40e 100644
--- a/plugin.json
+++ b/plugin.json
@@ -11,7 +11,7 @@
1111 "menus": false,
1212 "verified": "mock",
1313 "category": "devtools",
14- "version": "1.0.0",
14+ "version": "1.0.1",
1515 "license": "MIT",
1616 "capabilities": [
1717 "outbound_https_github_rest_api",
src/gh.h+1−1■■
index 18c63ff..69fd47f 100644
--- a/src/gh.h
+++ b/src/gh.h
@@ -44,7 +44,7 @@
4444
4545 #define GH_SLUG "github"
4646 #define GH_ID "plugin_github"
47-#define GH_VER "1.0.0"
47+#define GH_VER "1.0.1"
4848 #define GH_NAME "github"
4949 #define GH_DESC "GitHub tools"
5050
src/plugin_github.c+6−0■■■■■
index 3b377b0..4f344bf 100644
--- a/src/plugin_github.c
+++ b/src/plugin_github.c
@@ -373,6 +373,12 @@ static int html_ui(const sx_plugin_info *info, const char *query,
373373 (void)query;
374374 (void)embed; /* the page's own prepaint script flags <html embedded> */
375375 (void)theme;
376+ /* The page is a control surface for a credential, so it is gated exactly
377+ * like every ?action= is. The node proxy forwards X-Bot-Password when a
378+ * browser reaches the plugin through bot-api, and an open node (no
379+ * BOT_PASSWORD) stays open by design - but a passworded node answers 401
380+ * here rather than handing out the shell of the setup form. */
381+ sx_require_node_auth();
376382 sx_cgi_header(200, "text/html; charset=utf-8");
377383 emit_ui();
378384 return 0;
tests/cgi.py+6−0■■■■■
index 44e2a1a..cda755c 100755
--- a/tests/cgi.py
+++ b/tests/cgi.py
@@ -213,6 +213,12 @@ def main():
213213 check(st == "400", "an unknown action is 400", st)
214214
215215 # ---------- HTML page ----------
216+ # The page is a credential control surface, so it is gated like every
217+ # action: a passworded node hands a stranger a 401, not the form.
218+ st, ct, pl = cgi("", node_password="nodepw-1")
219+ check(st == "401", "the page itself is 401 on a passworded node with no "
220+ "client credential", st)
221+
216222 st, ct, pl = cgi("", bot_password="nodepw-1")
217223 check(st == "200" and ct.startswith("text/html"), "GET serves the page", ct)
218224 check("<script src=" not in pl and "cdnjs" not in pl and
219225
plugin.json+1−1■■
index cb6ac2e..29ea40e 100644index cb6ac2e..29ea40e 100644
--- a/plugin.json--- a/plugin.json
+++ b/plugin.json+++ b/plugin.json
@@ -11,7 +11,7 @@@@ -11,7 +11,7 @@
11 "menus": false,11 "menus": false,
12 "verified": "mock",12 "verified": "mock",
13 "category": "devtools",13 "category": "devtools",
14- "version": "1.0.0",14+ "version": "1.0.1",
15 "license": "MIT",15 "license": "MIT",
16 "capabilities": [16 "capabilities": [
17 "outbound_https_github_rest_api",17 "outbound_https_github_rest_api",
src/gh.h+1−1■■
index 18c63ff..69fd47f 100644index 18c63ff..69fd47f 100644
--- a/src/gh.h--- a/src/gh.h
+++ b/src/gh.h+++ b/src/gh.h
@@ -44,7 +44,7 @@@@ -44,7 +44,7 @@
44 44
45 #define GH_SLUG "github"45 #define GH_SLUG "github"
46 #define GH_ID "plugin_github"46 #define GH_ID "plugin_github"
47-#define GH_VER "1.0.0"47+#define GH_VER "1.0.1"
48 #define GH_NAME "github"48 #define GH_NAME "github"
49 #define GH_DESC "GitHub tools"49 #define GH_DESC "GitHub tools"
50 50
src/plugin_github.c+6−0■■■■■
index 3b377b0..4f344bf 100644index 3b377b0..4f344bf 100644
--- a/src/plugin_github.c--- a/src/plugin_github.c
+++ b/src/plugin_github.c+++ b/src/plugin_github.c
@@ -373,6 +373,12 @@ static int html_ui(const sx_plugin_info *info, const char *query,@@ -373,6 +373,12 @@ static int html_ui(const sx_plugin_info *info, const char *query,
373 (void)query;373 (void)query;
374 (void)embed; /* the page's own prepaint script flags <html embedded> */374 (void)embed; /* the page's own prepaint script flags <html embedded> */
375 (void)theme;375 (void)theme;
376+ /* The page is a control surface for a credential, so it is gated exactly
377+ * like every ?action= is. The node proxy forwards X-Bot-Password when a
378+ * browser reaches the plugin through bot-api, and an open node (no
379+ * BOT_PASSWORD) stays open by design - but a passworded node answers 401
380+ * here rather than handing out the shell of the setup form. */
381+ sx_require_node_auth();
376 sx_cgi_header(200, "text/html; charset=utf-8");382 sx_cgi_header(200, "text/html; charset=utf-8");
377 emit_ui();383 emit_ui();
378 return 0;384 return 0;
tests/cgi.py+6−0■■■■■
index 44e2a1a..cda755c 100755index 44e2a1a..cda755c 100755
--- a/tests/cgi.py--- a/tests/cgi.py
+++ b/tests/cgi.py+++ b/tests/cgi.py
@@ -213,6 +213,12 @@ def main():@@ -213,6 +213,12 @@ def main():
213 check(st == "400", "an unknown action is 400", st)213 check(st == "400", "an unknown action is 400", st)
214 214
215 # ---------- HTML page ----------215 # ---------- HTML page ----------
216+ # The page is a credential control surface, so it is gated like every
217+ # action: a passworded node hands a stranger a 401, not the form.
218+ st, ct, pl = cgi("", node_password="nodepw-1")
219+ check(st == "401", "the page itself is 401 on a passworded node with no "
220+ "client credential", st)
221+
216 st, ct, pl = cgi("", bot_password="nodepw-1")222 st, ct, pl = cgi("", bot_password="nodepw-1")
217 check(st == "200" and ct.startswith("text/html"), "GET serves the page", ct)223 check(st == "200" and ct.startswith("text/html"), "GET serves the page", ct)
218 check("<script src=" not in pl and "cdnjs" not in pl and224 check("<script src=" not in pl and "cdnjs" not in pl and
219225