Skip to content

<feat>[iam2]: add ZIAM provider name constant (P1)#3853

Open
ZStack-Robot wants to merge 1 commit intofeature-5.5.22-zcf-temporaryfrom
sync/hanyu.liang/feature-5.5.22-zcf-temporary
Open

<feat>[iam2]: add ZIAM provider name constant (P1)#3853
ZStack-Robot wants to merge 1 commit intofeature-5.5.22-zcf-temporaryfrom
sync/hanyu.liang/feature-5.5.22-zcf-temporary

Conversation

@ZStack-Robot
Copy link
Copy Markdown
Collaborator

Summary

P1 ZIAM OIDC ROPC 打通的父仓库部分:在 OAuth2PluginConstants 中新增 ZIAM_PROVIDER_NAME = "ziam",作为 OAuth2ClientVO.identityProvider 的判别值,与 premium 仓库侧的 ZiamProvider / IAM2RopcLoginBackend 配套。

Test plan

  • mvn clean package 编译通过
  • 配合 premium 仓库 MR 合并后在 172.24.246.184 环境跑 ROPC 登录冒烟

sync from gitlab !9725

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: c7c7f45c-3cb3-4bd3-b711-17d8b2135aac

📥 Commits

Reviewing files that changed from the base of the PR and between 83a33a1 and 0515305.

📒 Files selected for processing (1)
  • abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java
✅ Files skipped from review due to trivial changes (1)
  • abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java

Walkthrough

OAuth2PluginConstants 接口中新增两个字符串常量:ZIAM_PROVIDER_NAME = "ziam"LOGIN_TYPE_IAM2_ROPC = "iam2_ropc";未更改其它逻辑或控制流。

Changes

Cohort / File(s) Summary
OAuth2 提供程序常量
abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java
新增常量 ZIAM_PROVIDER_NAME = "ziam"LOGIN_TYPE_IAM2_ROPC = "iam2_ropc",扩展可识别的 OAuth2/OIDC 提供者及登录类型标识。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🐰 我在代码田间跳,带来两串小名号,
一个叫 "ziam" 闪亮笑,一个是 "iam2_ropc" 招手。
行数不多心意长,轻声改动暖如春,
草间一跃庆新章,代码花开又一窟。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题遵循 [scope]: 格式(feat[iam2]: add ZIAM provider name constant),长度50字符在72字符限制内,准确总结了主要变更内容。
Description check ✅ Passed 描述内容与变更集相关,清楚说明了新增常量的目的(作为OAuth2ClientVO.identityProvider的判别值)及其与premium仓库组件的配套关系。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/hanyu.liang/feature-5.5.22-zcf-temporary

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java (1)

49-49: 常量定义正确,遵循了规范!

新增的 ZIAM_PROVIDER_NAME 常量:

  • ✅ 命名遵循全大写+下划线的常量命名规范
  • ✅ 没有使用冗余的 public static final 修饰符(接口常量隐式为 public static final)
  • ✅ 与其他提供者常量(第 44-48 行)的模式保持一致
  • ✅ 值 "ziam" 与现有提供者名称无冲突

根据 PR 目标,该常量将作为 OAuth2ClientVO.identityProvider 的鉴别值,用于支持 ZIAM OIDC ROPC 集成,符合设计意图。

♻️ 可选的风格统一建议

注意到文件中存在风格不一致:第 9-42 行的常量使用了显式的 public static final 修饰符,而第 44-49 行没有。根据编码规范"接口方法不应有多余的修饰符"(此规范同样适用于接口字段),建议在后续维护时统一移除第 9-42 行的冗余修饰符,使整个文件风格一致。

但这不影响当前 PR,当前新增代码已遵循了更好的实践。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java`
at line 49, Remove the redundant explicit modifiers from interface constants to
unify style: in OAuth2PluginConstants, change the earlier constants that
currently declare "public static final" to use the implicit interface-constant
form (no modifiers), so they match the newly added ZIAM_PROVIDER_NAME and other
provider constants; locate the constants declared in OAuth2PluginConstants (the
provider name constants and any others with explicit public static final) and
remove the explicit modifiers while keeping names and values unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java`:
- Line 49: Remove the redundant explicit modifiers from interface constants to
unify style: in OAuth2PluginConstants, change the earlier constants that
currently declare "public static final" to use the implicit interface-constant
form (no modifiers), so they match the newly added ZIAM_PROVIDER_NAME and other
provider constants; locate the constants declared in OAuth2PluginConstants (the
provider name constants and any others with explicit public static final) and
remove the explicit modifiers while keeping names and values unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: 7884306f-3759-461a-afa7-7109404dfeef

📥 Commits

Reviewing files that changed from the base of the PR and between 21ebc82 and c179a4f.

📒 Files selected for processing (1)
  • abstraction/src/main/java/org/zstack/abstraction/sso/OAuth2PluginConstants.java

@MatheMatrix MatheMatrix force-pushed the sync/hanyu.liang/feature-5.5.22-zcf-temporary branch from c179a4f to 83a33a1 Compare April 24, 2026 02:40
@MatheMatrix MatheMatrix force-pushed the sync/hanyu.liang/feature-5.5.22-zcf-temporary branch from 83a33a1 to 0515305 Compare April 24, 2026 10:32
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.

2 participants