Resolve "针对跨国主体的新发展银行使用SaaS时无需进行手机实名制验证的需求"
Related issue: https://jihulab.com/gitlab-cn/gitlab/-/issues/2047
What does this MR do and why?
Modify the SaaS-related code logic to allow specific groups to connect to third-party SSO without mandatory real-name verification.
-
Add a long-lived feature flag: skip_real_name_verification
to disable real-name verification. -
Update User#phone_verified?
to let disabled real-name verification group members'sphone_verified?
returntrue
. - Disabled real-name verification group members do not need to do
phone_verify
. - Disabled real-name verification group members are allowed to access via
API
andGit
. -
Update user profile
front and backend logic. - Disabled real-name verification group members are allowed to set
phone
to be empty or bind a specific phone number in front form layer.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Enable real-name authentication.
# 1. saas
export GITLAB_SIMULATE_SAAS=1
gdk restart
# 2. Enable real-name authentication configuration
# rails console
a=ApplicationSetting.first
a.phone_verification_code_enabled=true
a.save
# test
::Gitlab::RealNameSystem.enabled?
- Select a group to disable real-name authentication.
# rails console
group = User.first.groups[0]
Feature.enable :skip_real_name_verification, group
# test
Feature.enabled? :skip_real_name_verification, group, type: :ops
- Select a member without real-name authentication who is from the disabled real-name authentication group, and log in.
- No mandatory real-name authentication:
- Edit profile: the phone number is allowed to be empty:
- Access api:
/api/v4/issues?scope=all
: -
git clone
private project:
git clone ssh://git@127.0.0.1:2222/root/issue-1522-test-t.git
正克隆到 'issue-1522-test-t'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 21 (delta 4), reused 0 (delta 0), pack-reused 0
接收对象中: 100% (21/21), 4.61 KiB | 4.61 MiB/s, 完成.
处理 delta 中: 100% (4/4), 完成.
- Select a member without real-name verification who is not from the disabled real-name verification group, and log in. This user will need real-name verification.
- Select a member with real-name verification, and login in. This user's phone number will not be allowed to be empty.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #2047
由 Baodong 编辑于