Skip to content

Commit

Permalink
removed dummy user default
Browse files Browse the repository at this point in the history
  • Loading branch information
giventocode committed Jun 25, 2024
1 parent 862ad57 commit 492ec9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -30,7 +28,6 @@ object CloudServiceAuthTokenProvider {

new GcpAuthTokenProvider(pem)
}
}

def isAzureHostingEnabled(config: Config): Boolean =
if (config.hasPath("azureHosting.enabled")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 492ec9d

Please sign in to comment.