From 492ec9dc22e8c5d6184ad51d8579e2c936e5e8a0 Mon Sep 17 00:00:00 2001 From: giventocode <3589801+giventocode@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:29:51 -0400 Subject: [PATCH] removed dummy user default --- .../dataaccess/auth/CloudServiceAuthTokenProvider.scala | 7 ++----- .../scala/thurloe/database/ThurloeDatabaseConnector.scala | 8 +------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/scala/thurloe/dataaccess/auth/CloudServiceAuthTokenProvider.scala b/src/main/scala/thurloe/dataaccess/auth/CloudServiceAuthTokenProvider.scala index ded07c17..2c3b10ba 100644 --- a/src/main/scala/thurloe/dataaccess/auth/CloudServiceAuthTokenProvider.scala +++ b/src/main/scala/thurloe/dataaccess/auth/CloudServiceAuthTokenProvider.scala @@ -17,10 +17,8 @@ trait CloudServiceAuthTokenProvider { * Factory for creating a CloudServiceAuthTokenProvider. */ object CloudServiceAuthTokenProvider { - def createProvider(config: Config): CloudServiceAuthTokenProvider = { - val azureHostingEnabled = isAzureHostingEnabled(config) - - if (azureHostingEnabled) { + def createProvider(config: Config): CloudServiceAuthTokenProvider = + if (isAzureHostingEnabled(config)) { new AzureAuthTokenProvider(config.getConfig("azureHosting")) } else { val gcsConfig = config.getConfig("gcs") @@ -30,7 +28,6 @@ object CloudServiceAuthTokenProvider { new GcpAuthTokenProvider(pem) } - } def isAzureHostingEnabled(config: Config): Boolean = if (config.hasPath("azureHosting.enabled")) { diff --git a/src/main/scala/thurloe/database/ThurloeDatabaseConnector.scala b/src/main/scala/thurloe/database/ThurloeDatabaseConnector.scala index 14c85cb3..b70a3f0d 100644 --- a/src/main/scala/thurloe/database/ThurloeDatabaseConnector.scala +++ b/src/main/scala/thurloe/database/ThurloeDatabaseConnector.scala @@ -74,13 +74,7 @@ case object ThurloeDatabaseConnector extends DataAccess with LazyLogging { val results = samDao.getUserById(userId) val samUser = if (results.isEmpty) { - val dummySamUser = new sam.model.User() - dummySamUser.setGoogleSubjectId(userId) - dummySamUser.setAzureB2CId(userId) - dummySamUser.setId(userId) - - Future.successful(dummySamUser) - //Future.failed(new KeyNotFoundException(userId, "n/a")) + Future.failed(new KeyNotFoundException(userId, "n/a")) } else if (results.size == 1) { // If we get exactly one result we have found the user we want. Future.successful(results.head)