Package org.gcube.common.security
Class AuthorizedTasks
- java.lang.Object
-
- org.gcube.common.security.AuthorizedTasks
-
public class AuthorizedTasks extends Object
-
-
Constructor Summary
Constructors Constructor Description AuthorizedTasks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> Runnablebind(Runnable task)Binds aRunnabletask to the current scope and user.static <V> Callable<V>bind(Callable<V> task)Binds aCallabletask to the current scope and user.static voidexecuteSafely(Runnable task, Secret secret)Execute a runnable inline with set and reset of the SecretManagerProviderstatic <T> TexecuteSafely(Callable<T> task, Secret secret)Execute a callable inline with set and reset of the SecretManagerProvider
-
-
-
Method Detail
-
bind
public static <V> Callable<V> bind(Callable<V> task)
Binds aCallabletask to the current scope and user.- Parameters:
task- the task- Returns:
- an equivalent
Callabletask bound to the current scope and user
-
bind
public static <V> Runnable bind(Runnable task)
Binds aRunnabletask to the current scope and user.- Parameters:
task- the task- Returns:
- an equivalent
Runnabletask bound to the current scope and user
-
executeSafely
public static void executeSafely(Runnable task, Secret secret)
Execute a runnable inline with set and reset of the SecretManagerProvider- Parameters:
task- the tasksecret- the secret that must be used in the function
-
-