Class SecondaryNodeSecurityManager
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.SecondaryNodeSecurityManager
-
public final class SecondaryNodeSecurityManager extends Object
Security manger which controls access to data directory on the secondary node.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAllowedClassNamePrefix(RestrictedOperation operation, String classNamePrefix)
Allows granting access to classes with a specified class name prefix.static void
addReadOnlyPath(File filePath)
Registers some path on disk as a path where write operation should NOT be allowedstatic void
addWritablePath(File filePath)
Registers some path on disk as a path where write operation should be allowedstatic <E extends Throwable>
voidexecuteSafe(ActionThrow<E> actionThrow, Set<RestrictedOperation> operations)
Code that wants to run safe but restricted operation on read-only node should be wrapped in this method.static <R,E extends Throwable>
RexecuteSafe(FuncThrow<R,E> funcThrow, Set<RestrictedOperation> operations)
Code that wants to run safe but restricted operation on read-only node should be wrapped in this method.static <E extends Throwable>
voidexecuteSafeCommandLine(ActionThrow<E> actionThrow)
Code that wants to run read-only safe external command-line should be wrapped to this method.static <R,E extends Throwable>
RexecuteSafeCommandLine(FuncThrow<R,E> funcThrow)
Code that wants to run read-only safe external command-line should be wrapped to this method.static void
init(Supplier<Set<NodeResponsibility>> effectiveResponsibilitiesSupplier)
static void
removePath(File filePath)
static void
reset()
static <E extends Throwable>
voidrunSafeDiskWriteOperation(ActionThrow<E> actionThrow)
Code that wants to run file operation should be wrapped to this method.static <R,E extends Throwable>
RrunSafeDiskWriteOperation(FuncThrow<R,E> funcThrow)
Code that wants to run file operation should be wrapped to this method.static <E extends Throwable>
voidrunSafeNetworkOperation(ActionThrow<E> actionThrow)
Code that wants to run read-only safe network operation should be wrapped to this method.static <R,E extends Throwable>
RrunSafeNetworkOperation(FuncThrow<R,E> funcThrow)
Code that wants to run read-only safe network operation should be wrapped to this method.
-
-
-
Method Detail
-
init
public static void init(@NotNull Supplier<Set<NodeResponsibility>> effectiveResponsibilitiesSupplier)
-
reset
public static void reset()
-
addWritablePath
public static void addWritablePath(@NotNull File filePath)
Registers some path on disk as a path where write operation should be allowed
-
addReadOnlyPath
public static void addReadOnlyPath(@NotNull File filePath)
Registers some path on disk as a path where write operation should NOT be allowed
-
removePath
public static void removePath(@NotNull File filePath)
-
executeSafe
public static <E extends Throwable> void executeSafe(@NotNull ActionThrow<E> actionThrow, @NotNull Set<RestrictedOperation> operations) throws E extends Throwable
Code that wants to run safe but restricted operation on read-only node should be wrapped in this method.- Throws:
E extends Throwable
-
executeSafe
public static <R,E extends Throwable> R executeSafe(@NotNull FuncThrow<R,E> funcThrow, @NotNull Set<RestrictedOperation> operations) throws E extends Throwable
Code that wants to run safe but restricted operation on read-only node should be wrapped in this method.- Throws:
E extends Throwable
-
runSafeDiskWriteOperation
public static <E extends Throwable> void runSafeDiskWriteOperation(@NotNull ActionThrow<E> actionThrow) throws E extends Throwable
Code that wants to run file operation should be wrapped to this method.- Throws:
E extends Throwable
-
runSafeDiskWriteOperation
public static <R,E extends Throwable> R runSafeDiskWriteOperation(@NotNull FuncThrow<R,E> funcThrow) throws E extends Throwable
Code that wants to run file operation should be wrapped to this method.- Throws:
E extends Throwable
-
runSafeNetworkOperation
public static <E extends Throwable> void runSafeNetworkOperation(@NotNull ActionThrow<E> actionThrow) throws E extends Throwable
Code that wants to run read-only safe network operation should be wrapped to this method. All other attempts to run network operations will fail.- Throws:
E extends Throwable
-
runSafeNetworkOperation
public static <R,E extends Throwable> R runSafeNetworkOperation(@NotNull FuncThrow<R,E> funcThrow) throws E extends Throwable
Code that wants to run read-only safe network operation should be wrapped to this method. All other attempts to run network operations will fail.- Throws:
E extends Throwable
-
executeSafeCommandLine
public static <E extends Throwable> void executeSafeCommandLine(@NotNull ActionThrow<E> actionThrow) throws E extends Throwable
Code that wants to run read-only safe external command-line should be wrapped to this method. All other attempts to run the command line will fail.- Throws:
E extends Throwable
-
executeSafeCommandLine
public static <R,E extends Throwable> R executeSafeCommandLine(@NotNull FuncThrow<R,E> funcThrow) throws E extends Throwable
Code that wants to run read-only safe external command-line should be wrapped to this method. All other attempts to run the command line will fail.- Throws:
E extends Throwable
-
addAllowedClassNamePrefix
public static void addAllowedClassNamePrefix(@NotNull RestrictedOperation operation, @NotNull String classNamePrefix)
Allows granting access to classes with a specified class name prefix. Once a prefix is registered, next check by a security manager will analyze stacktrace and if it finds a class with the provided prefix, then the access will be granted.- Parameters:
classNamePrefix
-- Since:
- 2022.04.2
-
-