@Override public Consumer<Runnable> getSecurityContextAssociator(){ SecurityDomain elytronDomain = getCurrentSecurityDomain(); if(elytronDomain != null) { // store the identity from the original thread and use it in callback which will be invoked in a different thread SecurityIdentity storedSecurityIdentity = elytronDomain.getCurrentSecurityIdentity(); return (action) -> storedSecurityIdentity.runAs(action); } else { return SecurityServices.super.getSecurityContextAssociator(); } }
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
final Consumer<Runnable> securityContextActionConsumer = securityServices.getSecurityContextAssociator(); final ObserverExceptionHandler exceptionHandler; CompletableFuture<U> completableFuture;
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
final Consumer<Runnable> securityContextActionConsumer = securityServices.getSecurityContextAssociator(); final ObserverExceptionHandler exceptionHandler; CompletableFuture<U> completableFuture;
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
final Consumer<Runnable> securityContextActionConsumer = securityServices.getSecurityContextAssociator(); final ObserverExceptionHandler exceptionHandler; CompletableFuture<U> completableFuture;
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
final Consumer<Runnable> securityContextActionConsumer = securityServices.getSecurityContextAssociator(); final ObserverExceptionHandler exceptionHandler; CompletableFuture<U> completableFuture;
public Principal call() throws Exception { final SecurityServices securityServices = getBeanManager().getServices().get(SecurityServices.class); if (securityServices != null) { return securityServices.getPrincipal(); } else { throw BeanLogger.LOG.securityServicesNotAvailable(); } }
/** * 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. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
final Consumer<Runnable> securityContextActionConsumer = securityServices.getSecurityContextAssociator(); final ObserverExceptionHandler exceptionHandler; CompletableFuture<U> completableFuture;