1

When using the package spring-boot-starter-data-rest Spring automatically creates some end-points named /profile for Alps, as follows:

2017-03-08 22:09:12.737  INFO 8663 --- [  restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/profile],methods=[OPTIONS]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.ProfileController.profileOptions()
2017-03-08 22:09:12.738  INFO 8663 --- [  restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/profile],methods=[GET]}" onto org.springframework.http.HttpEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.ProfileController.listAllFormsOfMetadata()
2017-03-08 22:09:12.738  INFO 8663 --- [  restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/profile/{repository}],methods=[GET],produces=[application/schema+json]}" onto public org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.json.JsonSchema> org.springframework.data.rest.webmvc.RepositorySchemaController.schema(org.springframework.data.rest.webmvc.RootResourceInformation)
2017-03-08 22:09:12.738  INFO 8663 --- [  restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/profile/{repository}],methods=[OPTIONS],produces=[application/alps+json]}" onto org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.alps.AlpsController.alpsOptions()
2017-03-08 22:09:12.738  INFO 8663 --- [  restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/profile/{repository}],methods=[GET],produces=[application/alps+json || */*]}" onto org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.RootResourceInformation> org.springframework.data.rest.webmvc.alps.AlpsController.descriptor(org.springframework.data.rest.webmvc.RootResourceInformation)

The problem is that I have a RestRepository entitled profile as well, so I'm going to use those end-points as well.

Question is: how to change the end-point to some other thing? Or even take it off.

Maxim
  • 52,561
  • 27
  • 155
  • 209
Sam
  • 23
  • 1
  • 4
  • I won't see this in my log, but they are there (https://stackoverflow.com/questions/76036083/why-is-this-webmvc-profilecontroller-being-exposed-and-interfering-with-my-stati) – Stefan Falk Apr 17 '23 at 16:41

2 Answers2

2

Stumbled upon the same issue 4 years later, per this bug it appears there's a partial workaround to at least disable the functionality of the endpoints, though the /profile url is still exposed.

JHarnach
  • 3,944
  • 7
  • 43
  • 48
  • 1
    I want to disable ALPS but I am not able to find RepositoryRestConfigurerAdapter in org.springframework.data.rest.webmvc.config I am using spring-boot-starter-data-rest 2.6.1 And included spring-data-rest-webmvc 3.6.0 Please let me know – java_dev Sep 18 '22 at 03:08
  • @java_dev I feel ya.. did you solve this problem somehow? Maybe you can answer https://stackoverflow.com/questions/76036083/why-is-this-webmvc-profilecontroller-being-exposed-and-interfering-with-my-stati – Stefan Falk Apr 17 '23 at 16:46
1

Add following to application.properties file.

endpoints.enabled=false

This will disable all public endpoints provided by spring/actuator.

management.context-path=/public This will append /public to all spring provided endpoints such as /profile.

johncena
  • 102
  • 6