From 359515f346a0b89bc877b507c4df99d52286cab1 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Tue, 25 Jul 2023 09:33:03 -0500 Subject: [PATCH] chore(cleanup): Removing un-implemented dead code --- .../gate/config/OidcClientConfig.java | 31 -------------- .../controllers/OidcConfigController.java | 41 ------------------- .../gate/services/NoopOidcConfigService.java | 32 --------------- .../gate/services/OidcConfigService.java | 26 ------------ 4 files changed, 130 deletions(-) delete mode 100644 gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/OidcClientConfig.java delete mode 100644 gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OidcConfigController.java delete mode 100644 gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/NoopOidcConfigService.java delete mode 100644 gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/OidcConfigService.java diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/OidcClientConfig.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/OidcClientConfig.java deleted file mode 100644 index 30d7cbe502..0000000000 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/OidcClientConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Netflix, Inc. - * - * 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 com.netflix.spinnaker.gate.config; - -import com.netflix.spinnaker.gate.services.NoopOidcConfigService; -import com.netflix.spinnaker.gate.services.OidcConfigService; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class OidcClientConfig { - @Bean - @ConditionalOnMissingBean(OidcConfigService.class) - OidcConfigService noopOidcConfigService() { - return new NoopOidcConfigService(); - } -} diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OidcConfigController.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OidcConfigController.java deleted file mode 100644 index ee4a4cb319..0000000000 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OidcConfigController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2018 Netflix, Inc. - * - * 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 com.netflix.spinnaker.gate.controllers; - -import com.netflix.spinnaker.gate.services.OidcConfigService; -import java.util.List; -import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class OidcConfigController { - @Autowired OidcConfigService oidcConfigService; - - @RequestMapping(value = "/oidcConfigs", method = RequestMethod.GET) - List byApp(@RequestParam(value = "app") String app) { - return oidcConfigService.getOidcConfigs(app); - } - - @RequestMapping(value = "/oidcConfig", method = RequestMethod.GET) - Map byId(@RequestParam(value = "id") String id) { - return oidcConfigService.getOidcConfig(id); - } -} diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/NoopOidcConfigService.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/NoopOidcConfigService.java deleted file mode 100644 index 2229e2cd58..0000000000 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/NoopOidcConfigService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Netflix, Inc. - * - * 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 com.netflix.spinnaker.gate.services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class NoopOidcConfigService implements OidcConfigService { - public List getOidcConfigs(String app) { - return new ArrayList<>(); - } - - public Map getOidcConfig(String id) { - return new HashMap<>(); - } -} diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/OidcConfigService.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/OidcConfigService.java deleted file mode 100644 index 50700c03cc..0000000000 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/OidcConfigService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Netflix, Inc. - * - * 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 com.netflix.spinnaker.gate.services; - -import java.util.List; -import java.util.Map; - -public interface OidcConfigService { - List getOidcConfigs(String app); - - Map getOidcConfig(String id); -}