Why there is no #FeignClient annotation in feign client template in OpenApi - openapi

Straight to the point -> anybody knows why this template file does not have #FeignClient annotation?
Problem is we would like to use #EnableFeignClients annotation in our configuration, but seems like without #FeignClient anootations in generated clients we are forced to create client beans explicitly.

Related

Apache Shiro: How do I add a new annotation method interceptor into the mix?

I am looking at this class: https://shiro.apache.org/static/1.3.1/xref/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.html
It is registering all method interceptors that work with Shiro. Among them is this interceptor:
PermissionAnnotationMethodInterceptor .
I want to create my own custom interceptor and integrate it into the Shiro model.
My own interceptor would be replacing the existing PermissionAnnotationMethodInterceptor.
How do I do it in a clean programmatic Spring Boot way?
You should be able to replace the AuthorizationAttributeSourceAdvisor bean with your own implementation
Or implement your own annotations anyway you want and disable Shiro's annotation processing: shiro.annotations.enabled=false

How to implement a Spring Rest client

Spring contains some nice guide how to setup a simple service for a pojo/data repository based on JPA. Unfortunately I can not find the client side implementation or a good example how to access this service via Java itself. In the example there is only shown basic curl access. Maybe I am missing some fundamental basics but in the WEB I only found some basic Rest examples and also a consuming guide by Spring itself. IMHO these are quite low level, I am looking for a more sophisticated annotation driven implementation possibility.
Why not look at Feign in the context of spring-cloud. It is an declarative Rest client that is originally developed at netflix and has become part of spring-cloud. It also nicely integrates some service discovery solutions that are available in the spring-cloud context.
http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign
Feign is a declarative web service client. It makes writing web
service clients easier. To use Feign create an interface and annotate
it. It has pluggable annotation support including Feign annotations
and JAX-RS annotations. Feign also supports pluggable encoders and
decoders. Spring Cloud adds support for Spring MVC annotations and for
using the same HttpMessageConverters used by default in Spring Web.
Spring Cloud integrates Ribbon and Eureka to provide a load balanced
http client when using Feign.
A feign client could look like this:
#FeignClient("stores")
public interface StoreClient {
#RequestMapping(method = RequestMethod.GET, value = "/stores")
List<Store> getStores();
#RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")
Store update(#PathVariable("storeId") Long storeId, Store store);
}

Autogenerated REST endpoint from Hibernate?

I have a very simple service project (SpringBootApplication) that exposes a REST endpoint via a Spring Boot controller class. The controller maps an /events endpoint that converts a simple incoming event DTO into a slightly different event entity object that is then persisted in a database via a org.springframework.data.repository.CrudRepository instance.
In my controller, I am only mapping the POST operator because I don't want my clients to be able to GET, PUT or DELETE data from the service.
During a security scan today, I discovered that the service is exposing a /eventsEntities endpoint, which appears to be mapping all of the CrudRepository verbs into the REST endpoint.
Any idea how I managed to enable this automatic endpoint and more importantly, how to disable it? I'm using Spring Boot 1.2.2.
After some additional digging, I realized that I had inadvertently included org.springframework.boot:spring-boot-starter-data-rest in my compile dependencies. That starter includes spring-data-rest-webmvc, which exposes JPA data over REST. Removing that dependency resolved the issue.
Hope my realization helps someone else in the future.

GWT RequestFactory and GWT Designer compatibility issue

I recently upgraded my project from GWT RPC to GWT RequestFactory, my UI uses alot DTO classes that was pure java classes, but now I upgrade them to entityproxy.
Now gwt designer is complaining that the entity class(JPA Entity) present in locator is illegal.I also use Gucie in locator to inject service implementation.
How could I fix this.
thx.
Like LPD said, provide more details. Some details are important to understand why it doesn't work.
"Java doesn't work, please help" -> you know the feeling.
For a given entity, you could post the entity class itself, the related proxy, parts of the service methods and annotations, as well as your relevant parts of your locator and request context class.
Go through this check list:
Check your annotations (ProxyFor, etc.)
Check your RequestContext and its annotations
Check your services definition.
Ensure that your service, locator definitions are in sync with what is specified in the RequestContext.

How can I access SecurityContext programmatically but not through annotation in CXF JAX-RS?

I'm trying to access the javax.ws.rs.core.SecurityContext in my class programmatically and not using #Context annotations, is a way to do it?
e.g. Spring provide implementation like SecurityContextHolder.getContext() that get the object from the ThreadLocal; is there similar implementation available in CXF JAX-RS?