From cd68deb2de6bf3176151ba25b8f380b5b4d69f8f Mon Sep 17 00:00:00 2001 From: Sjoerd Talsma Date: Sun, 24 Nov 2024 15:35:00 +0100 Subject: [PATCH] Improve javadoc for the spring security context manager. Signed-off-by: Sjoerd Talsma --- .../SpringSecurityContextManager.java | 5 ++-- .../spring/security/package-info.java | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/package-info.java diff --git a/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/SpringSecurityContextManager.java b/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/SpringSecurityContextManager.java index f53d09c9..2e312c0f 100644 --- a/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/SpringSecurityContextManager.java +++ b/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/SpringSecurityContextManager.java @@ -24,8 +24,9 @@ import java.util.concurrent.atomic.AtomicBoolean; /** - * A context manager that propagates spring-security {@link Authentication} objects - * into background threads using the {@code ContextAwareExecutorService}. + * Manager to propagate the {@linkplain Authentication Spring Security Authentication} + * from one thread to another. + * *

* Management of the authentication is fully delegated to the Spring {@link SecurityContextHolder}, * so no additional {@link java.lang.ThreadLocal} variables are used. diff --git a/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/package-info.java b/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/package-info.java new file mode 100644 index 00000000..20623716 --- /dev/null +++ b/managers/context-manager-spring-security/src/main/java/nl/talsmasoftware/context/managers/spring/security/package-info.java @@ -0,0 +1,30 @@ +/* + * Copyright 2016-2024 Talsma ICT + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Manager to propagate the {@linkplain org.springframework.security.core.Authentication Spring Security Authentication} + * from one thread to another. + * + *

+ * This context manager maintains no ThreadLocal state of its own, + * instead it propagates the + * existing {@linkplain org.springframework.security.core.Authentication Authentication} + * from the {@linkplain org.springframework.security.core.context.SecurityContextHolder SecurityContextHolder} + * into each {@linkplain nl.talsmasoftware.context.api.ContextSnapshot context snapshot} + * to be applied again when the snapshot + * is {@linkplain nl.talsmasoftware.context.api.ContextSnapshot#reactivate() reactivated} + * in another thread. + */ +package nl.talsmasoftware.context.managers.spring.security;