Repository navigation
Conversation
Reviewer's GuideAPIRedefine credential channel IDs as upstream-specific identifiers, remove channel capabilities, and shift channel declaration responsibility to each submodule’s register method.
Uses of the APIRegister the built-in offline and Floodgate channels explicitly, and register one channel for each configured Yggdrasil entry.
ImplementationGenerate Yggdrasil credential channel IDs from each entry ID so credentials identify their specific upstream.
Simplify the channel registry to store registered IDs only, and remove core startup registration based on the old submodule property.
Remove registration-ability checks from the authentication and rename flows now that channel capabilities are gone.
UIRemove user-facing messages and rendering helpers for registration-disabled outcomes that are no longer enforced.
ConfigurationRemove the core disable-registration option and its localized configuration comments along with the obsolete configuration class.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt" line_range="38" />
<code_context>
private val knownUserUUID: UUID? = null,
) : HyperZoneCredential, IPropertiesHolder by PropertiesHolder() {
- override val channelId: String = CHANNEL_ID
+ override val channelId: String = "$CHANNEL_ID:$entryId"
override val credentialId: String = "$entryId:$authenticatedUUID"
</code_context>
<issue_to_address>
**Disabled registration is bypassed**
When registration is disabled and an unbound Yggdrasil credential reaches the rename flow, `RenameCommand` looks up the credential’s `yggdrasil:<entryId>` channel ID, but `YggdrasilSubModule` registers only `yggdrasil`. The lookup returns null, so the `canRegister == false` check does not block user creation and registration proceeds despite the restriction.
Make the rename flow check the registered Yggdrasil ability for per-entry credentials before creating a user.
</issue_to_address>
### Comment 2
<location path="subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt" line_range="38" />
<code_context>
private val knownUserUUID: UUID? = null,
) : HyperZoneCredential, IPropertiesHolder by PropertiesHolder() {
- override val channelId: String = CHANNEL_ID
+ override val channelId: String = "$CHANNEL_ID:$entryId"
override val credentialId: String = "$entryId:$authenticatedUUID"
</code_context>
<issue_to_address>
**Per-upstream registration blocks are ignored**
When `disableRegistration` contains `yggdrasil:<entryId>` for an upstream and a player authenticates through it, `YggdrasilCredentialService` checks registration ability using the fixed `yggdrasil` ID, while the credential now identifies itself as `yggdrasil:<entryId>`. A `disableRegistration` entry for one upstream therefore does not stop the service from creating a user automatically after authentication with that upstream.
Register each configured Yggdrasil entry’s channel ID and have the authentication service check the corresponding credential’s channel ID.
</issue_to_address>
### Comment 3
<location path="subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt" line_range="38" />
<code_context>
private val knownUserUUID: UUID? = null,
) : HyperZoneCredential, IPropertiesHolder by PropertiesHolder() {
- override val channelId: String = CHANNEL_ID
+ override val channelId: String = "$CHANNEL_ID:$entryId"
override val credentialId: String = "$entryId:$authenticatedUUID"
</code_context>
<issue_to_address>
**Player API documents stale Yggdrasil ID**
When a consumer uses `HyperZonePlayer.authChannelId` to identify Yggdrasil authentication, `VelocityHyperZonePlayer.authChannelId` returns the submitted credential’s `channelId`, so Yggdrasil players now report `yggdrasil:<entryId>`. The exported `HyperZonePlayer` contract still lists `"yggdrasil"` as the example value, leaving consumers that compare against the documented value unable to recognize Yggdrasil authentication.
Update the `authChannelId` contract to document the entry-specific format and clarify how consumers should identify the Yggdrasil family of channels.
</issue_to_address>Sourcery assessment
Approval pending. 3 findings to address first.
Blocking findings: subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt:38, subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt:38, subplugin/auth-yggd/src/main/kotlin/icu/h2l/login/auth/online/credential/YggdrasilHyperZoneCredential.kt:38
Signed-off-by: 秋雨落 <i@rain.cx>
9060600 to
856098e
Compare
Signed-off-by: 秋雨落 <i@rain.cx>
变更说明
替代#51,直接更改Channel Id的语义,可用于标识唯一上游来源。
对于Offline和Floodgate,它就是对应的channelId(即
offline和floodgate);对于Yggdrasil,它是
yggdrasil:<entryId>。关联范围
openvcauth-yggdauth-offlinedata-mergeprofile-skinapi变更类型
测试与验证
请说明你做了哪些验证,例如:
兼容性与风险
这是一个API的breaking change,更改了
HyperZoneCredential#channelId的语义。其他补充
如有截图、日志、配置示例或后续 TODO,请在此补充。
Summary by Sourcery
Make credential channel IDs uniquely identify their upstream authentication source and update the API and authentication modules to use the new semantics.
New Features:
Enhancements: