Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
You can find all the necessary information on Spring REST services in the Spring documentation.
Prerequisites
This guide assumes you have already created a Maven project withatoti-server-extension-parent as described in the Atoti Server Extension reference.1. Create a custom REST service
Since Atoti Server Extension is a Spring Boot application, you can create a custom REST service by creating a Spring@RestController class.
2. Secure the REST service
You need to create a security configuration that defines which users can access your custom endpoints. This is done by creating aSecurityFilterChain bean, you can find more information on Atoti endpoint security here.
- The
@Orderannotation determines when this security filter chain is evaluated. Lower values have higher priority. Use a value between the standard Atoti filter chains (e.g., 20). - The
@Lazy(false)annotation ensures the security configuration is loaded at application startup. - Use
http.securityMatcher("/your-path/**")to specify which endpoints this configuration applies to. - Use
http.authorizeHttpRequests()to define authorization rules:.hasRole("ADMIN")- requires the user to have the ADMIN role.permitAll()- allows unauthenticated access.authenticated()- requires any authenticated user
- The
MachineToMachineSecurityDsl.Scope.SECURITYscope applies authentication and authorization filters.
3. Register the REST service and security configuration
To register your custom REST service and its security configuration, you need to import both in your@AutoConfiguration class see.