Class Security
java.lang.Object
org.infinispan.security.Security
Security. A simple class to implement caller privileges without a security manager.
N.B. this uses the caller's Package, this can easily be subverted by placing the calling code within the
org.infinispan hierarchy. For most purposes, however, this is ok.
- Since:
- 7.0
- Author:
- Tristan Tarrant
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <T,U, R> R doAs(Subject subject, BiFunction<T, U, R> function, T t, U u) static <T,R> R static <T> Tstatic voiddoPrivileged(Runnable action) static <T> TdoPrivileged(Supplier<T> action) static SubjectIf usingdoAs(Subject, Runnable)ordoAs(Subject, Function, Object)ordoAs(Subject, BiFunction, Object, Object), returns theSubjectassociated with the current thread otherwise it returns null.static PrincipalReturns the first principal of a subjectstatic Stringstatic booleanstatic StringA simplified version of Subject.toString() with the following advantages: only lists principals, ignoring credentials uses a compact, single-line format does not use synchronization does not use i18n messages
-
Constructor Details
-
Security
public Security()
-
-
Method Details
-
doPrivileged
-
doPrivileged
-
doAs
-
doAs
-
doAs
-
doAs
-
isPrivileged
public static boolean isPrivileged() -
getSubject
If usingdoAs(Subject, Runnable)ordoAs(Subject, Function, Object)ordoAs(Subject, BiFunction, Object, Object), returns theSubjectassociated with the current thread otherwise it returns null. -
getSubjectUserPrincipal
-
getSubjectUserPrincipalName
-
toString
-