aboutsummaryrefslogtreecommitdiff
path: root/tests/test-restclient-config-skyfi-buffer.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-23 19:05:01 -0500
committerCraig Jennings <c@cjennings.net>2026-05-23 19:05:01 -0500
commiteddf838e5836cebf64dc624dff5fc2e2299a700c (patch)
tree7477cf40fae10031f0e27ec3456baa1da4c38123 /tests/test-restclient-config-skyfi-buffer.el
parent6f453c065c7eb212c7bc7a845c32acdc2e931a5c (diff)
downloaddotemacs-eddf838e5836cebf64dc624dff5fc2e2299a700c.tar.gz
dotemacs-eddf838e5836cebf64dc624dff5fc2e2299a700c.zip
refactor(restclient): remove SkyFi key-injection feature
cj/restclient-skyfi-buffer opened the SkyFi template in a file-visiting buffer and rewrote the :skyfi-key line with the live key from authinfo. An accidental save would then persist the plaintext key to disk, which breaks the module's own "key never stored on disk" promise. The template file was gitignored and never tracked, so the exposure was local only, not a repo leak. I removed the feature rather than hardening it: cj/skyfi-api-key, cj/restclient--inject-skyfi-key, cj/restclient-skyfi-buffer, the C-; R s binding, and the two SkyFi test files are gone, along with the local template. The generic restclient setup stays: scratch buffer on C-; R n, open a .rest file on C-; R o.
Diffstat (limited to 'tests/test-restclient-config-skyfi-buffer.el')
-rw-r--r--tests/test-restclient-config-skyfi-buffer.el38
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/test-restclient-config-skyfi-buffer.el b/tests/test-restclient-config-skyfi-buffer.el
deleted file mode 100644
index 7685c77c4..000000000
--- a/tests/test-restclient-config-skyfi-buffer.el
+++ /dev/null
@@ -1,38 +0,0 @@
-;;; test-restclient-config-skyfi-buffer.el --- Tests for cj/restclient-skyfi-buffer -*- lexical-binding: t; -*-
-
-;;; Commentary:
-;; Unit tests for cj/restclient-skyfi-buffer function.
-;; Opens the SkyFi API template file.
-;; Covers Normal and Error cases.
-
-;;; Code:
-
-(when noninteractive
- (package-initialize))
-
-(require 'ert)
-(require 'restclient-config)
-
-;;; Normal Cases
-
-(ert-deftest test-restclient-skyfi-buffer-opens-file ()
- "Opens existing skyfi-api.rest file and switches to it."
- (let ((skyfi-file (expand-file-name "data/skyfi-api.rest" user-emacs-directory)))
- (when (file-exists-p skyfi-file)
- (unwind-protect
- (progn
- (cj/restclient-skyfi-buffer)
- (should (string-match-p "skyfi-api\\.rest"
- (buffer-file-name (current-buffer)))))
- (when-let ((buf (get-file-buffer skyfi-file)))
- (kill-buffer buf))))))
-
-;;; Error Cases
-
-(ert-deftest test-restclient-skyfi-buffer-missing-file-signals-error ()
- "Signals user-error when skyfi-api.rest does not exist."
- (let ((cj/restclient-data-dir "/tmp/nonexistent-restclient-test-dir/"))
- (should-error (cj/restclient-skyfi-buffer) :type 'user-error)))
-
-(provide 'test-restclient-config-skyfi-buffer)
-;;; test-restclient-config-skyfi-buffer.el ends here