summaryrefslogtreecommitdiff
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
commitfcac4e94c7dd858e7d8604afb3e10e731bf1c8b7 (patch)
tree11cb3006702f0dad43d76744c1bebcbab7561490 /tests/test-restclient-config-skyfi-buffer.el
parentb70781e8eeaa67cf2a1aa804c27b92f38fd52742 (diff)
downloaddotemacs-fcac4e94c7dd858e7d8604afb3e10e731bf1c8b7.tar.gz
dotemacs-fcac4e94c7dd858e7d8604afb3e10e731bf1c8b7.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 7685c77c..00000000
--- 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