Commit Graph

15 Commits

Author SHA1 Message Date
Mark Paluch
2ac02ddc86 DATAREST-1264 - Adapt to changed forwarded header behavior.
Forwarding headers handling is now centralized in ForwardedHeaderFilter and removed from ServletUriComponentsBuilder. We need to filter requests containing forwarding with ForwardedHeaderFilter.
2018-07-24 12:29:49 +02:00
Oliver Gierke
6ee2b1374a DATAREST-1256 - Upgraded to Spring HATEOAS 0.25.0.BUILD-SNAPSHOT.
Adapted RepositoryRestMvcConfiguration to now create a shared fallback ObjectMapper and avoid to register it as Spring Bean. Adapted test cases that previously were relying on such a bean being present.

Adapted test cases to verify on the correct ALPS document structure (see spring-projects/spring-hateoas#665).
2018-06-20 20:01:57 +02:00
Mark Paluch
5d9dbf1823 DATAREST-1170 - Update copyright years to 2018. 2018-01-09 08:44:14 +01:00
gregory
2c927af0b5 DATAREST-1077 - HAL Browser: Pass request headers in ALL requests
Pass headers from HAL.client on requests so custom request headers aren't lost.
E.g. custom Authorization: bearer <token> headers
2017-05-16 22:24:41 -05:00
Oliver Gierke
b9957d1a6c DATAREST-1008 - Adapt to API changes in Spring Data Commons, Java 8 upgrades and Mockito 2.7. 2017-03-24 11:02:54 +01:00
Mark Paluch
6bb989018c DATAREST-978 - Migrate ticket references in test code to Spring Framework style. 2017-01-13 10:09:53 +01:00
Oliver Gierke
8c1ee5608b DATAREST-964 - Removed deprecated configuration methods in RepositoryRestMvcConfiguration. 2016-12-20 12:10:43 +01:00
Greg Turnquist
015a8a331b DATAREST-941 - Modify existing browser.html
Instead of replacing the HAL Browser's browser.html, take the existing one and alter it inside the build job. This ensures that future updates don't break so horribly.

Related to https://github.com/mikekelly/hal-browser/pull/89 which will provide an explicit token to match, instead of using the closing `</body>` tag.
2016-11-30 18:25:57 +01:00
Oliver Gierke
344c3ac840 DATAREST-863 - Adapt to changes in Accept header lookup in Spring 4.3.
Spring 4.3's HeaderContentNegotiationStrategy switched from looking up the Accept header via the method returning a single (potentially comma separated) one to the method returning multiple headers in the first place. We now added an override of HttpServletRequestWrapper.getHeaders(…) to out custom adapter defaulting the media type to make sure the defaulting is visible and thus the right handler methods are looked up.

That previously missing caused the DelegatingHandlerMapping selecting the redirect to the HAL browser in case a request to the API root was sent without an accept header as the defaulting of the header to application/hal+json wasn't properly exposed anymore and the redirect to the browser — declaring a produces clause of text/html — was not causing any media type mismatch anymore.
2016-08-04 21:15:19 -07:00
Oliver Gierke
3306b5ce40 DATAREST-815 - Tweaked HalBrowser controller implementation to consider proxied requests.
We now use the APIs in place in Spring MVC to make sure we create proper redirects for requests that carry proxy headers so that the redirect target is still going through the proxy.
2016-04-27 15:33:40 +02:00
Oliver Gierke
9e58ab92c5 DATAREST-720 - HAL Browser fragment now considers the context path if set.
Removed some obsolete Maven dependency versions along the way.
2016-04-01 12:59:37 +02:00
Greg Turnquist
be67f3e5b0 DATAREST-627 - HAL Browser now uses JSON Editor view for resources exposing metadata.
In case a link relation's target exposes a profile link (via HTTP HEAD and "Link" response header), we now try to obtain a JSON schema from the target resource and use a custom view based on the JSON Editor library fro non-GET requests.

This creates a customized, user friendly pop-up dialog for data entry with a nice polished look. If there is no profile link, we use a fallback editor for raw JSON input.

Original pull request: #191.
2015-08-31 18:59:15 +02:00
Oliver Gierke
06b6b266db DATAREST-654 - Added suport for internationalization of enum values.
RepositoryRestConfiguration now exposes an option to enable enum value serialization and a nested configuration object to tweak the details.

If enabled, a Jackson serializer and deserializer is registered trying to resolve the enum values from the Spring Data REST resource bundle using the fully-qualified enum value name as key. If no explicitly configured value is configured a default translation is triggered that capitalizes the lowercased value name replacing the underscores with spaces (e.g. PAYMENT_EXPECTED -> Payment expected). This can be opted out of, of course.

On the parsing side the deserializer will also consult the resourcebundle and default translation but also accepting the enum name as is (also opt-outable).

Deprecated non-bean-style accessors for projection and metadata configuration on RepositoryRestConfiguration to make these options tweakable via Spring Boot application properties by default.
2015-08-21 15:22:27 +02:00
Oliver Gierke
7bcf34ce15 DATAREST-565 - HalBrowser controller now uses context-relative redirects. 2015-06-16 15:28:56 +02:00
Oliver Gierke
85ced098c6 DATAREST-293 - Added new module to easily add a HAL browser to Spring Data REST apps.
Added a module that repackages the webjar version of the HAL browser. The repackaging is necessary to be able to control the exposure of the browser dynamically and prevent Spring Boot's auto-exposure of webjars from kicking in.

Tweaked BasePathAwareHandlerMapping to default the Accept header to the one defined in the configuration if none is present in the request or */* is given. This will make sure we default to a JSON dialect in case no header is set.
2015-04-14 18:13:02 +02:00