Spring-security: Provide a TaskScheduler variant for DelegatingSecurityContextExecutor

Created on 4 Nov 2018  路  12Comments  路  Source: spring-projects/spring-security

Summary

Spring Security provides a DelegatingSecurityContextRunnable abstraction for Runnable that can be used for async and scheduled tasks. The primary contract for task scheduling is TaskScheduler and there's no such wrapper available at the moment.

Actual Behavior

Users are configuring a DelegatingSecurityContextScheduledExecutorService for support of @EnableScheduling which is not the primary contract that @EnableScheduling expects.

Expected Behavior

Spring Security provides a TaskScheduler variant or the documentation routes users to expose a TaskScheduler bean rather than exposing a ScheduledExecutorService bean.

This relates to https://github.com/spring-projects/spring-boot/issues/15032 - Spring Framework considers ScheduledExecutorService as a fallback of the primary TaskScheduler API. It would be nice if Spring Security aligns to that, either in code or in guiding users in the documentation.

core first-timers-only

All 12 comments

Thanks I think we should provide a DelegatingSecurityContextTaskScheduler variant. I think this will be a good first timer issue.

The class DelegatingSecurityContextTaskScheduler should be created in the same package as DelegatingSecurityContextSchedulingTaskExecutor. The code will be very similar except it will implement TaskScheduler.

We should also create tests for this.

Finally the documentation should be updated to include a reference to the new class.

I am a first-timer taking this issue if that's okay and will create a PR. Thanks!

Thank you @avirekghatia! The issue is all yours. Let me know if you need any help working on this issue.

Is this still open?

Hi @richardvaldiviesomacias , sorry I was really busy for a while. Will create a PR by tomorrow. Sorry for the delay

馃憤

@rwinch @richardvaldiviesomacias , I think I need a little more reading on the project before I can fix this. If you want to take this issue @richardvaldiviesomacias , feel free. Thank you.

Sure I will give it a try. Thanks @avirekghatia

@rwinch Good afternoon

I finished this issue. I forked the repository and I working on it. How/What is the procedure to request a PR. I am sure that I will do some corrections but I want to send it now. Here is the file from the repository: https://github.com/richardvaldiviesomacias/spring-security. Branch's name gh-6043-TaskScheduler-variant

@richardvaldiviesomacias Thanks for working on this! No problem on needing some corrections that is part of the process! Please go ahead and submit the PR and we can review and refine from there.

@rwinch I got the latest from Master (without my changes) and it is failing when I run the integration.

@richardvaldiviesomacias Thanks for the ping. I responded on the PR.

Was this page helpful?
0 / 5 - 0 ratings