Optional environment variable for passwd file.

This commit is contained in:
simon 2017-09-09 11:42:09 +01:00
parent 3ed44ec3fc
commit 44703d5889

View file

@ -1,9 +1,10 @@
(ns ^{:doc "Authentication functions." (ns ^{:doc "Authentication functions."
:author "Simon Brooke"} :author "Simon Brooke"}
smeagol.authenticate smeagol.authenticate
(:require [taoensso.timbre :as timbre] (:require [crypto.password.scrypt :as password]
[environ.core :refer [env]]
[noir.io :as io] [noir.io :as io]
[crypto.password.scrypt :as password])) [taoensso.timbre :as timbre]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
@ -34,8 +35,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the relative path to the password file. ;; the relative path to the password file.
;; (def password-file-path (str (io/resource-path) "../passwd")) (def password-file-path
(def password-file-path (str (clojure.java.io/resource "passwd"))) (or
(env :smeagol-passwd)
(str (clojure.java.io/resource "passwd"))))
(defn- get-users (defn- get-users
"Get the whole content of the password file as a clojure map" "Get the whole content of the password file as a clojure map"