Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
#45 bug fix for missing parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Eremic committed Oct 17, 2016
1 parent 7f539b4 commit 43e051d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/org/zalando/stups/even/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
(s/optional-key :lifetime_minutes) (s/both s/Int (s/pred valid-lifetime))
})

(def-http-component API "api/even-api.yaml" [ssh db usersvc http-audit-logger])
(def-http-component API "api/even-api.yaml" [ssh db usersvc http-audit-logger] :dependencies-as-map true)

(def default-http-configuration {:http-port 8080})

(def empty-access-request {:username nil :hostname nil :reason nil :remote_host nil :lifetime_minutes 60})

(defn serve-public-key
"Return the user's public SSH key as plaintext"
[{:keys [name]} request _ _ usersvc]
[{:keys [name]} request {:keys [usersvc]}]
(if-let [ssh-key (get-public-key name usersvc)]
(-> (ring/response ssh-key)
(ring/header "Content-Type" "text/plain"))
Expand Down Expand Up @@ -104,7 +104,7 @@

(defn request-access
"Request SSH access to a specific host"
[{:keys [request]} ring-request ssh db usersvc {:keys [log-fn]}]
[{:keys [request]} ring-request {:keys [ssh db usersvc {:keys [log-fn]}]} ]
(if-let [auth (extract-auth ring-request)]
(request-access-with-auth auth (->> request
validate-request
Expand All @@ -114,7 +114,7 @@

(defn list-access-requests
"Return list of most recent access requests from database"
[parameters _ _ db _]
[parameters _ {:keys [db]}]
(let [result (map sql/from-sql (sql/cmd-list-access-requests (sq/to-sql parameters) {:connection db}))]
(-> (ring/response result)
(fring/content-type-json))))

0 comments on commit 43e051d

Please sign in to comment.