From 8c6c2a159e34a0f07ac4ba1627fb7644bbd43e42 Mon Sep 17 00:00:00 2001 From: davidrymer97 <45938671+Davidrymer97@users.noreply.github.com> Date: Thu, 27 Aug 2020 10:43:29 +0100 Subject: [PATCH] changed references to allowlist --- .../userinfo/config/APIAccessConfig.scala | 4 ++-- .../userinfo/domain/APIDefinition.scala | 2 +- test/it/PlatformIntegrationISpec.scala | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/uk/gov/hmrc/openidconnect/userinfo/config/APIAccessConfig.scala b/app/uk/gov/hmrc/openidconnect/userinfo/config/APIAccessConfig.scala index 102de6e..9a9f1a6 100644 --- a/app/uk/gov/hmrc/openidconnect/userinfo/config/APIAccessConfig.scala +++ b/app/uk/gov/hmrc/openidconnect/userinfo/config/APIAccessConfig.scala @@ -29,11 +29,11 @@ case class APIAccessVersions(versionConfigs: Option[ConfigObject]) { val accessType = if (value.hasPath("type")) value.getString("type") else "PRIVATE" val status = if (value.hasPath("status")) value.getString("status") else throw new IllegalArgumentException("Status missing") - val whiteListedApplicationIds = if (value.hasPath("white-list.applicationIds")) Some(value.getStringList("white-list.applicationIds").asScala.toList) else None + val allowListedApplicationIds = if (value.hasPath("white-list.applicationIds")) Some(value.getStringList("white-list.applicationIds").asScala.toList) else None val endpointsEnabled = if (value.hasPath("endpointsEnabled")) value.getBoolean("endpointsEnabled") else false val versionNumber = version.replace('_', '.') - new APIAccessConfig(versionNumber, status, accessType, endpointsEnabled, whiteListedApplicationIds.getOrElse(List())) + new APIAccessConfig(versionNumber, status, accessType, endpointsEnabled, allowListedApplicationIds.getOrElse(List())) } } diff --git a/app/uk/gov/hmrc/openidconnect/userinfo/domain/APIDefinition.scala b/app/uk/gov/hmrc/openidconnect/userinfo/domain/APIDefinition.scala index e924c60..d4773f2 100644 --- a/app/uk/gov/hmrc/openidconnect/userinfo/domain/APIDefinition.scala +++ b/app/uk/gov/hmrc/openidconnect/userinfo/domain/APIDefinition.scala @@ -16,4 +16,4 @@ package uk.gov.hmrc.openidconnect.userinfo.domain -case class APIAccess(`type`: String, whitelistedApplicationIds: Option[Seq[String]]) +case class APIAccess(`type`: String, allowlistedApplicationIds: Option[Seq[String]]) diff --git a/test/it/PlatformIntegrationISpec.scala b/test/it/PlatformIntegrationISpec.scala index a145516..d7a2ce9 100644 --- a/test/it/PlatformIntegrationISpec.scala +++ b/test/it/PlatformIntegrationISpec.scala @@ -71,21 +71,21 @@ class PlatformIntegrationISpec (implicit val wsClient: WSClient) extends BaseFea versions.value.foreach { version => (version \ "version").get.as[String] match { case "1.0" => - val (status, endpointsEnabled, accessType, whitelistIds) = extractVersionToVerify(version) + val (status, endpointsEnabled, accessType, allowlistIds) = extractVersionToVerify(version) status shouldBe "STABLE" endpointsEnabled shouldBe true accessType shouldBe "PRIVATE" - whitelistIds.size shouldBe 3 - whitelistIds should contain ("649def0f-3ed3-4df5-8ae1-3e687a9143ea") - whitelistIds should contain ("df8c10db-01fb-4543-b77e-859267462231") - whitelistIds should contain ("9a32c713-7741-4aae-b39d-957021fb97a9") + allowlistIds.size shouldBe 3 + allowlistIds should contain ("649def0f-3ed3-4df5-8ae1-3e687a9143ea") + allowlistIds should contain ("df8c10db-01fb-4543-b77e-859267462231") + allowlistIds should contain ("9a32c713-7741-4aae-b39d-957021fb97a9") case "1.1" => - val (status, endpointsEnabled, accessType, whitelistIds) = extractVersionToVerify(version) + val (status, endpointsEnabled, accessType, allowlistIds) = extractVersionToVerify(version) status shouldBe "BETA" endpointsEnabled shouldBe false accessType shouldBe "PRIVATE" - whitelistIds.size shouldBe 1 - whitelistIds should contain ("649def0f-3ed3-4df5-8ae1-3e687a9143ea") + allowlistIds.size shouldBe 1 + allowlistIds should contain ("649def0f-3ed3-4df5-8ae1-3e687a9143ea") case versionId => fail(s"An unknown version is found $versionId") } } @@ -96,11 +96,11 @@ class PlatformIntegrationISpec (implicit val wsClient: WSClient) extends BaseFea val status = (version \ "status").get.as[String] val endpointsEnabled = (version \ "endpointsEnabled").get.as[Boolean] val accessType = (version \ "access" \ "type").get.as[String] - val whitelistIds = (version \ "access" \ "whitelistedApplicationIds") match { + val allowlistIds = (version \ "access" \ "allowlistedApplicationIds") match { case JsDefined(arr: JsArray) => arr.value.map(_.as[String]).toList - case _ => fail("Invalid whitelisted Application Ids definition") + case _ => fail("Invalid allowlisted Application Ids definition") } - (status, endpointsEnabled, accessType, whitelistIds) + (status, endpointsEnabled, accessType, allowlistIds) } }