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

Support extending username password authentication #4265

Merged

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Jul 20, 2023

What type of PR is this?

/kind feature
/area core
/area plugin

What this PR does / why we need it:

Plugin developers are able to define own UsernamePasswordAuthenticationManager to take charge of username password authentication.

  1. If the manager fails to handle, the default authentication manager will be used.
  2. If the manager returns Mono.empty(), the default authentication manager will be used.

For example:

@Component
public class LdapAuthenticationManager
    extends UserDetailsRepositoryReactiveAuthenticationManager
    implements UsernamePasswordAuthenticationManager {

    public LdapAuthenticationManager(ReactiveUserDetailsService userDetailsService) {
        super(userDetailsService);
    }

    @Override
    protected Mono<UserDetails> retrieveUser(String username) {
        return super.retrieveUser(username);
    }
}

Which issue(s) this PR fixes:

See #4207 (comment) for more.

Does this PR introduce a user-facing change?

提供用户名密码认证扩展

@f2c-ci-robot f2c-ci-robot bot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 20, 2023
@f2c-ci-robot f2c-ci-robot bot requested a review from LIlGG July 20, 2023 07:16
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jul 20, 2023
@f2c-ci-robot f2c-ci-robot bot requested a review from minliacom July 20, 2023 07:16
@f2c-ci-robot f2c-ci-robot bot added the area/plugin Issues or PRs related to the Plugin Provider label Jul 20, 2023
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #4265 (6986546) into main (e98aec3) will increase coverage by 0.11%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##               main    #4265      +/-   ##
============================================
+ Coverage     60.16%   60.28%   +0.11%     
- Complexity     2418     2426       +8     
============================================
  Files           366      367       +1     
  Lines         12617    12637      +20     
  Branches        906      906              
============================================
+ Hits           7591     7618      +27     
+ Misses         4585     4577       -8     
- Partials        441      442       +1     
Impacted Files Coverage Δ
...ernamePasswordDelegatingAuthenticationManager.java 31.25% <31.25%> (ø)
...ntication/login/UsernamePasswordAuthenticator.java 44.94% <100.00%> (+2.59%) ⬆️

... and 5 files with indirect coverage changes

@JohnNiang
Copy link
Member Author

/cc @liuchangfitcloud

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jul 20, 2023

@JohnNiang: GitHub didn't allow me to request PR reviews from the following users: liuchangfitcloud.

Note that only halo-dev members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @liuchangfitcloud

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@f2c-ci-robot f2c-ci-robot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2023
@guqing
Copy link
Member

guqing commented Jul 21, 2023

需要合并一下冲突

@f2c-ci-robot f2c-ci-robot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2023
@liuchangfitcloud
Copy link
Contributor

@JohnNiang extensionpoint-definitions.yaml type:SINGLE_INSTANCE Not Found

@JohnNiang
Copy link
Member Author

感谢提醒!已经在 eb28a02 修复。

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/approve

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2023
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jul 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing, ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit 4505fcf into halo-dev:main Jul 24, 2023
4 checks passed
@ruibaby ruibaby added this to the 2.8.0 milestone Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core area/plugin Issues or PRs related to the Plugin Provider kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants