Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public String getDefaultIssuer() {
@NonNull
@Override
public String getDisplayName() {
return UIConstants.DisplayNames.OPENMFA_GLOBAL_CONFIGURATION;
return Messages.DisplayNames_OPENMFA_GLOBAL_CONFIGURATION();
}

@DataBoundSetter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@

@Override
public String getDescription() {
return "View and manage MFA status for all users";
return Messages.MFAManagementLink_description();
}

@Override
public String getDisplayName() {
return UIConstants.DisplayNames.MFA_USER_MANAGEMENT;
return Messages.DisplayNames_MFA_USER_MANAGEMENT();

Check warning on line 141 in src/main/java/io/jenkins/plugins/openmfa/MFAManagementLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 136-141 are not covered by tests
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import hudson.model.User;
import hudson.model.UserPropertyDescriptor;
import hudson.model.userproperty.UserPropertyCategory;
import io.jenkins.plugins.openmfa.constant.UIConstants;

/**
* Descriptor for {@link MFAUserProperty}.
Expand All @@ -20,7 +19,7 @@ public MFAUserPropertyDescriptor() {
@NonNull
@Override
public String getDisplayName() {
return UIConstants.DisplayNames.MULTI_FACTOR_AUTHENTICATION;
return Messages.DisplayNames_MULTI_FACTOR_AUTHENTICATION();
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ private Defaults() {
}
}

/**
* Display names for UI components
*/
public static final class DisplayNames {

public static final String CONFIGURE_MFA = "Configure MFA";
public static final String MFA_LOGIN = "MFA Login";
public static final String MFA_SECURITY_REALM =
"MFA Security Realm (wraps existing realm)";
public static final String MFA_USER_MANAGEMENT = "MFA User Management";
public static final String MULTI_FACTOR_AUTHENTICATION =
"Multi-Factor Authentication (MFA)";
public static final String OPENMFA_GLOBAL_CONFIGURATION = "OpenMFA";

private DisplayNames() {
}
}

/**
* HTTP response codes
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config.section.title=OpenMFA 配置
config.requireMFA.title=要求所有用户启用 MFA
config.issuer.title=发行者名称
config.mfaManagement.title=MFA 用户管理
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ please.login=Por favor <a href="{0}/login">inicie sesión</a> primero.
error.invalid.code=Código de verificación inválido. Por favor, intente de nuevo.
error.locked.title=Cuenta Bloqueada Temporalmente
error.locked.message=Demasiados intentos fallidos. Por favor, intente de nuevo en
mfa.enabled.info=La autenticación multifactor está habilitada en su cuenta.
mfa.already.verified=Ya ha completado la verificación MFA para esta sesión. Puede continuar usando Jenkins con seguridad.
continue.button=Continuar a Jenkins
redirect.in.seconds=Redirigiendo en {0} segundos...
mfa.not.enabled.title=MFA no está habilitado
mfa.not.enabled.message=No ha habilitado MFA. <a href="{0}{1}">Habilite MFA ahora</a> para mejorar la seguridad de su cuenta.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# MFA Login Action Messages (Simplified Chinese)

title=多因素认证
security.alt=安全
prompt=请输入您身份验证应用中的 6 位数代码
submit.button=验证
lost.device=无法访问您的身份验证应用?请联系您的 Jenkins 管理员。
no.pending.auth=没有待处理的认证
please.login=请先<a href="{0}/login">登录</a>。
error.invalid.code=验证码无效。请重试。
error.locked.title=账户暂时被锁
error.locked.message=失败尝试次数过多。请在以下时间后重试
mfa.enabled.info=您的账户已启用多因素认证。
mfa.already.verified=您已完成本次会话的 MFA 验证。您可以安全地继续使用 Jenkins。
continue.button=继续访问 Jenkins
redirect.in.seconds={0} 秒后跳转...
mfa.not.enabled.title=MFA 未启用
mfa.not.enabled.message=您尚未启用 MFA。请<a href="{0}{1}">立即启用 MFA</a>以提高账户安全性。
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# MFA Management Dashboard - Simplified Chinese

config.link=MFA 插件设置

title=MFA 用户管理
subtitle=管理所有用户的多因素认证配置

stats.total=用户总数
stats.enabled=MFA 已启用
stats.not.enabled=未启用

users.title=用户 MFA 状态
no.users=未找到系统中的用户。

table.user=用户 ID
table.fullname=姓名
table.status=MFA 状态
table.status.disabled=未启用
table.actions=操作

reset.button=重置 MFA
reset.confirm.title=重置 MFA?
reset.confirm.messagePrefix=您确定要为用户
reset.confirm.messageSuffix=重置 MFA 吗?这将删除其当前的 MFA 配置,他们需要重新设置 MFA。
reset.confirm.cancel=取消
reset.toast.title=成功
reset.toast.theUser=用户
reset.toast.sSuffix=的
reset.success=MFA 已成功重置。
reset.error.default=重置 MFA 失败。
set.button=启用 MFA

notes.title=重要注意事项
notes.reset.warning=重置 MFA 将删除用户的当前身份验证应用配置。他们需要重新设置 MFA。
notes.user.setup=用户可以从其用户配置页面自行配置 MFA。

search.placeholder=按用户 ID 或姓名搜索

pagination.show=展示
pagination.entries=行
pagination.showing=展示
pagination.to=至
pagination.of=的
pagination.entries.label=行记录
pagination.first=首页
pagination.previous=上一页
pagination.next=下一页
pagination.last=末页
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
color: var(--text-color-secondary, #6b7280);
}

.mfa-mgmt-page-size label {
width: 3.5em;
}

.mfa-mgmt-page-size select {
min-width: 70px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
data-message="${%disable.confirm.message}"
data-cancel-text="${%disable.confirm.cancel}"
data-ok-text="${%disable.button}"
data-copy-feedback="${%copy.feedback}"
>
</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ error.toast.invalid_code.title=Invalid verification code
error.toast.invalid_code.message=The code you entered is incorrect or expired. Please try again.
error.toast.require_mfa.title=MFA required
error.toast.require_mfa.message=You must enable MFA to access this resource.
copy.feedback=Copied!
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ error.toast.invalid_code.title=Código de verificación inválido
error.toast.invalid_code.message=El código ingresado es incorrecto o ha expirado. Intente de nuevo.
error.toast.require_mfa.title=MFA requerido
error.toast.require_mfa.message=Debe habilitar MFA para acceder a este recurso.
copy.feedback=¡Copiado!
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MFA Setup Action Messages (Simplified Chinese)

title=配置多因素认证
enabled.title=多因素认证已启用
enabled.message=您的账户已受 TOTP 基础的 MFA 保护。
disable.button=禁用 MFA
disable.confirm.title=禁用 MFA?
disable.confirm.message=您确定要禁用 MFA 吗?这将删除您当前 MFA 配置,您需要重新设置 MFA。
disable.confirm.cancel=取消
setup.title=多因素认证配置
setup.message=通过启用 MFA 为您的 Jenkins 账户添加一层安全防护。
step1.title=步骤 1:扫描二维码
step1.message=使用您的身份验证应用(Google Authenticator、Authy 等)扫描此二维码
step1.qrcode.alt=二维码
step2.title=步骤 2:验证并启用
step2.message=输入您身份验证应用中的 6 位数代码以验证并启用 MFA:
verification.code=验证码:
verification.placeholder=000000
enable.button=验证并启用 MFA
notes.title=重要注意事项:
notes.required=您每次登录时都需要使用身份验证应用
notes.lost=如果您无法访问身份验证应用,请联系您的 Jenkins 管理员
notes.expiry=TOTP 代码基于时间,每 30 秒过期一次
success.toast.title=MFA 已成功启用!
success.toast.message=您的账户现在已受多因素认证保护。
success.toast.disabled.title=MFA 已禁用
success.toast.disabled.message=多因素认证已为您的账户关闭。
error.toast.invalid_code.title=验证码无效
error.toast.invalid_code.message=您输入的代码不正确或已过期。请重试。
error.toast.require_mfa.title=需要 MFA
error.toast.require_mfa.message=您必须启用 MFA 才能访问此资源。
copy.feedback=已复制!
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function _getDisableDialogLabels() {
message: el.getAttribute('data-message') || '',
okText: el.getAttribute('data-ok-text') || '',
cancelText: el.getAttribute('data-cancel-text') || '',
copyFeedback: el.getAttribute('data-copy-feedback') || 'Copied!',
};
}

Expand Down Expand Up @@ -64,12 +65,14 @@ function initNotification() {
function copySecret(button) {
const input = button.previousElementSibling;
const secret = input.value;
const labels = _getDisableDialogLabels() || {};
const feedbackText = labels.copyFeedback || 'Copied!';
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard
.writeText(secret)
.then(function () {
const originalText = button.textContent;
button.textContent = 'Copied!';
button.textContent = feedbackText;
button.classList.add('copied');
setTimeout(function () {
button.textContent = originalText;
Expand All @@ -78,14 +81,14 @@ function copySecret(button) {
})
.catch(function (err) {
console.error('Failed to copy:', err);
fallbackCopy(secret, button);
fallbackCopy(secret, button, feedbackText);
});
} else {
fallbackCopy(secret, button);
fallbackCopy(secret, button, feedbackText);
}
}

function fallbackCopy(text, button) {
function fallbackCopy(text, button, feedbackText) {
const textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
Expand All @@ -95,7 +98,7 @@ function fallbackCopy(text, button) {
try {
document.execCommand('copy');
const originalText = button.textContent;
button.textContent = 'Copied!';
button.textContent = feedbackText;
button.classList.add('copied');
setTimeout(function () {
button.textContent = originalText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ config.status.title=Estado de configuración
config.status.enabled=Habilitado
config.status.disabled=Deshabilitado

config.setup.linkHelp=Ver estado de MFA
config.setup.linkHelp=Gestionar MFA
config.setup.linkHelpNotEnabled=Configurar MFA
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MFA User Property Messages (Simplified Chinese)

config.status.title=当前状态
config.status.enabled=已启用
config.status.disabled=未启用

config.setup.linkHelp=管理 MFA
config.setup.linkHelpNotEnabled=设置 MFA
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# MFA Plugin Display Names - Default (English)

# Display names for UI components
DisplayNames.CONFIGURE_MFA=Configure MFA
DisplayNames.MFA_LOGIN=MFA Login
DisplayNames.MFA_SECURITY_REALM=MFA Security Realm (wraps existing realm)
DisplayNames.MFA_USER_MANAGEMENT=MFA User Management
DisplayNames.MULTI_FACTOR_AUTHENTICATION=Multi-Factor Authentication (MFA)
DisplayNames.OPENMFA_GLOBAL_CONFIGURATION=OpenMFA

# Management link description
MFAManagementLink.description=View and manage MFA status for all users
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# MFA Plugin Display Names - Spanish

# Display names for UI components
DisplayNames.CONFIGURE_MFA=Configurar MFA
DisplayNames.MFA_LOGIN=Inicio de sesi\u00f3n MFA
DisplayNames.MFA_SECURITY_REALM=\u00c1mbito de seguridad MFA (envuelve el \u00e1mbito existente)
DisplayNames.MFA_USER_MANAGEMENT=Gesti\u00f3n de usuarios MFA
DisplayNames.MULTI_FACTOR_AUTHENTICATION=Autenticaci\u00f3n Multifactor (MFA)
DisplayNames.OPENMFA_GLOBAL_CONFIGURATION=OpenMFA

# Management link description
MFAManagementLink.description=Ver y gestionar el estado de MFA para todos los usuarios
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# MFA Plugin Display Names - Simplified Chinese

# Display names for UI components
DisplayNames.CONFIGURE_MFA=配置 MFA
DisplayNames.MFA_LOGIN=MFA 登录
DisplayNames.MFA_SECURITY_REALM=MFA 安全域 (包裹现有域)
DisplayNames.MFA_USER_MANAGEMENT=MFA 用户管理
DisplayNames.MULTI_FACTOR_AUTHENTICATION=多因素认证 (MFA)
DisplayNames.OPENMFA_GLOBAL_CONFIGURATION=OpenMFA 全局配置

# Management link description
MFAManagementLink.description=查看并管理所有用户的 MFA 状态
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void testGetAllUsersWithoutAdminPermission(JenkinsRule j) throws Exception {

@Test
void testGetDisplayName(JenkinsRule j) {
assertEquals("MFA User Management", action.getDisplayName());
assertEquals("MFA User Management", Messages.DisplayNames_MFA_USER_MANAGEMENT());
}

@Test
Expand Down
Loading