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] Add LDAP user not exsitst action config #10451

Merged
merged 10 commits into from
Jun 17, 2022

Conversation

qingwli
Copy link
Member

@qingwli qingwli commented Jun 15, 2022

Purpose of the pull request

When you log in with LDAP and are not a ds user, it will create a new user automatedly.

But in my option, LDAP login is the same as user-password log-in, if you are not a ds user, your login will be denied.

I think we can add a new config field, user can choose if they log in with LDAP and are not a ds user, which will create a new user or be denied.

Brief change log

Verify this pull request

This change added tests and can be verified as follows:

modified: dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/security/SecurityConfigLDAPTest.java
modified: dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/security/impl/ldap/LdapAuthenticatorTest.java

part of #10425

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2022

Codecov Report

Merging #10451 (bb328be) into dev (5084676) will increase coverage by 0.27%.
The diff coverage is 69.23%.

@@             Coverage Diff              @@
##                dev   #10451      +/-   ##
============================================
+ Coverage     40.59%   40.86%   +0.27%     
- Complexity     4778     4848      +70     
============================================
  Files           878      886       +8     
  Lines         35747    35990     +243     
  Branches       3970     3993      +23     
============================================
+ Hits          14512    14709     +197     
- Misses        19789    19822      +33     
- Partials       1446     1459      +13     
Impacted Files Coverage Δ
...nscheduler/api/security/impl/ldap/LdapService.java 7.14% <20.00%> (+1.73%) ⬆️
...duler/api/security/LdapUserNotExistActionType.java 100.00% <100.00%> (ø)
...uler/api/security/impl/ldap/LdapAuthenticator.java 100.00% <100.00%> (ø)
...duler/server/master/processor/queue/TaskEvent.java 50.00% <0.00%> (-17.95%) ⬇️
...er/master/dispatch/host/assign/RandomSelector.java 77.77% <0.00%> (-5.56%) ⬇️
...he/dolphinscheduler/remote/utils/ChannelUtils.java 30.00% <0.00%> (-3.34%) ⬇️
...pache/dolphinscheduler/common/utils/FileUtils.java 52.94% <0.00%> (-3.31%) ⬇️
...e/dolphinscheduler/remote/NettyRemotingClient.java 50.00% <0.00%> (-2.78%) ⬇️
...erver/master/runner/task/TaskProcessorFactory.java 42.10% <0.00%> (-1.65%) ⬇️
...e/dolphinscheduler/dao/entity/ProcessInstance.java 65.56% <0.00%> (-0.44%) ⬇️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5084676...bb328be. Read the comment docs.

@kezhenxu94 kezhenxu94 dismissed their stale review June 15, 2022 08:25

Comments Addressed

@qingwli
Copy link
Member Author

qingwli commented Jun 16, 2022

PTAL @zhongjiajie @caishunfeng

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

please find my tow cents

@qingwli qingwli requested a review from SbloodyS as a code owner June 17, 2022 02:56
SbloodyS
SbloodyS previously approved these changes Jun 17, 2022
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Currently, we only support LDAP. I hope that LDAPS and LDAPS without ssl can be supported in the future.

@sonarcloud
Copy link

sonarcloud bot commented Jun 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

81.0% 81.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@zhongjiajie zhongjiajie 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 works of LDAP

@zhongjiajie zhongjiajie merged commit 6515c66 into apache:dev Jun 17, 2022
@zhongjiajie zhongjiajie changed the title [Improvement][LDAP]Add LDAP User Not Exist Action Config [Improve] Add LDAP user not exsitst action config Jun 17, 2022
@devosend devosend added this to the 3.0.0-beta-3 milestone Jun 18, 2022
hstdream pushed a commit to hstdream/dolphinscheduler that referenced this pull request Jun 23, 2022
@zhongjiajie zhongjiajie modified the milestones: 3.0.0-release, 3.1.0-alpha Aug 3, 2022
@qingwli qingwli deleted the ldap-user-not-exist-action-config branch September 7, 2023 06:41
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.

7 participants