Skip to content

DelegatingSecurityContextTaskScheduler does not allow to use a specific SecurityContext #9514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gbaso opened this issue Mar 23, 2021 · 2 comments
Assignees
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement

Comments

@gbaso
Copy link
Contributor

gbaso commented Mar 23, 2021

Expected Behavior

DelegatingSecurityContextTaskScheduler should have a constructor accepting a TaskScheduler and a SecurityContext.

Current Behavior

Unlike similar classes like DelegatingSecurityContextAsyncTaskExecutor and DelegatingSecurityContextScheduledExecutorService, DelegatingSecurityContextTaskScheduler does not extends AbstractDelegatingSecurityContextSupport and does not contains a SecurityContext field. As of now, it's just a plain wrapper.

Looking at past issues, it looks like DelegatingSecurityContextTaskScheduler was requested in #3125 and introduced in #6043

@gbaso gbaso added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Mar 23, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Mar 29, 2021

Thanks for the report, @gbaso. I agree that DelegatingSecurityContextTaskScheduler should wrap the Runnable instances it receives in DelegatingSecurityContextRunnables.

Would you be able to provide a PR with that change?

@jzheaux jzheaux self-assigned this Mar 29, 2021
@jzheaux jzheaux added in: core An issue in spring-security-core and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 29, 2021
@gbaso
Copy link
Contributor Author

gbaso commented Mar 31, 2021

@jzheaux I submitted #9532 to fix the issue

gbaso added a commit to gbaso/spring-security that referenced this issue Apr 16, 2021
Wrap DelegatingSecurityContextTaskScheduler's Runnable tasks in
DelegatingSecurityContextRunnables, allowing to specify a
SecurityContext to use for tasks execution.

- Renamed private variable taskScheduler to delegate
- Removed unused local variable in unit test
- Add SecurityContext tests for delegating TaskScheduler

Closes spring-projectsgh-9514
@jzheaux jzheaux closed this as completed in 80743a2 Jun 7, 2021
jzheaux added a commit that referenced this issue Jun 7, 2021
jzheaux added a commit that referenced this issue Jun 7, 2021
akohli96 pushed a commit to akohli96/spring-security that referenced this issue Aug 25, 2021
Wrap DelegatingSecurityContextTaskScheduler's Runnable tasks in
DelegatingSecurityContextRunnables, allowing to specify a
SecurityContext to use for tasks execution.

- Renamed private variable taskScheduler to delegate
- Removed unused local variable in unit test
- Add SecurityContext tests for delegating TaskScheduler

Closes spring-projectsgh-9514
akohli96 pushed a commit to akohli96/spring-security that referenced this issue Aug 25, 2021
akohli96 pushed a commit to akohli96/spring-security that referenced this issue Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants