3242 Commits

Author SHA1 Message Date
Rob Winch
c9010345b9
Add TestingAuthenticationToken(principal,credential,grantedAuthorities...)
Closes gh-17980
2025-10-01 13:05:56 -05:00
Rob Winch
667cd4aa7c
Remove unnecessary throws Exception from spring-security-config
Closes gh-17957
2025-09-25 11:50:13 -05:00
Rob Winch
b2d76dfe66
Add GrantedAuthorities.FACTOR_*_AUTHORITY
Closes gh-17952
2025-09-24 09:53:56 -05:00
Rob Winch
1608465a38
DefaultAuthorizationManagerFactory additionalAuthorization
This commit adds AuthorizationManager<T> additionalAuthorization to
DefaultAuthorizationManagerFactory which can be used for multi factor
authorization.

There is a builder that allows for creating an instance that requires
static additional authorities, but for more advanced cases users can
inject an additionalAuthorization that looks up if the user has settings
that enable additional required authorities.

The builder can later be updated to support checking that a particular
authority was granted within a specified amount of time.

Issue gh-17900
2025-09-23 15:25:26 -05:00
Andrey Litvitski
68742e170c Support Automatically Checking for Required Authorities in Authorization Rules
Closes: gh-17900

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-09-22 00:15:13 +03:00
Josh Cummings
765bdf1ed0
SpEL Expressions Support Returning AuthorizationManager
Closes gh-17936
2025-09-19 12:07:59 -06:00
Josh Cummings
6e7a181eac
Polish Authentication Factors
Issue gh-17933
2025-09-19 11:32:28 -06:00
Josh Cummings
758b35df9c
Add Factor Tests for Authentication Providers
Issue gh-17933
2025-09-19 11:32:27 -06:00
Josh Cummings
39e2bb67fc
Create Authentication Only Once
Issue gh-17933
2025-09-19 11:32:27 -06:00
Josh Cummings
e8accd0499
Add Factory Authority When Authentication Succeeds
Issue gh-17933
2025-09-19 11:32:26 -06:00
Rob Winch
9eaadcc70d
Add hasAll(Roles|Authorities) to SecurityExpressionRoot
This adds support for hasAllRoles and hasAllAuthorities to method security
expressions.

Issue gh-17932
2025-09-19 09:33:50 -05:00
Rob Winch
675835e525
Add AuthorizationManagerFactory.hasAll(Authorities|Roles)
Closes gh-17932
2025-09-18 14:19:22 -05:00
Rob Winch
bb6b8ae3f3
Add AllAuthoritiesReactiveAuthorizationManager
Issue gh-17916
2025-09-16 16:31:55 -05:00
Rob Winch
096dfd4046
Add AllAuthoritiesAuthorizationManager
Closes gh-17916
2025-09-16 15:48:27 -05:00
Josh Cummings
f8272a8844
Fallback to Object When Determining Overridden Methods
Closes gh-17898
2025-09-15 09:16:50 -06:00
Josh Cummings
eedcec9d5c
Move Core Access API
Issue gh-17847
2025-09-12 10:32:38 -06:00
Josh Cummings
c66a028332 Polish Core Authentication Builders
Issue gh-17861
2025-09-09 14:59:14 -06:00
Josh Cummings
dd50dc0c40 Remove Generic Typing From Authentication.Builder
It would be better to introduce parameter types for
principal and credentials into Authentication.Builder
at the same time as doing so for Authentication

Issue gh-17861
2025-09-09 14:49:13 -06:00
Josh Cummings
4744752a1b Add Internal Authentication Implementations
This commit allows a default implementation of
Authentication.Builder that performs the builder
operations. In this way, authorities and other previous
authentication material can still be effectively be
propagated in the event a custom authentication does
not implement the method.

Issue gh-17861
2025-09-09 14:49:13 -06:00
Josh Cummings
3f774548d2 Move Authority Propagation Into Filters
Given that the filters are the level at which the
SecurityContextHolder is consulted, this commit moves
the operation that ProviderManager was doing into each
authentication filter.

Issue gh-17862
2025-09-09 14:49:13 -06:00
Josh Cummings
a0fe6a5fee Polish Builders
- Added remaining properties
- Removed apply method since Spring Security isn't using
it right now
- Made builders extensible since the authentications are
extensible

Issue gh-17861
2025-09-09 14:49:13 -06:00
Josh Cummings
8468c6a805 Propagate Previous Factor to Next One
This commit allows looking up the current authentication and applying
it to the latest authentication. This is specifically handy when
collecting authorities gained from each authentication factor.

Issue gh-17862
2025-09-09 14:49:13 -06:00
Josh Cummings
a201a2b862 Add Authentication.Builder
This commit adds a new default method to Authentication
for the purposes of creating a Builder based on the current
authentication, allowing other authentications to be
applied to it as a composite.

It also adds Builders for each one of the authentication
result classes.

Issue gh-17861
2025-09-09 14:49:13 -06:00
Steve Riesenberg
eeb4574bb3 Add AuthorizationManagerFactory
Signed-off-by: Steve Riesenberg <5248162+sjohnr@users.noreply.github.com>
2025-09-09 15:36:49 -05:00
Josh Cummings
c64b086878
Add SecurityAssertions
This commit introduces a simple, internal test API for
verifying aspects of an Authentication, like its name
and authorities.

Closes gh-17844
2025-09-03 17:53:42 -06:00
Rob Winch
a4a4908d71
Enable Null checking in spring-security-cas via JSpecify
Closes gh-16882
2025-08-30 11:22:30 -05:00
Rob Winch
c2ba662b91
Enable Null checking in spring-security-web via JSpecify
Closes gh-17535
2025-08-29 15:06:48 -05:00
Rob Winch
49f308adb0
Use Supplier<? extends @Nullable Authentication>
Previously Supplier<@Nullable Authentication> was used. This prevented
Supplier<Authentication> from being used. The code now uses
Supplier<? extends @Nullable Authentication> which allows for both
Supplier<@Nullable Authentication> and Supplier<Authentication>.

Closes gh-17814
2025-08-29 09:46:58 -05:00
Josh Cummings
36f1de945f
Add OneTimeTokenAuthentication
Closes gh-17799
2025-08-22 15:46:54 -06:00
Josh Cummings
6663eea65f
Polish OTT Tests
Improve tests so that they do not rely on OneTimeTokenAuthenticationToken
as the concrete type.

Issue gh-17799
2025-08-22 15:46:53 -06:00
Rob Winch
f496ded4e5
AuthorizationManager allows null Authentication
It is possible to have a null Authentication and so the
AuthorizationManager APIs should allow for passing it in.

Closes gh-17795
2025-08-22 12:03:16 -05:00
Andrey Litvitski
47be93e694 Annotate AuthenticationTrustResolver methods with @Nullable
Since AuthenticationTrustResolver can handle null arguments (this is
also stated in the implementation of this interface), we should mark
these arguments as `@Nullable`.

Closes: gh-17764

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-08-19 22:02:59 -05:00
Josh Cummings
c45bc384da
Interpret Expression Templates by Default
Closes gh-17763
2025-08-18 15:45:57 -06:00
Tran Ngoc Nhan
dcd7490ddd Polish javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-08-13 11:03:26 -06:00
Rob Winch
a5c38bdc94
Fix AuthorizationManager T Nullability
Previously AuthorizationManager declared the generic's Nullability
incorrectly. This commit marks it properly.

Closes gh-17667
2025-08-11 13:32:31 -05:00
Josh Cummings
eeb383ac46 Fix Checkstyle
Issue gh-17623
2025-08-07 14:32:18 -06:00
Josh Cummings
6d1a886f92 Deprecate SERIAL_VERSION_UID
Closes gh-17623
2025-08-07 11:09:35 -06:00
Josh Cummings
6f1232ce79 Address Checkstyle
Issue gh-17447

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2025-08-05 09:15:56 -06:00
Mike Heath
93cb01612b Add ExpressionTemplateValueProvider
Closes gh-17447

Signed-off-by: Mike Heath <michael.heath@familysearch.org>
2025-08-05 09:15:56 -06:00
Tran Ngoc Nhan
1a56023f7f Use Spring Framework Nullability Annotations
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-07-31 10:18:51 -06:00
Rob Winch
f6cb0bd610
Merge Use 2004-present Copyright Header
The original merge into main did not apply the changes. This fixes it.
Closes gh-17635
2025-07-29 10:52:42 -05:00
Rob Winch
7c887d2da1
Add nullability to spring-security-core
Closes gh-17534
2025-07-22 16:29:13 -05:00
Josh Cummings
c312d18191
Add Publishing Predicate
Closes gh-17503
2025-07-09 17:33:10 -06:00
Tran Ngoc Nhan
242956a63c Remove deprecated elements from DaoAuthenticationProvider
Closes gh-17298

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-07-07 13:38:34 -06:00
Tran Ngoc Nhan
e52987d03c Remove RoleHierarchyImpl Deprecations
Closes gh-17297

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-07-07 13:22:22 -06:00
Tran Ngoc Nhan
d8043dc8a7 Remove PrePostTemplateDefaults
Closes gh-17296

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-07-03 15:47:27 -06:00
Tran Ngoc Nhan
9312fb7004 Remove Deprecated AuthorizationDecision Elements
Closes gh-17299

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-07-03 14:32:49 -06:00
Rob Winch
00ead7f24d Update to Kotlin 2.2 2025-06-26 17:29:12 -05:00
Evgeniy Cheban
092bbfc8e7 ReactiveAuthorizationManager replace deprecated #check calls with #authorize
Closes gh-16936

Signed-off-by: Evgeniy Cheban <mister.cheban@gmail.com>
2025-06-12 11:11:49 -06:00
Evgeniy Cheban
b0cecb37d2 Replace deprecated #check calls with #authorize
Closes gh-16936

Signed-off-by: Evgeniy Cheban <mister.cheban@gmail.com>
2025-06-12 11:11:49 -06:00