diff --git a/app/uk/gov/hmrc/apihubapplications/controllers/EnvironmentParityTestController.scala b/app/uk/gov/hmrc/apihubapplications/controllers/EnvironmentParityTestController.scala deleted file mode 100644 index 18eb8b66..00000000 --- a/app/uk/gov/hmrc/apihubapplications/controllers/EnvironmentParityTestController.scala +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2024 HM Revenue & Customs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package uk.gov.hmrc.apihubapplications.controllers - -import com.google.inject.{Inject, Singleton} -import play.api.libs.json.Json -import play.api.mvc.{Action, AnyContent, ControllerComponents} -import uk.gov.hmrc.apihubapplications.connectors.{APIMConnectorImpl, IdmsConnectorImpl} -import uk.gov.hmrc.apihubapplications.controllers.actions.{HipEnvironmentActionProvider, IdentifierAction} -import uk.gov.hmrc.apihubapplications.models.exception.IdmsException -import uk.gov.hmrc.play.bootstrap.backend.controller.BackendController - -import scala.concurrent.ExecutionContext - -@Singleton -class EnvironmentParityTestController @Inject()( - cc: ControllerComponents, - identify: IdentifierAction, - idmsConnector: IdmsConnectorImpl, - apimConnector: APIMConnectorImpl, - hipEnvironment: HipEnvironmentActionProvider -)(implicit ec: ExecutionContext) extends BackendController(cc) { - - def fetchClientScopes(environmentName: String, clientId: String): Action[AnyContent] = (identify andThen hipEnvironment(environmentName)).async { - implicit request => - idmsConnector.fetchClientScopes(request.hipEnvironment, clientId).map { - case Right(scopes) => Ok(Json.toJson(scopes)) - case Left(e) if e.issue == IdmsException.ClientNotFound => NotFound - case Left(e) => throw e - } - } - - def fetchEgresses(environmentName: String): Action[AnyContent] = (identify andThen hipEnvironment(environmentName)).async { - implicit request => - apimConnector.listEgressGateways(request.hipEnvironment).map { - case Right(egresses) => Ok(Json.toJson(egresses)) - case Left(e) => throw e - } - } - - def fetchDeployments(environmentName: String): Action[AnyContent] = (identify andThen hipEnvironment(environmentName)).async { - implicit request => - apimConnector.getDeployments(request.hipEnvironment).map { - case Right(deployments) => Ok(Json.toJson(deployments)) - case Left(e) => throw e - } - } - -} diff --git a/conf/app.routes b/conf/app.routes index d58f7f47..1eceb671 100755 --- a/conf/app.routes +++ b/conf/app.routes @@ -53,7 +53,3 @@ GET /stats/list-apis-in-production POST /oas/validate uk.gov.hmrc.apihubapplications.controllers.OASController.validateOAS() GET /egresses/gateways/:environmentName uk.gov.hmrc.apihubapplications.controllers.EgressController.listEgressGateways(environmentName: String) - -GET /environment-parity-test/client-scopes/:environmentName/:clientId uk.gov.hmrc.apihubapplications.controllers.EnvironmentParityTestController.fetchClientScopes(environmentName: String, clientId: String) -GET /environment-parity-test/egresses/:environmentName uk.gov.hmrc.apihubapplications.controllers.EnvironmentParityTestController.fetchEgresses(environmentName: String) -GET /environment-parity-test/deployments/:environmentName uk.gov.hmrc.apihubapplications.controllers.EnvironmentParityTestController.fetchDeployments(environmentName: String)