Skip to content

Commit

Permalink
Remove a bunch of unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Nov 7, 2020
1 parent 71f5b33 commit 881526c
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 87 deletions.
1 change: 0 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
[org.cyverse/metadata-files "1.0.2"]
[org.cyverse/oai-ore "1.0.3"]
[org.cyverse/service-logging "2.8.0"]
[org.cyverse/tree-urls-client "2.8.1"]
[org.cyverse/event-messages "0.0.1"]
[com.novemberain/langohr "3.5.1"]]
:eastwood {:exclude-namespaces [data-info.routes.schemas.tickets
Expand Down
6 changes: 0 additions & 6 deletions src/data_info/routes/data.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
[data-info.services.page-tabular :as page-tabular]
[data-info.services.uuids :as uuids]
[data-info.util.config :as cfg]
[tree-urls-client.middleware :refer [wrap-tree-urls-base]]
[clojure-commons.error-codes :as ce]
[data-info.util.service :as svc]))

(defn tree-urls-middleware [handler] (wrap-tree-urls-base handler cfg/tree-urls-base-url))

(defroutes data-operations

(context "/data" []
Expand Down Expand Up @@ -91,14 +88,12 @@ with characters in a runtime-configurable parameter. Currently, this parameter l
; add both versions to catch multiple types of path passing
(GET "/manifest/*" [:as {{path :*} :params uri :uri}]
:query [{:keys [user]} StandardUserQueryParams]
:middleware [tree-urls-middleware]
:no-doc true
(svc/trap uri manifest/do-manifest user (str "/" path)))

(GET "/manifest/:path" [:as {uri :uri}]
:query [{:keys [user]} StandardUserQueryParams]
:path-params [path :- String]
:middleware [tree-urls-middleware]
:return Manifest
:summary "Return file manifest"
:description (str
Expand Down Expand Up @@ -165,7 +160,6 @@ with characters in a runtime-configurable parameter. Currently, this parameter l

(GET "/manifest" [:as {uri :uri}]
:query [{:keys [user]} StandardUserQueryParams]
:middleware [tree-urls-middleware]
:return Manifest
:summary "Return file manifest"
:description (str
Expand Down
13 changes: 0 additions & 13 deletions src/data_info/services/entry.clj
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,6 @@
(not (duv/good-string? (:chars bad-indicator) basename)))))


(defn- total-bad
[user zone parent entity-type info-types bad-indicator]
(icat/number-of-bad-items-in-folder
:user user
:zone zone
:parent-path parent
:entity-type entity-type
:info-types info-types
:bad-chars (apply str (:chars bad-indicator))
:bad-names (:names bad-indicator)
:bad-paths (:paths bad-indicator)))


(defn- paged-dir-listing
"Provides paged directory listing as an alternative to (list-dir). Always contains files."
[irods user path entity-type bad-indicator sfield sord offset limit info-types]
Expand Down
17 changes: 0 additions & 17 deletions src/data_info/services/icat.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,3 @@
[]
(log/info "[ICAT] set up ICAT connection.")
(setup-icat (spec)))


(defn ^String resolve-data-type
"Given filesystem id, it returns the type of data item it is, file or folder.
Parameters:
fs - (optional) An open jargon context
data-id - The UUID of the data item to inspect
Returns:
The type of the data item, `file` or `folder`"
([^IPersistentMap fs ^UUID data-id]
(if (empty? (meta/list-collections-with-attr-value fs "ipc_UUID" data-id)) "file" "folder"))

([^UUID data-id]
(init/with-jargon (cfg/jargon-cfg) [fs]
(resolve-data-type fs data-id))))
1 change: 0 additions & 1 deletion src/data_info/services/manifest.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
[data-info.util.validators :as validators]
[data-info.util.irods :as irods]
[data-info.util.logging :as dul]
[tree-urls-client.core :as tree]
[data-info.util.config :as cfg]))

(defn- format-anon-files-url
Expand Down
14 changes: 0 additions & 14 deletions src/data_info/services/uuids.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,3 @@
[:path-exists path user (cfg/irods-zone)]
[:path-readable path user (cfg/irods-zone)])
{:id @(rods/uuid irods user (cfg/irods-zone) path)}))

(defn ^Boolean uuid-accessible?
"Indicates if a data item is readable by a given user.
Parameters:
user - the authenticated name of the user
data-id - the UUID of the data item
Returns:
It returns true if the user can access the data item, otherwise false"
[^String user ^UUID data-id]
(irods/with-jargon-exceptions [cm]
(let [data-path (uuid/get-path cm (str data-id))]
(and data-path (is-readable? cm user data-path)))))
13 changes: 0 additions & 13 deletions src/data_info/util/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@
"data-info.community-data" "/iplant/home/shared")


(cc/defprop-optstr copy-attribute
"The attribute to tag files with when they're a copy of another file."
[props config-valid configs]
"data-info.copy-key" "ipc-de-copy-from")


(cc/defprop-optstr bad-chars
"The characters that are considered invalid in iRODS dir- and filenames."
[props config-valid configs]
Expand Down Expand Up @@ -108,13 +102,6 @@
[props config-valid configs]
"data-info.notificationagent.base-url" "http://notification-agent:60000")

(cc/defprop-optstr tree-urls-base-url
"The base URL of the tree-urls service"
[props config-valid configs]
"data-info.tree-urls.base-url" "http://tree-urls:60000")

(defn tree-urls-attr [] "ipc-tree-urls")

(cc/defprop-optstr kifshare-download-template
"The mustache template for the kifshare URL."
[props config-valid configs]
Expand Down
20 changes: 0 additions & 20 deletions src/data_info/util/validators.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,6 @@
:value param-val}))))


(defn valid-uuid-param
"Validates that a given value is a UUID.
Parameters:
param-name - the name of the param holding the proposed UUID
param-val - the proposed UUID
Throws:
It throws a map with of the following form.
{:error_code ERR_BAD_REQUEST
:param param-name
:value param-val}"
[^String param-name ^String param-val]
(when-not (is-uuid? param-val)
(throw+ {:error_code error/ERR_BAD_REQUEST
:param param-name
:value param-val})))


(defn- num-paths-okay?
[path-count]
(<= path-count (cfg/max-paths-in-request)))
Expand Down
2 changes: 0 additions & 2 deletions test/data_info/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
(is (= (config/listen-port) 60000))
(is (= (config/perms-filter) ["rods", "rodsadmin"]))
(is (= (config/community-data) "/iplant/home/shared"))
(is (= (config/copy-attribute) "ipc-de-copy-from"))
(is (= (config/bad-chars) "\u0060\u0027\u000A\u0009"))
(is (= (config/max-paths-in-request) 1000))
(is (= (config/anon-user) "anonymous"))
(is (= (config/anon-files-base-url) "https://de.example.org/anon-files/"))
(is (= (config/metadata-base-url) "http://metadata:60000"))
(is (= (config/tree-urls-base-url) "http://tree-urls:60000"))
(is (= (config/kifshare-download-template) "{{url}}/d/{{ticket-id}}/{{filename}}"))
(is (= (config/kifshare-external-url) "http://de.example.org/dl"))
(is (= (config/irods-home) "/iplant/home"))
Expand Down

0 comments on commit 881526c

Please sign in to comment.