Skip to content

Commit

Permalink
Merge pull request #301 from ianmcorvidae/logins-listing
Browse files Browse the repository at this point in the history
Use ListLoginsResponse from common-swagger-api rather than one only here
  • Loading branch information
ianmcorvidae authored Feb 13, 2025
2 parents d86968f + 6121cc1 commit 78753e0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[org.cyverse/cyverse-groups-client "0.1.9"]
[org.cyverse/common-cfg "2.8.3"]
[org.cyverse/common-cli "2.8.2"]
[org.cyverse/common-swagger-api "3.4.8"]
[org.cyverse/common-swagger-api "3.4.9"]
[org.cyverse/kameleon "3.0.10"
:exclusion [com.impossibl.pgjdbc-ng/pgjdbc-ng]]
[com.impossibl.pgjdbc-ng/pgjdbc-ng "0.8.9"]
Expand Down
2 changes: 1 addition & 1 deletion src/terrain/routes/bootstrap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

(GET "/" []
:query [params schema/LoginsParams]
:return schema/LoginsResponse
:return sessions-schema/ListLoginsResponse
:summary "Logins Listing"
:description "This endpoint lists information about recent logins by the authenticated user, for display purposes."
(ok (apps-client/list-logins (:limit params)))))))
14 changes: 0 additions & 14 deletions src/terrain/routes/schemas/bootstrap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,3 @@

(defschema LoginsParams
{:limit (describe Int "The number of results to return")})

(defschema Login
;; NOTE: other schemas are inconsistent about hyphens vs. underscores
;; This schema uses underscores for both of these fields, which means that the
;; IP address is under a slightly different key in this case. I believe this is
;; the only endpoint _response_ that includes an IP address, however.
{:login_time
(describe Long "Login time as milliseconds since the epoch")

(optional-key :ip_address)
(describe String "The IP address associated with the login, if available")})

(defschema LoginsResponse
{:logins [Login]})

0 comments on commit 78753e0

Please sign in to comment.