Commit Graph

51 Commits

Author SHA1 Message Date
Phillip Webb
6963bd884b Merge branch '3.2.x' 2024-04-18 12:53:26 -07:00
Brian Clozel
647a5ec6be Deprecate framework-specific @*Endpoint annotations
Prior to this commit, applications could declare Actuator Endpoints
using web framework-specific annotations, such as `@ServletEndpoint`,
@ControllerEndpoint and @RestControllerEndpoint.

Such annotations are closely tied to the programming model of specific
web technologies, such as Servlet or Spring MVC. Unlike other
`@Endpoint` support, they are not portable and will not work
transparently over blocking/reactive and transports.

Because of the strong adherence of this support with the underlying
infrastructure, it makes it impossible to evolve the implementation of
Actuator support without breaking this use case. The reference
documentation has been advocating for using `@Endpoint` and
`@*Operation` for custom endpoints for a long time now.

This commit deprecates this specific support in favor of the recommended
approach.

Closes gh-31768
2024-04-15 18:58:52 +02:00
Phillip Webb
28b5b7a218 Merge branch '3.0.x' into 3.1.x 2023-07-18 10:32:01 +01:00
Phillip Webb
9d91dbc4e5 Use explicit matchers following Spring Security 6.0.5 upgrade
See gh-36293
2023-07-18 10:31:41 +01:00
Phillip Webb
30cc2a48c7 Merge branch '3.0.x' into 3.1.x 2023-07-18 10:16:56 +01:00
Phillip Webb
0233178855 Use explicit matchers following Spring Security 6.0.5 upgrade
See gh-36293
2023-07-18 09:49:11 +01:00
Phillip Webb
00dc942e94 Migrate to Spring Security lambda config
Closes gh-35011
2023-04-14 17:39:48 -07:00
Phillip Webb
c4de86c244 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:17:57 -08:00
Phillip Webb
df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Madhura Bhave
ce3c933f77 Adapt to Spring Security changes
Closes gh-32604
2022-10-19 11:46:27 -07:00
Brian Clozel
5fb2a50ad0 Adapt build dependencies to httpclient5
As htttpclient 4.x is not supported anymore by `RestTemplate`, this
commit changes such dependencies to httpclient5 instead. In some cases,
the httpclient 4.x was transitively brought by a non-Spring dependency.

See gh-32461
2022-09-29 18:55:41 +02:00
Vedran Pavic
230f2cda84 Migrate to AuthorizationFilter in Spring Security auto-config
This commit updates Servlet based Spring Security auto-configuration
to use AuthorizationFilter, which is intended to supersede
FilterSecurityInterceptor.

See gh-31255
2022-09-22 13:53:54 +01:00
Phillip Webb
22144987e9 Update copyright year of changed files 2022-07-29 12:10:03 +01:00
Andy Wilkinson
4bd3534b7d Adapt to change in Security's filtering behavior
Spring Security now filters every dispatch by default and not only
once-per-request. Security configuration has been updated in a number of
places to restore the old behavior as needed for the tests to pass.
gh-31703 has been opened to review this and to investigate if we can
now remove the error page security filter and rely on the filtering of
every dispatch instead.

In addition to switching to once-per-request filtering where needed,
this commit also restructures the configuration of the error page
security filter. The restructuring was necessary to ensure that the
privilege evaluator bean has been defined before the conditions on the
error page security filter are evaluated. Without the change, the filter
was no longer being configured as the privilege evaluator hadn't been
defined before the on bean condition was evaluated. We may want to back
port this change as the ordering doesn't appear to have been defined
before and we were just getting lucky.

See gh-31622
See spring-projects/spring-security#11466
2022-07-13 12:09:46 +01:00
Andy Wilkinson
e9136e023b Adapt to trailing slashes no longer being matched by default
See gh-31563
2022-07-07 14:16:20 +01:00
Andy Wilkinson
b871a1e457 Merge branch '2.7.x' 2022-04-12 08:51:47 +01:00
Andy Wilkinson
48f8021d88 Migrate @Local*Port annotations to spring-boot-test
Closes gh-29589
2022-04-12 08:48:43 +01:00
Madhura Bhave
48a6470ddb Merge branch '2.7.x' into main 2021-12-17 17:51:48 -08:00
Madhura Bhave
d9d161cd6b Allow previously authorized users to access the error page
Prior to this commit, the `ErrorPageSecurityFilter` verified if
access to the error page was allowed by invoking the
`WebInvocationPrivilegeEvaluator` with the Authentication from the
`SecurityContextHolder`.
This meant that access to the error page was denied for a `null` Authentication
 or `AnonymousAuthenticationToken` in cases where the error page required
authenticated access. This prevented authorized users from accessing the
error page in case the Authentication wasn't retrievable for the error dispatch,
which is the case for `@Transient` authentication or stateless session policy.

This commit updates the `ErrorPageSecurityFilter` to check access to the error page
only if the error is an authn or authz error in cases where an authentication object
is not found in the SecurityContextHolder. This makes the error response consistent
when bad credentials or no credentials are used while also allowing access to previously
authorized users.

Fixes gh-28953
2021-12-17 16:58:58 -08:00
Andy Wilkinson
fe7b13ec46 Upgrade to Spring Framework 6 and Jakarta EE 9
Closes gh-28619
Closes gh-28620
Closes gh-28621
Closes gh-28622
Closes gh-28623
Closes gh-28624
Closes gh-28625
Closes gh-28626
Closes gh-28627
Closes gh-28628
Closes gh-28629
Closes gh-28630
Closes gh-28631
Closes gh-28632
Closes gh-28633
Closes gh-28634
Closes gh-28635
Closes gh-28636
Closes gh-28638
Closes gh-28639
Closes gh-28640
Closes gh-28644
Closes gh-28645
Closes gh-28650
Closes gh-28711
Closes gh-28866
Closes gh-28867
Closes gh-28868
Closes gh-28872

See gh-28641
See gh-28642
See gh-28643
See gh-28646
See gh-28647
See gh-28648
See gh-28649
See gh-28721
See gh-28869
See gh-28871
2021-11-30 20:32:16 +00:00
Andy Wilkinson
85f9949513 Remove support for Jolokia
Closes gh-28704
2021-11-30 15:55:47 +00:00
Phillip Webb
beb68671bb Update copyright year of changed files 2021-11-24 10:23:32 -08:00
Phillip Webb
b6d0b44703 Fix @SuppressWarnings 2021-11-18 17:26:18 -08:00
Madhura Bhave
dd1d1482dc Deny unauthorized access to the error page
Fixes gh-26356

Co-authored-by Andy Wilkinson <wilkinsona@vmware.com>
2021-11-18 15:41:38 -08:00
Andy Wilkinson
5e4a502b2d Merge branch '2.4.x' into 2.5.x
Closes gh-28661
2021-11-12 20:31:25 +00:00
Andy Wilkinson
2cec3971d7 Prohibit unwanted dependencies in all modules not just starters
Closes gh-28658
2021-11-12 20:04:35 +00:00
Andy Wilkinson
db781a0d84 Merge branch '2.4.x'
See gh-25077
2021-02-02 15:14:18 +00:00
Andy Wilkinson
788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
2021-02-02 15:12:27 +00:00
Andy Wilkinson
67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb
d8b6960997 Merge branch '2.4.x'
Closes gh-25077
2021-02-01 16:08:57 -08:00
Phillip Webb
257608a3a3 Merge branch '2.3.x' into 2.4.x
Closes gh-25076
2021-02-01 16:03:43 -08:00
Phillip Webb
939b5dfc26 Add junit-platform-launcher dependency
Update `build.gradle` files to ensure that `junit-platform-launcher` is
a `testRuntimeOnly` dependency. This ensures that tests can be run from
Eclipse.

Closes gh-25074
2021-02-01 15:31:28 -08:00
Phillip Webb
c9a2c4e326 Merge branch '2.4.x' 2021-01-26 19:06:48 -08:00
Hatef Palizgar
53c1e79810 Change info endpoint to be secure and unexposed by default
See gh-24715
2021-01-21 13:54:59 -08:00
izeye
5e3f618f9d Polish
See gh-24604
2020-12-23 16:08:21 +01:00
Madhura Bhave
0818f27f44 Configure WebSecurity using WebSecurityCustomizer
Replace `WebSecurityConfigurer` and `WebSecurityConfigurerAdapter`
configurations with `WebSecurityCustomizer` or `SecurityFilterChain`
beans.

Closes gh-23421
2020-10-26 23:47:14 -07:00
Andy Wilkinson
10f887a5ad Introduce management base-path property for servlet and reactive actuator
Previously, the base path of a servlet-based management server could be
configured using management.server.servlet.context-path but there was no
equivalent property for WebFlux.

This commit introduces a new property, management.server.base-path,
that can be used with both servlet and reactive management servers. The
existing servlet-specific property has been deprecated in favour of the
new general property. When using the servlet stack, if both the general
property and the servlet-specific property are set, the new general
property takes precedence. When using the reactive stack, only the new
general property is considered.

Closes gh-22906
2020-10-26 14:16:29 +00:00
Andy Wilkinson
4fdd1a64c9 Merge branch '2.2.x' into 2.3.x
Closes gh-21718
2020-06-05 13:41:21 +01:00
Andy Wilkinson
1a52009cfb Migrate CustomServletPathSampleActuatorTests to JUnit Jupiter
Closes gh-21717
2020-06-05 13:40:30 +01:00
Scott Frederick
a30740f8d2 Separate server properties for message and errors
Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
2020-04-29 17:56:47 -05:00
Scott Frederick
70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
2020-04-16 10:46:36 -05:00
Phillip Webb
e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
2020-01-22 16:02:38 -08:00
Phillip Webb
0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
2020-01-22 15:49:52 -08:00
Andy Wilkinson
abbad9973a Polish smoke tests' Gradle configuration 2020-01-13 20:07:05 +00:00
Andy Wilkinson
ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +00:00
Madhura Bhave
2726540e76 Merge branch '2.1.x'
Closes gh-17980
2019-08-28 13:13:48 +05:30
Stephane Nicoll
4d21efcc0a Remove outdated comment in smoke tests
Closes gh-17741
2019-08-01 10:36:08 +02:00
Phillip Webb
6675f49334 Switch to multi-line security configuration
Now that we have lambda style security configuration we can further
improve readability by switching to one statement per line.

See gh-17525
2019-07-29 11:28:51 +01:00
Madhura Bhave
39a7b9da38 Switch to lambda style security configuration
Closes gh-17525
2019-07-26 14:41:49 -07:00
Phillip Webb
a9ba7080ce Merge branch '2.1.x' 2019-07-17 21:48:42 +01:00