Conversation
Fix Remove CXF from pom.xml Replace authorization License years Fix javadoc and take care or role IbisAdmin License years Restore ApiServlet Exclude com.sun.activation:jakarta.activation Add Spring security dependency Do I want this commit? Fix Spring annotations so that frontend can reach backend again Fix @RolesAllowed annotations Fix dependencies Fix pom.xml Remove unnecessary change Remove unnecessary changes
71d3c64 to
b1a8221
Compare
This reverts commit a7a116d.
|
Toen ik het op dit punt testte zag ik nog de volgende fouten:
Custom report action stack trace: 18-Aug-2025 12:34:03.991 SEVERE [http-nio-80-exec-8] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [spring-mvc-dispatcher] in context with path [] threw exception [Request processing failed: java.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List] with root cause |
There was a problem hiding this comment.
| boolean granted = false; | |
| for(GrantedAuthority grantedAuthority : getAuthentication().getAuthorities()) { | |
| String authorityName = grantedAuthority.getAuthority().substring(5); // Chomp off the AuthorityAuthorizationManager#ROLE_PREFIX | |
| granted = authorityName.equals(role); | |
| if(granted) { | |
| return true; | |
| } | |
| } | |
| return false; |
| import org.springframework.web.context.request.RequestContextHolder; | ||
| import org.springframework.web.context.request.ServletRequestAttributes; | ||
|
|
||
| public abstract class ApiBase implements SecurityContext { |
There was a problem hiding this comment.
Deze class moet weg kunnen.
| @@ -49,23 +54,23 @@ protected <T> T getBean(String beanName) { | |||
| } | |||
|
|
|||
| protected void setSessionAttr(String key, Object value) { | |||
There was a problem hiding this comment.
Ik weet niet waarom je dit zo zou doen, als je sessie scoped variables op wilt slaan moet je een component aanmaken met een @SessionScope.
| @Path("/" + ApiServlet.LADYBUG_API_PATH + "/metadata") | ||
| @RestController | ||
| @RequestMapping("/metadata") | ||
| @RolesAllowed({"IbisDataAdmin", "IbisAdmin", "IbisTester"}) |
There was a problem hiding this comment.
Het lijkt mij dat deze hier niet hoort, je hebt de annotaties ook al op de methodes?
| <dependency> | ||
| <groupId>com.fasterxml.jackson.jakarta.rs</groupId> | ||
| <artifactId>jackson-jakarta-rs-json-provider</artifactId> | ||
| <version>${jackson.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.sun.activation</groupId> | ||
| <artifactId>jakarta.activation</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> |
There was a problem hiding this comment.
Deze dependency kan dan toch ook weg?
| <!-- Makes spring-web a transitive dependency. That one is sufficient to | ||
| build this project, but the project that uses ladybug probably needs | ||
| spring-webmvc. If it is not included as a dependency here, it is | ||
| difficult to ensure that spring-web and spring-webmvc have the same | ||
| version | ||
| --> |
There was a problem hiding this comment.
Daarom gebruik je een bom import, zodat de versies altijd kloppen.
|
Deze bean hoort ook in dit project thuis: |
Co-authored-by: Niels Meijer <nielsmeijer@hotmail.com>
|
Ladybug will be split in three modules to keep JAX-RS. Therefore this PR will be superseded. I won't close it yet to keep easy access to it to copy files. |
|
Superseded by #598. |
No description provided.