From 55b4fb43c0e30a092551dc607586fa8fcb3ec7a3 Mon Sep 17 00:00:00 2001 From: Ivan Bodrov Date: Thu, 16 Nov 2023 09:37:48 -0500 Subject: [PATCH] concord-server: explicitly bind org resources --- .../concord/server/ConcordServerModule.java | 4 +- .../server/org/OrganizationModule.java | 56 +++++++++++++++++++ .../server/org/OrganizationResource.java | 6 +- .../server/org/ProjectProcessResource.java | 6 +- .../org/inventory/InventoryDataResource.java | 4 -- .../org/inventory/InventoryQueryResource.java | 4 -- .../org/inventory/InventoryResource.java | 4 -- .../org/jsonstore/JsonStoreDataResource.java | 4 -- .../org/jsonstore/JsonStoreQueryResource.java | 4 -- .../org/jsonstore/JsonStoreResource.java | 4 -- .../org/policy/PolicyCheckResource.java | 4 -- .../server/org/policy/PolicyResource.java | 4 -- .../server/org/project/ProjectResource.java | 4 -- .../server/org/project/ProjectResourceV2.java | 4 -- .../org/project/RepositoryResource.java | 4 -- .../org/project/RepositoryResourceV2.java | 4 -- .../server/org/secret/SecretModule.java | 36 ------------ .../server/org/secret/SecretResource.java | 9 +-- .../server/org/secret/SecretResourceV2.java | 6 -- .../org/secret/SecretStoreResource.java | 4 -- .../concord/server/org/team/TeamResource.java | 4 -- .../server/org/triggers/TriggerResource.java | 4 -- .../org/triggers/TriggerV2Resource.java | 5 -- 23 files changed, 63 insertions(+), 125 deletions(-) create mode 100644 server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationModule.java delete mode 100644 server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretModule.java diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/ConcordServerModule.java b/server/impl/src/main/java/com/walmartlabs/concord/server/ConcordServerModule.java index cede7742d6..f852dd721c 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/ConcordServerModule.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/ConcordServerModule.java @@ -34,7 +34,7 @@ import com.walmartlabs.concord.server.console.ConsoleModule; import com.walmartlabs.concord.server.events.EventModule; import com.walmartlabs.concord.server.metrics.MetricModule; -import com.walmartlabs.concord.server.org.secret.SecretModule; +import com.walmartlabs.concord.server.org.OrganizationModule; import com.walmartlabs.concord.server.org.triggers.TriggersModule; import com.walmartlabs.concord.server.policy.PolicyModule; import com.walmartlabs.concord.server.process.ProcessModule; @@ -90,11 +90,11 @@ public void configure(Binder binder) { binder.install(new AuditLogModule()); binder.install(new ConsoleModule()); binder.install(new EventModule()); + binder.install(new OrganizationModule()); binder.install(new PolicyModule()); binder.install(new ProcessModule()); binder.install(new RepositoryModule()); binder.install(new RoleModule()); - binder.install(new SecretModule()); binder.install(new SecurityModule()); binder.install(new TemplateModule()); binder.install(new TriggersModule()); diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationModule.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationModule.java new file mode 100644 index 0000000000..31899ea2c7 --- /dev/null +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationModule.java @@ -0,0 +1,56 @@ +package com.walmartlabs.concord.server.org; + +import com.google.inject.Binder; +import com.google.inject.Module; +import com.walmartlabs.concord.server.org.inventory.InventoryDataResource; +import com.walmartlabs.concord.server.org.inventory.InventoryQueryResource; +import com.walmartlabs.concord.server.org.inventory.InventoryResource; +import com.walmartlabs.concord.server.org.jsonstore.JsonStoreDataResource; +import com.walmartlabs.concord.server.org.jsonstore.JsonStoreQueryResource; +import com.walmartlabs.concord.server.org.jsonstore.JsonStoreResource; +import com.walmartlabs.concord.server.org.policy.PolicyCheckResource; +import com.walmartlabs.concord.server.org.policy.PolicyResource; +import com.walmartlabs.concord.server.org.project.ProjectResource; +import com.walmartlabs.concord.server.org.project.ProjectResourceV2; +import com.walmartlabs.concord.server.org.project.RepositoryResource; +import com.walmartlabs.concord.server.org.project.RepositoryResourceV2; +import com.walmartlabs.concord.server.org.secret.SecretResource; +import com.walmartlabs.concord.server.org.secret.SecretResourceV2; +import com.walmartlabs.concord.server.org.secret.SecretStoreResource; +import com.walmartlabs.concord.server.org.secret.store.SecretStore; +import com.walmartlabs.concord.server.org.secret.store.concord.ConcordSecretStore; +import com.walmartlabs.concord.server.org.team.TeamResource; +import com.walmartlabs.concord.server.org.triggers.TriggerResource; +import com.walmartlabs.concord.server.org.triggers.TriggerV2Resource; + +import static com.google.inject.multibindings.Multibinder.newSetBinder; +import static com.walmartlabs.concord.server.Utils.bindJaxRsResource; + +public class OrganizationModule implements Module { + + @Override + public void configure(Binder binder) { + bindJaxRsResource(binder, InventoryDataResource.class); + bindJaxRsResource(binder, InventoryQueryResource.class); + bindJaxRsResource(binder, InventoryResource.class); + bindJaxRsResource(binder, JsonStoreDataResource.class); + bindJaxRsResource(binder, JsonStoreQueryResource.class); + bindJaxRsResource(binder, JsonStoreResource.class); + bindJaxRsResource(binder, OrganizationResource.class); + bindJaxRsResource(binder, PolicyCheckResource.class); + bindJaxRsResource(binder, PolicyResource.class); + bindJaxRsResource(binder, ProjectProcessResource.class); + bindJaxRsResource(binder, ProjectResource.class); + bindJaxRsResource(binder, ProjectResourceV2.class); + bindJaxRsResource(binder, RepositoryResource.class); + bindJaxRsResource(binder, RepositoryResourceV2.class); + bindJaxRsResource(binder, TeamResource.class); + bindJaxRsResource(binder, TriggerResource.class); + bindJaxRsResource(binder, TriggerV2Resource.class); + + newSetBinder(binder, SecretStore.class).addBinding().to(ConcordSecretStore.class); + bindJaxRsResource(binder, SecretResource.class); + bindJaxRsResource(binder, SecretResourceV2.class); + bindJaxRsResource(binder, SecretStoreResource.class); + } +} diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationResource.java index 2567591e83..427d088b72 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/OrganizationResource.java @@ -31,8 +31,6 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -40,10 +38,8 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @Path("/api/v1/org") -@Tag(name ="Organizations") +@Tag(name = "Organizations") public class OrganizationResource implements Resource { private final OrganizationDao orgDao; diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/ProjectProcessResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/ProjectProcessResource.java index 2d05582fa5..f7337d6f92 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/ProjectProcessResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/ProjectProcessResource.java @@ -48,8 +48,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.*; import javax.ws.rs.core.Context; @@ -64,8 +62,6 @@ import static com.walmartlabs.concord.server.process.state.ProcessStateManager.path; import static javax.ws.rs.core.Response.Status; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "Project Processes") public class ProjectProcessResource implements Resource { @@ -349,7 +345,7 @@ private UUID getRepoId(UUID projectId, String repoName) { private Response processFinished(PartialProcessKey processKey) { return responseTemplates.processFinished(Response.ok(), - Collections.singletonMap("instanceId", processKey.getInstanceId())) + Collections.singletonMap("instanceId", processKey.getInstanceId())) .build(); } diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryDataResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryDataResource.java index 36ae119350..bfaf29622d 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryDataResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryDataResource.java @@ -32,8 +32,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.io.IOException; @@ -41,8 +39,6 @@ import java.util.Map; import java.util.UUID; -@Named -@Singleton @Path("/api/v1/org") @Deprecated @Tag(name = "Inventory Data") diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryQueryResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryQueryResource.java index 479bd26904..60e5237f88 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryQueryResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryQueryResource.java @@ -31,8 +31,6 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -41,8 +39,6 @@ import java.util.UUID; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/org") @Deprecated @Tag(name = "Inventory Queries") diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryResource.java index 12954ac74d..6661982ab6 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/inventory/InventoryResource.java @@ -34,8 +34,6 @@ import org.sonatype.siesta.Validate; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -43,8 +41,6 @@ import java.util.UUID; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/org") @Deprecated @Tag(name = "Inventories") diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreDataResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreDataResource.java index 3b30a5b33d..2bd8995a50 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreDataResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreDataResource.java @@ -27,14 +27,10 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.util.List; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "JsonStoreData") public class JsonStoreDataResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreQueryResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreQueryResource.java index 12a8857aa5..834e0fa5cb 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreQueryResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreQueryResource.java @@ -31,16 +31,12 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.util.List; import java.util.Map; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "JsonStoreQuery") public class JsonStoreQueryResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreResource.java index 0354cbb04e..e4e30e3246 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/jsonstore/JsonStoreResource.java @@ -31,8 +31,6 @@ import org.sonatype.siesta.Validate; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -40,8 +38,6 @@ import java.util.Collection; import java.util.List; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "JsonStore") public class JsonStoreResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyCheckResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyCheckResource.java index 4741ffb58d..d8e31b95cb 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyCheckResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyCheckResource.java @@ -37,14 +37,10 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.util.UUID; -@Named -@Singleton @Path("/api/v1") @Tag(name = "PolicyCheck") public class PolicyCheckResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyResource.java index 260d813983..79a917a23c 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/policy/PolicyResource.java @@ -45,8 +45,6 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -56,8 +54,6 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @Path("/api/v2/policy") @Tag(name = "Policy") public class PolicyResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResource.java index ff30ef2c77..bdb7c0a238 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResource.java @@ -35,8 +35,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -44,8 +42,6 @@ import java.util.*; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "Projects") public class ProjectResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResourceV2.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResourceV2.java index 7db0a2cd5b..c9006c55d5 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResourceV2.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/ProjectResourceV2.java @@ -27,16 +27,12 @@ import org.sonatype.siesta.Validate; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -@Named -@Singleton @Path("/api/v2/org") @Tag(name = "Projects") public class ProjectResourceV2 implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResource.java index 5b7ede1681..e6b38df5aa 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResource.java @@ -35,8 +35,6 @@ import org.sonatype.siesta.Validate; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -44,8 +42,6 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "Repositories") public class RepositoryResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResourceV2.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResourceV2.java index 7e11ef4052..3d255dbf32 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResourceV2.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/project/RepositoryResourceV2.java @@ -28,8 +28,6 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -38,8 +36,6 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @Path("/api/v2/repository") @Tag(name = "RepositoriesV2") public class RepositoryResourceV2 implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretModule.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretModule.java deleted file mode 100644 index 87cc8b63f7..0000000000 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretModule.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.walmartlabs.concord.server.org.secret; - -/*- - * ***** - * Concord - * ----- - * Copyright (C) 2017 - 2023 Walmart 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. - * ===== - */ - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.walmartlabs.concord.server.org.secret.store.SecretStore; -import com.walmartlabs.concord.server.org.secret.store.concord.ConcordSecretStore; - -import static com.google.inject.multibindings.Multibinder.newSetBinder; - -public class SecretModule implements Module { - - @Override - public void configure(Binder binder) { - newSetBinder(binder, SecretStore.class).addBinding().to(ConcordSecretStore.class); - } -} diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResource.java index 2e041d806f..d361fd4e24 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResource.java @@ -48,8 +48,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -61,8 +59,6 @@ import java.util.*; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "Secrets") public class SecretResource implements Resource { @@ -117,7 +113,7 @@ public SecretOperationResponse create(@PathParam("orgName") @ConcordKey String o String storePwd = SecretResourceUtils.getOrGenerateStorePassword(input, generatePwd); SecretVisibility visibility = SecretResourceUtils.getVisibility(input); - Set projectIds = getProjectIds( + Set projectIds = getProjectIds( org.getId(), MultipartUtils.getUUIDList(input, Constants.Multipart.PROJECT_IDS), MultipartUtils.getStringList(input, Constants.Multipart.PROJECT_NAMES), @@ -364,8 +360,9 @@ private UUID getProjectIdFromName(UUID orgId, String projectName) { } return id; } + private UUID getProject(UUID orgId, UUID id, String name) { - if (id == null && ( name != null && !name.trim().isEmpty()) ) { + if (id == null && (name != null && !name.trim().isEmpty())) { id = projectDao.getId(orgId, name); if (id == null) { throw new ValidationErrorsException("Project not found: " + name); diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResourceV2.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResourceV2.java index a3deda4e44..515363b197 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResourceV2.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretResourceV2.java @@ -32,9 +32,7 @@ import com.walmartlabs.concord.server.org.project.ProjectDao; import com.walmartlabs.concord.server.sdk.ConcordApplicationException; import com.walmartlabs.concord.server.sdk.metrics.WithTimer; -import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.parameters.RequestBody; @@ -45,8 +43,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.io.IOException; @@ -54,8 +50,6 @@ import java.util.*; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v2/org") @Tag(name = "SecretsV2") public class SecretResourceV2 implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretStoreResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretStoreResource.java index 685991e5bd..e035cc6612 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretStoreResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/secret/SecretStoreResource.java @@ -25,8 +25,6 @@ import org.sonatype.siesta.Resource; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -34,8 +32,6 @@ import java.util.List; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/secret/store") @Tag(name = "Secret stores") public class SecretStoreResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/team/TeamResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/team/TeamResource.java index 529726af9f..3f7757e250 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/team/TeamResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/team/TeamResource.java @@ -20,7 +20,6 @@ * ===== */ -import com.google.inject.Singleton; import com.walmartlabs.concord.common.validation.ConcordKey; import com.walmartlabs.concord.server.GenericOperationResult; import com.walmartlabs.concord.server.OperationResult; @@ -36,7 +35,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; import javax.validation.Valid; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -45,8 +43,6 @@ import java.util.UUID; import java.util.stream.Collectors; -@Named -@Singleton @Path("/api/v1/org") @Tag(name = "Teams") public class TeamResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerResource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerResource.java index 031b16ca6e..96970f53d2 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerResource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerResource.java @@ -42,8 +42,6 @@ import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PathParam; @@ -53,8 +51,6 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @javax.ws.rs.Path("/api/v1/org") @Tag(name = "Triggers") public class TriggerResource implements Resource { diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerV2Resource.java b/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerV2Resource.java index d13df58b0c..2dea622904 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerV2Resource.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/org/triggers/TriggerV2Resource.java @@ -25,14 +25,11 @@ import com.walmartlabs.concord.server.org.ResourceAccessLevel; import com.walmartlabs.concord.server.org.project.*; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.sonatype.siesta.Resource; import org.sonatype.siesta.ValidationErrorsException; import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -41,8 +38,6 @@ import java.util.List; import java.util.UUID; -@Named -@Singleton @Path("/api/v2/trigger") @Tag(name = "TriggersV2") public class TriggerV2Resource implements Resource {