From 092f0f676379120fb467dc2b7609508c32c8bd8f Mon Sep 17 00:00:00 2001 From: Tristan Garwood Date: Wed, 28 Aug 2024 14:59:38 -0400 Subject: [PATCH 1/2] ID-1369 Repair cloud access followup: fix swagger --- src/main/resources/swagger/api-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/swagger/api-docs.yaml b/src/main/resources/swagger/api-docs.yaml index 432f2ccc8..d5430a19f 100755 --- a/src/main/resources/swagger/api-docs.yaml +++ b/src/main/resources/swagger/api-docs.yaml @@ -99,7 +99,7 @@ paths: schema: $ref: '#/components/schemas/ErrorReport' /api/admin/v2/user/{userId}/repairCloudAccess: - get: + put: tags: - Admin summary: Ensures that a user's proxy group exists and that it is added to any google groups that it should be in. From ccc6fa22b734fa678d7048586c1a12cc51ca0166 Mon Sep 17 00:00:00 2001 From: Tristan Garwood Date: Wed, 28 Aug 2024 15:17:11 -0400 Subject: [PATCH 2/2] ID-1369 Repair cloud access followup, fix swagger --- .../dsde/workbench/sam/service/UserService.scala | 1 + .../dsde/workbench/sam/service/UserServiceSpec.scala | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/UserService.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/UserService.scala index f7b4fec1a..10c0cf376 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/UserService.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/service/UserService.scala @@ -496,6 +496,7 @@ class UserService( case Some(user) => for { _ <- cloudExtensions.onUserCreate(user, samRequestContext) + _ <- cloudExtensions.onUserEnable(user, samRequestContext) groups <- directoryDAO.listUserDirectMemberships(user.id, samRequestContext) _ <- cloudExtensions.onGroupUpdate(groups, Set(user.id), samRequestContext) } yield IO.pure(()) diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/UserServiceSpec.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/UserServiceSpec.scala index 3e53480ac..8096c8001 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/UserServiceSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/service/UserServiceSpec.scala @@ -747,8 +747,8 @@ class OldUserServiceSpec(_system: ActorSystem) // Run test service.repairCloudAccess(invitedUserId, samRequestContext).unsafeRunSync() - verify(googleExtensions).onUserCreate(SamUser(invitedUserId, registeringUser.googleSubjectId, inviteeEmail, None, true), samRequestContext) - + verify(googleExtensions).onUserCreate(updatedUserInPostgres.get, samRequestContext) + verify(googleExtensions).onUserEnable(updatedUserInPostgres.get, samRequestContext) verify(googleExtensions).onGroupUpdate(Seq(allUsersGroup.id), Set(invitedUserId), samRequestContext) } }