github-advanced-security[bot] commented on code in PR #1087: URL: https://github.com/apache/dubbo-go-pixiu/pull/1087#discussion_r4528945901
########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', + accountCreated: '管理员账号已创建', + accountCreateError: '无法创建账号', + creatingAccount: '创建中…', + createAccount: '创建账号', + changePassword: '修改密码', + changePasswordDescription: '输入当前密码后即可设置新密码。', + currentPassword: '当前密码', + newPassword: '新密码', + confirmNewPassword: '确认新密码', + passwordFieldsRequired: '请填写所有密码字段', + newPasswordLength: '新密码长度需要为 8 到 128 个字符', + newPasswordsMismatch: '两次输入的新密码不一致', + passwordMustChange: '新密码不能与当前密码相同', + passwordUpdated: '密码已更新', + passwordUpdateError: '无法修改密码', + updatingPassword: '修改中…', + updatePassword: '更新密码', + }, + en: { + eyebrow: 'ACCOUNT', + title: 'Account', + description: 'View your account and update your password.', + accountInformation: 'Account information', + signedInUser: 'Signed-in user', + username: 'Username', + role: 'Role', + administrator: 'Administrator', + user: 'User', + loadError: 'Unable to load account information', + registerAdministrator: 'Register administrator', + registerDescription: + 'Only administrators can create accounts. New accounts also receive the administrator role.', + password: 'Password', + confirmPassword: 'Confirm password', + accountFieldsRequired: 'Complete all account fields', + accountPasswordLength: 'Use a password between 8 and 128 characters', + accountPasswordsMismatch: 'The passwords do not match', + accountCreated: 'Administrator account created', + accountCreateError: 'Unable to create account', + creatingAccount: 'Creating…', + createAccount: 'Create account', + changePassword: 'Change password', + changePasswordDescription: 'Enter your current password to save a new one.', + currentPassword: 'Current password', + newPassword: 'New password', + confirmNewPassword: 'Confirm new password', + passwordFieldsRequired: 'Complete all password fields', + newPasswordLength: 'Use a new password between 8 and 128 characters', + newPasswordsMismatch: 'The new passwords do not match', + passwordMustChange: 'Choose a password different from the current one', + passwordUpdated: 'Password updated', + passwordUpdateError: 'Unable to update password', + updatingPassword: 'Updating…', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZq-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZq&open=AaHGvmWwDj6dXCxw5xZq&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/272) ########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', + accountCreated: '管理员账号已创建', + accountCreateError: '无法创建账号', + creatingAccount: '创建中…', + createAccount: '创建账号', + changePassword: '修改密码', + changePasswordDescription: '输入当前密码后即可设置新密码。', + currentPassword: '当前密码', + newPassword: '新密码', + confirmNewPassword: '确认新密码', + passwordFieldsRequired: '请填写所有密码字段', + newPasswordLength: '新密码长度需要为 8 到 128 个字符', + newPasswordsMismatch: '两次输入的新密码不一致', + passwordMustChange: '新密码不能与当前密码相同', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZp-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZp&open=AaHGvmWwDj6dXCxw5xZp&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/273) ########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', + accountCreated: '管理员账号已创建', + accountCreateError: '无法创建账号', + creatingAccount: '创建中…', + createAccount: '创建账号', + changePassword: '修改密码', + changePasswordDescription: '输入当前密码后即可设置新密码。', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZm-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZm&open=AaHGvmWwDj6dXCxw5xZm&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/276) ########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', + accountCreated: '管理员账号已创建', + accountCreateError: '无法创建账号', + creatingAccount: '创建中…', + createAccount: '创建账号', + changePassword: '修改密码', + changePasswordDescription: '输入当前密码后即可设置新密码。', + currentPassword: '当前密码', + newPassword: '新密码', + confirmNewPassword: '确认新密码', + passwordFieldsRequired: '请填写所有密码字段', + newPasswordLength: '新密码长度需要为 8 到 128 个字符', + newPasswordsMismatch: '两次输入的新密码不一致', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZo-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZo&open=AaHGvmWwDj6dXCxw5xZo&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/274) ########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', + accountCreated: '管理员账号已创建', + accountCreateError: '无法创建账号', + creatingAccount: '创建中…', + createAccount: '创建账号', + changePassword: '修改密码', + changePasswordDescription: '输入当前密码后即可设置新密码。', + currentPassword: '当前密码', + newPassword: '新密码', + confirmNewPassword: '确认新密码', + passwordFieldsRequired: '请填写所有密码字段', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZn-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZn&open=AaHGvmWwDj6dXCxw5xZn&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/275) ########## admin/web/src/features/profile/AccountPage.tsx: ########## @@ -0,0 +1,421 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect, useState } from 'react' +import { profileApi, type UserInfo } from '../../services/profile-api' + +type Language = 'zh' | 'en' +type Feedback = Readonly<{ kind: 'error' | 'success'; text: string }> +type AccountCopy = Readonly<{ + eyebrow: string + title: string + description: string + accountInformation: string + signedInUser: string + username: string + role: string + administrator: string + user: string + loadError: string + registerAdministrator: string + registerDescription: string + password: string + confirmPassword: string + accountFieldsRequired: string + accountPasswordLength: string + accountPasswordsMismatch: string + accountCreated: string + accountCreateError: string + creatingAccount: string + createAccount: string + changePassword: string + changePasswordDescription: string + currentPassword: string + newPassword: string + confirmNewPassword: string + passwordFieldsRequired: string + newPasswordLength: string + newPasswordsMismatch: string + passwordMustChange: string + passwordUpdated: string + passwordUpdateError: string + updatingPassword: string + updatePassword: string +}> + +const accountCopy: Record<Language, AccountCopy> = { + zh: { + eyebrow: 'ACCOUNT CENTER', + title: '个人中心', + description: '查看账号信息并修改登录密码。', + accountInformation: '账号信息', + signedInUser: '当前登录账号', + username: '用户名', + role: '角色', + administrator: '管理员', + user: '用户', + loadError: '无法加载账号信息', + registerAdministrator: '注册管理员账号', + registerDescription: '仅管理员可以创建账号;新账号也将获得管理员角色。', + password: '密码', + confirmPassword: '确认密码', + accountFieldsRequired: '请填写所有新账号字段', + accountPasswordLength: '密码长度需要为 8 到 128 个字符', + accountPasswordsMismatch: '两次输入的密码不一致', Review Comment: ## SonarCloud / Credentials should not be hard-coded <!--SONAR_ISSUE_KEY:AaHGvmWwDj6dXCxw5xZl-->Review this potentially hard-coded password. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AaHGvmWwDj6dXCxw5xZl&open=AaHGvmWwDj6dXCxw5xZl&pullRequest=1087">SonarQube Cloud</a></p> [Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/277) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
