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. 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) } }