Skip to content
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

[Improve]Optimize the way of obtaining user information. #267

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

zhangshenghang
Copy link
Member

@zhangshenghang zhangshenghang commented Jan 13, 2025

Purpose of this pull request

In the Spring project, the user ID should not be passed in through the front end, but the general Servlet should be used to obtain user information.

Check list

@zhangshenghang zhangshenghang changed the title ' [Improve]Optimize the way of obtaining user information. Jan 13, 2025
@zhangshenghang
Copy link
Member Author

@Hisoka-X PTAL

Hisoka-X
Hisoka-X previously approved these changes Jan 13, 2025
Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

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

@shashwatsai
Copy link
Contributor

shashwatsai commented Jan 16, 2025

@zhangshenghang this makes a lot of sense, but isn't it possible to leverage spring-boot-starter-security and use SecurityContextHolder?

ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setMaxPoolSize(20);
executor.setQueueCapacity(100);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you make these parameters configurable.

Copy link
Member Author

Choose a reason for hiding this comment

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

can you make these parameters configurable.

ok

Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that you have added async-config, but it is not being used in this code. Could you please verify this? Additionally, ensure that if the async-config entry is missing from the configuration, the default values are used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@zhangshenghang can you please handle this

@arshadmohammad
Copy link
Collaborator

Nice improvement, Thanks @zhangshenghang

@zhangshenghang
Copy link
Member Author

@zhangshenghang this makes a lot of sense, but isn't it possible to leverage spring-boot-starter-security and use SecurityContextHolder?

@shashwatsai Yes, currently the project does not use spring-boot-starter-security, it can be optimized separately.

@zhangshenghang zhangshenghang force-pushed the improve-get-user-method branch from 6d790f2 to 33e31ad Compare January 24, 2025 02:47
@zhangshenghang
Copy link
Member Author

@arshadmohammad @Hisoka-X PTAL

@arshadmohammad
Copy link
Collaborator

executor.setCorePoolSize(10); executor.setMaxPoolSize(20); executor.setQueueCapacity(100);
The AsyncConfig class is currently using hard-coded values instead of utilizing the configuration settings. @zhangshenghang can you handle this?

@zhangshenghang
Copy link
Member Author

executor.setCorePoolSize(10); executor.setMaxPoolSize(20); executor.setQueueCapacity(100); The AsyncConfig class is currently using hard-coded values instead of utilizing the configuration settings. @zhangshenghang can you handle this?

OK. I forgot to submit it. It has been revised.

@zhangshenghang
Copy link
Member Author

@arshadmohammad @Hisoka-X PTAL

@arshadmohammad
Copy link
Collaborator

Many integration tests are failing
[ERROR] UserControllerTest.login_shouldFail_whenInvalidAuthType:139 » Runtime
[ERROR] UserControllerTest.login_shouldPass_whenNoAuthType:124 » Runtime
[ERROR] UserControllerTest.login_shouldPass_whenValidAuthType:109 » Runtime
[ERROR] UserControllerTest.tearDown:184 » Runtime
[ERROR] UserControllerTest.updateUser_shouldReturnSuccess_whenValidRequest:73 » Runtime
[INFO]
[ERROR] Tests run: 48, Failures: 0, Errors: 48, Skipped: 0
[INFO]
[ERROR] There are test failures.

@zhangshenghang can you please run the integration tests and handle the failure.

@arshadmohammad
Copy link
Collaborator

Apologies for the confusion. After upgrading my existing Seatunnel database by executing the script below, the test cases have now passed.

ALTER TABLE user ADD COLUMN auth_provider varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'DB';

@arshadmohammad arshadmohammad merged commit 20ac01b into apache:main Feb 5, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants