diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java
index 7feb37c0af..1970676d18 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java
@@ -41,7 +41,7 @@ public class SecurityConfig {
* This routerFunction is required to map /public/** endpoints to the src/main/resources/public folder
* This is to allow static resources to be served by the server. Couldn't find an easier way to do this,
* hence using RouterFunctions to implement this feature.
- *
+ *
* Future folks: Please check out links:
* - https://www.baeldung.com/spring-webflux-static-content
* - https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-config-static-resources
@@ -80,7 +80,7 @@ public class SecurityConfig {
user.setEmail("api_user");
user.setName("api_user");
user.setPassword(passwordEncoder().encode("8uA@;&mB:cnvN~{#"));
- user.setRoles(Set.of(new Role(Security.USER_ROLE.toString())));
+ user.setRoles(Set.of(new Role(Security.USER_ROLE)));
return new MapReactiveUserDetailsService(user);
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java
index 20d4a87b8a..a476cade83 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java
@@ -11,4 +11,5 @@ public class FieldName {
public static String CONFIG = "config";
public static String PLUGIN = "plugin";
public static String DEFAULT_PAGE_NAME = "Home";
+ public static String TYPE = "type";
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java
index 50228d8bee..ee2aecdda1 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java
@@ -7,16 +7,19 @@ import com.appsmith.server.services.CrudService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
+import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import reactor.core.publisher.Mono;
import javax.validation.Valid;
+import java.util.List;
@RequiredArgsConstructor
@Slf4j
@@ -33,9 +36,9 @@ public abstract class BaseController> getAll() {
+ public Mono>> getAll(@RequestParam MultiValueMap params) {
log.debug("Going to get all resources");
- return service.get().collectList()
+ return service.get(params).collectList()
.map(resources -> new ResponseDTO<>(HttpStatus.OK.value(), resources, null));
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java
index caffb5bfff..828b3c30af 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java
@@ -8,14 +8,18 @@ import com.appsmith.server.dtos.ResponseDTO;
import com.appsmith.server.services.PluginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import javax.validation.Valid;
+import java.util.List;
@RestController
@@ -41,4 +45,10 @@ public class PluginController extends BaseController new ResponseDTO<>(HttpStatus.CREATED.value(), organization, null));
}
+ @GetMapping("")
+ @Override
+ public Mono>> getAll(@RequestParam MultiValueMap params) {
+ return service.get(params).collectList()
+ .map(resources -> new ResponseDTO<>(HttpStatus.OK.value(), resources, null));
+ }
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java
index 1897f1ac10..04ddbd3822 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java
@@ -18,6 +18,7 @@ public class Plugin extends BaseDomain {
String name;
+ @Indexed
PluginType type;
@Indexed(unique = true)
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java
index a3c2872959..40df104cb6 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java
@@ -1,5 +1,5 @@
package com.appsmith.server.domains;
public enum PluginType {
- DB, REST
+ DB, API
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageNameIdDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageNameIdDTO.java
index 1e53c7c48c..fab65b2ca6 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageNameIdDTO.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageNameIdDTO.java
@@ -1,7 +1,7 @@
package com.appsmith.server.dtos;
public interface PageNameIdDTO {
- public String getId();
+ String getId();
- public String getName();
+ String getName();
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java
index c0533514e0..da5cf849bc 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java
@@ -39,7 +39,7 @@ public enum AppsmithError {
private Integer appErrorCode;
private String message;
- private AppsmithError(Integer httpErrorCode, Integer appErrorCode, String message, Object... args) {
+ AppsmithError(Integer httpErrorCode, Integer appErrorCode, String message, Object... args) {
this.httpErrorCode = httpErrorCode;
this.appErrorCode = appErrorCode;
MessageFormat fmt = new MessageFormat(message);
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/filters/AclFilter.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/filters/AclFilter.java
index 66e99a2d50..d79dcb11a7 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/filters/AclFilter.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/filters/AclFilter.java
@@ -30,10 +30,10 @@ public class AclFilter implements WebFilter {
* The parameters are:
* 1. HTTP Method - GET, POST etc.
* 2. Resource being accessed - layouts, pages , etc
- *
+ *
* The ACL policy filters user access based on the permissions that the user has and the resource they are trying
* to access
- *
+ *