Skip to content

Commit

Permalink
Merge pull request #15 from ianmcorvidae/no-username-suffix
Browse files Browse the repository at this point in the history
Remove the username suffix (if present) by simple regex rather than configuration.
  • Loading branch information
ianmcorvidae authored Jul 26, 2024
2 parents 992c223 + 5aa4fec commit a1e5549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/analyses/clients.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns analyses.clients
(:require [analyses.config :refer [data-info-base-uri apps-base-uri username-suffix]]
(:require [analyses.config :refer [data-info-base-uri apps-base-uri]]
[medley.core :as medley]
[clj-http.client :as http]
[cemerick.url :refer [url]]
Expand All @@ -11,13 +11,13 @@
(defn apps-url
[components username query]
(-> (apply url (apps-base-uri) components)
(assoc :query (assoc query :user (clojure.string/replace username (username-suffix) "")))
(assoc :query (assoc query :user (clojure.string/replace username #"@.*$" "")))
(str)))

(defn data-info-url
[components username query]
(-> (apply url (data-info-base-uri) components)
(assoc :query (assoc query :user (clojure.string/replace username (username-suffix) "")))
(assoc :query (assoc query :user (clojure.string/replace username #"@.*$" "")))
(str)))

(defn get-path-info
Expand Down
5 changes: 0 additions & 5 deletions src/analyses/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@
[props config-valid configs]
"analyses.apps.base-uri" "http://apps")

(cc/defprop-str username-suffix
"The suffix appended to fully qualified usernames."
[props config-valid configs]
"analyses.username.suffix")

(defn- validate-config
"Validates the configuration settings after they've been loaded."
[]
Expand Down

0 comments on commit a1e5549

Please sign in to comment.