spring-projects / spring-projects/spring-security

DelegatingSecurityContextTaskExecutor / DelegatingSecurityContextRunnable / DelegatingSecurityContextCallable should provide extension points

Open
#14,911 8 comments 0 reactions 1 assignee View on GitHub

@jzheaux is already working on this.

Since Apr 15, 2024.

in: core status: feedback-provided
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Hi,

I am using the DelegatingSecurityContextTaskExecutor and the DelegatingSecurityContextRunnable / Callable stack in a custom ForkJoinPool to make sure, my SecurityContext is transported on the various scheduled / submitted Tasks in the selected pool.

That works find so far but I need to hook those wrappers so I can modify the execution environment to do additional tasks before the runnable / callable is called (like the setup of the context does) and to cleanup things after the original runnable / callable comes back.

At the moment as the code is written (package protected, private, final stuff) I need to / I am forced to copy the whole code for my custom ForkJoinPool and TaskExecutor and provide also custom wrapper classes to meet that requirement, because the whole code written now, does not have a strong focus on being extended / customized / enriched.

It would be nice if you could just provide e.g. protected methods / wrappers or some functional interfaces for setup / finished callbacks I could provide when creating the pool so that I can just use your classes, enriched by my provided callbacks which are called on the correct time in the lifecycle, so that I am not forced to mimic the context saving / restoring behavior and have my addon glue executed too.

Thanks for considering.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.