-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling ALPS does not remove the profile link [DATAREST-1119] #1480
Comments
Jeroen Reijn commented I'll be working on adding tests, fixing my formatting, etc |
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 Please let me know |
This issue looks familiar (see stackoverflow question). I've tried: @Override
public void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config, CorsRegistry cors
) {
config.disableDefaultExposure();
config.getMetadataConfiguration().setAlpsEnabled(false);
} but the endpoint is still exposed and interfering with my web-application routes.. |
any update on this? |
Does anyone have a solution to this problem? 🤔 I'm skeptical that it's intended to always have an OPTIONAL (source (https://datatracker.ietf.org/doc/html/draft-kelly-json-hal#name-profile)) link object in the responses. Even if you disable ALPS, I fail to see the purpose of the configuration in that case. Any insights or solutions would be appreciated. Before disabling ALPS: {
"_embedded": {
// EXCLUDED
},
"_links": {
"self": {
"href": "http://localhost:8080/data/item?page=0&size=20"
},
"profile": {
"href": "http://localhost:8080/data/profile/item"
}
},
"page": {
"size": 20,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
} After: {
"_embedded": {
// EXCLUDED
},
"_links": {
"self": {
"href": "http://localhost:8080/data/item?page=0&size=20"
},
"profile": {
"href": "http://localhost:8080/data/profile/item"
}
},
"page": {
"size": 20,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
} As you can see the responses are identical. The only difference is visible if I visit: |
Same problem. |
Jeroen Reijn opened DATAREST-1119 and commented
In my project, we tried disabling ALPS, but this seems to be only partly possible.
For disabling ALPS we used a RepositoryRestConfigurerAdapter like:
After a restart/redeploy we still see the profile link in the api root response:
If you actually go to the profile URL it also still works and you will see link relations for the exposed repositories, but when you navigate to one of the exposed repository profile relations a 404 response is returned. I'm not sure if this is wanted behavior, but I would have expected the link relation to disappear from the root response as well, unless other profiles can be configured, but I'm not aware of that
Affects: 2.6.6 (Ingalls SR6)
Referenced from: pull request #280
The text was updated successfully, but these errors were encountered: