-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ID-787 Get user/self terms of service history. #1254
Conversation
@@ -9,6 +9,7 @@ import org.broadinstitute.dsde.workbench.sam.model.api.SamJsonSupport._ | |||
import org.broadinstitute.dsde.workbench.sam.model.api.SamUser | |||
import org.broadinstitute.dsde.workbench.sam.service.TosService | |||
import org.broadinstitute.dsde.workbench.sam.util.SamRequestContext | |||
import spray.json.DefaultJsonProtocol._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took me forever to figure out i had to import this
src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresDirectoryDAO.scala
Show resolved
Hide resolved
29b9c57
to
39f1d2c
Compare
aa511f1
to
2e131c3
Compare
src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/DirectoryDAO.scala
Outdated
Show resolved
Hide resolved
2f6bee3
to
c075f75
Compare
c075f75
to
db670cb
Compare
src/test/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/MockDirectoryDAO.scala
Outdated
Show resolved
Hide resolved
# Conflicts: # src/main/scala/org/broadinstitute/dsde/workbench/sam/api/TermsOfServiceRoutes.scala # src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresDirectoryDAO.scala # src/main/scala/org/broadinstitute/dsde/workbench/sam/model/SamModel.scala # src/main/scala/org/broadinstitute/dsde/workbench/sam/service/TosService.scala # src/test/scala/org/broadinstitute/dsde/workbench/sam/service/TosServiceSpec.scala
3dc54dd
to
af304ac
Compare
af304ac
to
7bb8b6c
Compare
a7c93fe
to
dba05a7
Compare
@@ -100,7 +107,7 @@ class TosService( | |||
} | |||
|
|||
private def ensureLatestTermsOfService(userId: WorkbenchUserId, samRequestContext: SamRequestContext): IO[SamUserTos] = for { | |||
maybeTermsOfServiceRecord <- directoryDao.getUserTos(userId, samRequestContext) | |||
maybeTermsOfServiceRecord <- directoryDao.getUserTermsOfService(userId, samRequestContext, Option(TosTable.ACCEPT)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more context on this change https://broadinstitute.slack.com/archives/C0DSD41QT/p1701111037789719?thread_ts=1701103991.553039&cid=C0DSD41QT
this endpoint will always return data on the latest acceptance even if the user's latest action was to reject.
src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresDirectoryDAO.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/broadinstitute/dsde/workbench/sam/service/TosService.scala
Outdated
Show resolved
Hide resolved
# Conflicts: # src/main/scala/org/broadinstitute/dsde/workbench/sam/api/TermsOfServiceRoutes.scala # src/main/scala/org/broadinstitute/dsde/workbench/sam/service/UserService.scala # src/test/scala/org/broadinstitute/dsde/workbench/sam/api/MockSamRoutesBuilder.scala
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Ticket: https://broadworkbench.atlassian.net/browse/ID-811
What:
Adds endpoints for getting user_id/self terms of service history. Only admins can grab history for other users besides themselves.
I also renamed Tos -> TermsOfService in a few places for consistency
Also, added the ability to only return the latest terms of service accept/reject vs just returning the latest of either action. When users call the terms of service details endpoint now they will receive info on their latest acceptance even if they rejected most recently.
Why:
Improving tos ergonomics, auditing
How:
Added two endpoints: {user_id}/history and self/history.
PR checklist