From 79fa556e87c5563ff2bc549a43c518f172d4962c Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Fri, 13 Dec 2024 15:36:25 -0700 Subject: [PATCH] Cleanup log messages, dangling parameters, etc. --- src/terrain/clients/keycloak/admin.clj | 4 ---- src/terrain/routes/bootstrap.clj | 8 ++------ src/terrain/services/bootstrap.clj | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/terrain/clients/keycloak/admin.clj b/src/terrain/clients/keycloak/admin.clj index 90e668f7..505e2cb7 100644 --- a/src/terrain/clients/keycloak/admin.clj +++ b/src/terrain/clients/keycloak/admin.clj @@ -41,7 +41,6 @@ :headers {:authorization (str "Bearer " token)} :as :json})] ; the 'exact' query parameter doesn't seem to work on all keycloak versions, so we filter it - (log/error "Got user data" user-data) (->> user-data :body (filter (fn [user] (= (:username user) username))) @@ -55,7 +54,6 @@ ([user-id] (get-user-session user-id (:access_token (get-token)))) ([user-id token] - (log/error "Getting user sessions for ID" user-id) (:body (http/get (keycloak-admin-url "users" user-id "sessions") {:insecure? true :headers {:authorization (str "Bearer " token)} @@ -66,7 +64,5 @@ ([username] (get-user-session-by-username username (:access_token (get-token)))) ([username token] - (log/error "Getting user sessions for username" (string/replace username #"@.*$" "")) (let [user (get-user (string/replace username #"@.*$" "") token)] - (log/error "Got single-user data:" user) (get-user-session (:id user) token)))) diff --git a/src/terrain/routes/bootstrap.clj b/src/terrain/routes/bootstrap.clj index c597c11b..282a35b7 100644 --- a/src/terrain/routes/bootstrap.clj +++ b/src/terrain/routes/bootstrap.clj @@ -8,9 +8,6 @@ [terrain.util :refer [optional-routes]] [terrain.util.config :as config])) -;; Declarations to eliminate lint warnings for path and query parameter bindings. -(declare user-agent ip-address params) - (defn secured-bootstrap-routes [] (optional-routes @@ -19,10 +16,9 @@ (context "/bootstrap" [] :tags ["bootstrap"] - (GET "/" [:as {{user-agent "user-agent"} :headers}] - :query [{:keys [ip-address]} sessions-schema/IPAddrParam] + (GET "/" [] :return schema/TerrainBootstrapResponse :summary "Bootstrap Service" :description "This service obtains information about and initializes the workspace for the authenticated user. It also records the fact that the user logged in." - (ok (bootstrap user-agent)))))) + (ok (bootstrap)))))) diff --git a/src/terrain/services/bootstrap.clj b/src/terrain/services/bootstrap.clj index 83f72538..673a8ea5 100644 --- a/src/terrain/services/bootstrap.clj +++ b/src/terrain/services/bootstrap.clj @@ -68,8 +68,7 @@ (defn bootstrap "This service obtains information about and initializes the workspace for the authenticated user. It also records the fact that the user logged in." - [user-agent] - (assertions/assert-valid user-agent "Missing or empty request parameter: user-agent") + [] (let [{user :shortUsername :keys [email firstName lastName username]} current-user login-session (future (get-login-session username)) apps-info (future (get-apps-info))