Repository navigation
fix: no recreate hashmap in getter. #50
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * This file is part of HyperZoneLogin, licensed under the GNU Affero General Public License v3.0 or later. | ||
| * | ||
| * Copyright (C) ksqeib (庆灵) <ksqeib@qq.com> | ||
| * Copyright (C) contributors | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| * | ||
| */ | ||
|
|
||
| package icu.h2l.api.util | ||
|
|
||
| import java.util.concurrent.ConcurrentHashMap | ||
|
|
||
| class PropertiesHolder : IPropertiesHolder { | ||
| override val properties: MutableMap<String, String> = ConcurrentHashMap() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,8 @@ | |
| package icu.h2l.login.auth.floodgate.credential | ||
|
|
||
| import icu.h2l.api.profile.HyperZoneCredential | ||
| import icu.h2l.api.util.IPropertiesHolder | ||
| import icu.h2l.api.util.PropertiesHolder | ||
| import icu.h2l.login.auth.floodgate.db.FloodgateAuthRepository | ||
| import java.util.* | ||
|
|
||
|
|
@@ -32,7 +34,7 @@ class FloodgateHyperZoneCredential( | |
| private val xuid: Long, | ||
| private val suggestedProfileCreateUuid: UUID?, | ||
| private val knownUserUUID: UUID? = null, | ||
| ) : HyperZoneCredential { | ||
| ) : HyperZoneCredential, IPropertiesHolder by PropertiesHolder() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Renaming loses custom properties When a caller sets properties on a Floodgate or offline credential and then renames it, the rename methods create a credential with a fresh, empty Copy the original credential's properties into the renamed credential's holder. Also at Prompt for AI agentsIn `subplugin/auth-floodgate/src/main/kotlin/icu/h2l/login/auth/floodgate/credential/FloodgateHyperZoneCredential.kt` at line 37:
**Renaming loses custom properties**
When a caller sets properties on a Floodgate or offline credential and then renames it, the rename methods create a credential with a fresh, empty `PropertiesHolder` and do not copy the original entries, so the replacement credential loses the custom properties.
Copy the original credential's properties into the renamed credential's holder.
Also at `subplugin/auth-offline/src/main/kotlin/icu/h2l/login/auth/offline/service/OfflineHyperZoneCredential.kt:39`. |
||
| override val channelId: String = CHANNEL_ID | ||
| override val credentialId: String = trustedUuid.toString() | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.