Skip to content

Commit 8468996

Browse files
committed
Use ^:private + defn, instead of defn-
1 parent e7f7848 commit 8468996

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/eca/secrets.clj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
[(str path ".gpg") path]))
2626
files)))
2727

28-
(defn- file-exists?
28+
(defn ^:private file-exists?
2929
"Checks if a file exists and is readable."
3030
[^String path]
3131
(let [file (io/file path)]
3232
(and (.exists file)
3333
(.isFile file)
3434
(.canRead file))))
3535

36-
(defn- validate-permissions
36+
(defn ^:private validate-permissions
3737
"Checks if file has secure permissions (Unix only).
3838
Returns true if secure, false otherwise.
3939
Logs warning if permissions are too open."
@@ -66,20 +66,20 @@
6666
;; Cache for GPG decryption results (5-second TTL)
6767
(def ^:private gpg-cache (atom {}))
6868

69-
(defn- gpg-cache-key
69+
(defn ^:private gpg-cache-key
7070
"Generates cache key for a file path and modification time."
7171
[^File file]
7272
(str (.getPath file) ":" (.lastModified file)))
7373

74-
(defn- get-cached-gpg
74+
(defn ^:private get-cached-gpg
7575
"Gets cached GPG decryption result if still valid."
7676
[cache-key]
7777
(when-let [{:keys [content timestamp]} (@gpg-cache cache-key)]
7878
(when (< (- (System/currentTimeMillis) timestamp) 5000) ; 5-second TTL
7979
(logger/debug logger-tag "GPG cache hit for" cache-key)
8080
content)))
8181

82-
(defn- cache-gpg-result!
82+
(defn ^:private cache-gpg-result!
8383
"Caches GPG decryption result with timestamp."
8484
[cache-key content]
8585
(swap! gpg-cache assoc cache-key {:content content
@@ -124,7 +124,7 @@
124124
(logger/warn logger-tag "GPG command failed for" file-path ":" (.getMessage e))
125125
nil)))
126126

127-
(defn- load-credentials-from-file
127+
(defn ^:private load-credentials-from-file
128128
"Loads and parses credentials from a file.
129129
Returns vector of credential maps or nil on error."
130130
[^String file-path]
@@ -162,7 +162,7 @@
162162
(logger/warn logger-tag "Failed to load credentials from" file-path ":" (.getMessage e))
163163
nil)))
164164

165-
(defn- load-all-credentials
165+
(defn ^:private load-all-credentials
166166
"Loads credentials from all available credential files.
167167
Returns vector of all credential maps from all files, in priority order."
168168
[]
@@ -186,7 +186,7 @@
186186
:login login-part
187187
:port port})))
188188

189-
(defn- match-credential
189+
(defn ^:private match-credential
190190
"Matches a credential entry against parsed keyRc spec.
191191
Returns true if the credential matches the spec."
192192
[credential {:keys [machine login port]}]

src/eca/secrets/authinfo.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(set! *warn-on-reflection* true)
66

7-
(defn- parse-line
7+
(defn ^:private parse-line
88
"Parses a single authinfo line into a credential map.
99
Returns a credential map or nil if line is invalid."
1010
[line]

src/eca/secrets/netrc.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(set! *warn-on-reflection* true)
66

7-
(defn- parse-entry
7+
(defn ^:private parse-entry
88
"Parses a single netrc entry from multiple lines.
99
Returns a credential map or nil if entry is invalid."
1010
[lines]

test/eca/secrets/authinfo_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
(.delete temp-file))))))
9292

9393
;; Helper function for field order independence test
94-
(defn- write-file-random-order
94+
(defn ^:private write-file-random-order
9595
"Write entries with randomized field order to test order-independence"
9696
[filename entries]
9797
(let [content (string/join "\n"

0 commit comments

Comments
 (0)