Package org.jboss.weld.security.spi
Interface SecurityServices
-
- All Superinterfaces:
Service
public interface SecurityServices extends Service
Responsible for accessing security related functionality the environment can provide.Required in a Java EE environment.
SecurityServices
is a per-deployment service.An integrator should either implement
getSecurityContext()
orgetSecurityContextAssociator()
. By default, thegetSecurityContextAssociator()
method delegates togetSecurityContext()
. The container always calls thegetSecurityContextAssociator()
method.- Author:
- pmuir, Jozef Hartinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Principal
getPrincipal()
Obtain the Principal representing the current caller identitydefault SecurityContext
getSecurityContext()
Obtain the security context associated with the current thread.default Consumer<Runnable>
getSecurityContextAssociator()
Obtain the security context associated with the current thread and associate this context when an action is performed.
-
-
-
Method Detail
-
getPrincipal
Principal getPrincipal()
Obtain the Principal representing the current caller identity- Returns:
- the Principal representing the current caller identity
-
getSecurityContext
default SecurityContext getSecurityContext()
Obtain the security context associated with the current thread. This method is used by Weld to propagate the security context of the current thread to different threads.By default, a noop fallback implementation is returned.
- Returns:
- the security context associated with the current thread
- Since:
- 3.0
-
getSecurityContextAssociator
default Consumer<Runnable> getSecurityContextAssociator()
Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to different threads.By default, the consumer is using
getSecurityContext()
to associate the security context.- Returns:
- a consumer that accepts an action to be performed with the security context associated with the current thread
-
-