Skip to content

Add DelegatingSecurityContextTaskScheduler #6257

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

Conversation

richardvaldiviesomacias
Copy link

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

New file: DelegatingSecurityContextTaskScheduler which is a DelegatingSecurityContextAsyncTaskExecutor thant implements TaskScheduler.

ExplicitSecurityContextSchedulingTaskSchedulerTests and AbstractSecurityContextTaskSchedulerTests for testing.

Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have provided feedback inline.

Can you also:

  • create a specific DelegatingSecurityContextTaskSchedulerTest?
  • squash the commits
  • ensure the remaining message aligns with the Spring Security conventions?

Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

[ant:checkstyle] [ERROR] /home/travis/build/spring-projects/spring-security/core/src/main/java/org/springframework/security/scheduling/DelegatingSecurityContextTaskScheduler.java:38: Line has leading space characters; indentation should be performed with tabs only. [RegexpSinglelineJava]
[ant:checkstyle] [ERROR] /home/travis/build/spring-projects/spring-security/core/src/main/java/org/springframework/security/scheduling/DelegatingSecurityContextTaskScheduler.java:54:52: ',' is not followed by whitespace. [WhitespaceAfter]

You can run checkstyle using ./gradlew checkstyleMain checkstyleTest

@richardvaldiviesomacias
Copy link
Author

I will make those changes.

Copy link
Author

@richardvaldiviesomacias richardvaldiviesomacias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ready for sending this again. However, I miss the squash step. How can I fix that?

Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests. I have provided additional feedback inline

@rwinch rwinch changed the title Gh 6043 task scheduler variant Add DelegatingSecurityContextTaskScheduler Dec 14, 2018
@richardvaldiviesomacias richardvaldiviesomacias force-pushed the gh-6043-TaskScheduler-variant branch 4 times, most recently from af83f72 to fae0d4e Compare December 15, 2018 01:03
@rwinch rwinch self-assigned this Dec 17, 2018
@rwinch rwinch added in: core An issue in spring-security-core type: enhancement A general enhancement labels Dec 17, 2018
@rwinch rwinch added this to the 5.2.0.M1 milestone Dec 17, 2018
Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. I just noticed (sorry about that) that the documentation hasn't been updated yet. Can you please update it? Once that is done we will be ready to merge.

@rwinch rwinch added the status: waiting-for-feedback We need additional information before we can continue label Dec 17, 2018
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.

The new DelegatingSecurityContextTaskScheduler class implements
TaskScheduler interface.

Fixes spring-projectsgh-6043
@richardvaldiviesomacias richardvaldiviesomacias force-pushed the gh-6043-TaskScheduler-variant branch from fae0d4e to a95b6ff Compare December 17, 2018 17:21
@richardvaldiviesomacias
Copy link
Author

Done. Thanks for all your help 😁

@rwinch rwinch removed the status: waiting-for-feedback We need additional information before we can continue label Dec 17, 2018
@rwinch rwinch merged commit cb0ea02 into spring-projects:master Dec 17, 2018
@rwinch
Copy link
Member

rwinch commented Dec 17, 2018

@richardvaldiviesomacias Thanks for the fast turnaround! This is now merged into master. Thank you for taking the time to make Spring better. We hope to see you again soon (submitting a PR, issue, etc)! If you are looking for issues to help with the label Help Wanted is a sign that the issue is relatively small. Just comment on the issue to claim it before starting work.

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 this pull request may close these issues.

2 participants