web: initial migration to lingui
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { SAMLSource, SourcesApi, SAMLSourceBindingTypeEnum, SAMLSourceNameIdPolicyEnum, CryptoApi, SAMLSourceDigestAlgorithmEnum, SAMLSourceSignatureAlgorithmEnum, FlowsApi, FlowDesignationEnum } from "authentik-api";
|
||||
import { gettext } from "django";
|
||||
import { t } from "@lingui/macro";
|
||||
import { customElement, property } from "lit-element";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
import { DEFAULT_CONFIG } from "../../../api/Config";
|
||||
@ -25,9 +25,9 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
|
||||
getSuccessMessage(): string {
|
||||
if (this.source) {
|
||||
return gettext("Successfully updated source.");
|
||||
return t`Successfully updated source.`;
|
||||
} else {
|
||||
return gettext("Successfully created source.");
|
||||
return t`Successfully created source.`;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,13 +47,13 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
renderForm(): TemplateResult {
|
||||
return html`<form class="pf-c-form pf-m-horizontal">
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Name")}
|
||||
label=${t`Name`}
|
||||
?required=${true}
|
||||
name="name">
|
||||
<input type="text" value="${ifDefined(this.source?.name)}" class="pf-c-form-control" required>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Slug")}
|
||||
label=${t`Slug`}
|
||||
?required=${true}
|
||||
name="slug">
|
||||
<input type="text" value="${ifDefined(this.source?.slug)}" class="pf-c-form-control" required>
|
||||
@ -62,53 +62,53 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.enabled || true}>
|
||||
<label class="pf-c-check__label">
|
||||
${gettext("Enabled")}
|
||||
${t`Enabled`}
|
||||
</label>
|
||||
</div>
|
||||
</ak-form-element-horizontal>
|
||||
|
||||
<ak-form-group .expanded=${true}>
|
||||
<span slot="header">
|
||||
${gettext("Protocol settings")}
|
||||
${t`Protocol settings`}
|
||||
</span>
|
||||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("SSO URL")}
|
||||
label=${t`SSO URL`}
|
||||
?required=${true}
|
||||
name="ssoUrl">
|
||||
<input type="text" value="${ifDefined(this.source?.ssoUrl)}" class="pf-c-form-control" required>
|
||||
<p class="pf-c-form__helper-text">${gettext("URL that the initial Login request is sent to.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`URL that the initial Login request is sent to.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("SLO URL")}
|
||||
label=${t`SLO URL`}
|
||||
name="sloUrl">
|
||||
<input type="text" value="${ifDefined(this.source?.sloUrl || "")}" class="pf-c-form-control">
|
||||
<p class="pf-c-form__helper-text">${gettext("Optional URL if the IDP supports Single-Logout.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Optional URL if the IDP supports Single-Logout.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Issuer")}
|
||||
label=${t`Issuer`}
|
||||
name="issuer">
|
||||
<input type="text" value="${ifDefined(this.source?.issuer)}" class="pf-c-form-control">
|
||||
<p class="pf-c-form__helper-text">${gettext("Also known as Entity ID. Defaults the Metadata URL.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Also known as Entity ID. Defaults the Metadata URL.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Binding Type")}
|
||||
label=${t`Binding Type`}
|
||||
?required=${true}
|
||||
name="bindingType">
|
||||
<select class="pf-c-form-control">
|
||||
<option value=${SAMLSourceBindingTypeEnum.Redirect} ?selected=${this.source?.bindingType === SAMLSourceBindingTypeEnum.Redirect}>
|
||||
${gettext("Redirect binding")}
|
||||
${t`Redirect binding`}
|
||||
</option>
|
||||
<option value=${SAMLSourceBindingTypeEnum.PostAuto} ?selected=${this.source?.bindingType === SAMLSourceBindingTypeEnum.PostAuto}>
|
||||
${gettext("Post binding (auto-submit)")}
|
||||
${t`Post binding (auto-submit)`}
|
||||
</option>
|
||||
<option value=${SAMLSourceBindingTypeEnum.Post} ?selected=${this.source?.bindingType === SAMLSourceBindingTypeEnum.Post}>
|
||||
${gettext("Post binding")}
|
||||
${t`Post binding`}
|
||||
</option>
|
||||
</select>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Signing keypair")}
|
||||
label=${t`Signing keypair`}
|
||||
name="signingKp">
|
||||
<select class="pf-c-form-control">
|
||||
<option value="" ?selected=${this.source?.signingKp === undefined}>---------</option>
|
||||
@ -120,91 +120,91 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
});
|
||||
}))}
|
||||
</select>
|
||||
<p class="pf-c-form__helper-text">${gettext("Keypair which is used to sign outgoing requests. Leave empty to disable signing.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Keypair which is used to sign outgoing requests. Leave empty to disable signing.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
</div>
|
||||
</ak-form-group>
|
||||
<ak-form-group>
|
||||
<span slot="header">
|
||||
${gettext("Advanced protocol settings")}
|
||||
${t`Advanced protocol settings`}
|
||||
</span>
|
||||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="allowIdpInitiated">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.allowIdpInitiated || false}>
|
||||
<label class="pf-c-check__label">
|
||||
${gettext(" Allow IDP-initiated logins")}
|
||||
${t` Allow IDP-initiated logins`}
|
||||
</label>
|
||||
</div>
|
||||
<p class="pf-c-form__helper-text">${gettext("Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("NameID Policy")}
|
||||
label=${t`NameID Policy`}
|
||||
?required=${true}
|
||||
name="nameIdPolicy">
|
||||
<select class="pf-c-form-control">
|
||||
<option value=${SAMLSourceNameIdPolicyEnum._20nameidFormatpersistent} ?selected=${this.source?.nameIdPolicy === SAMLSourceNameIdPolicyEnum._20nameidFormatpersistent}>
|
||||
${gettext("Persistent")}
|
||||
${t`Persistent`}
|
||||
</option>
|
||||
<option value=${SAMLSourceNameIdPolicyEnum._11nameidFormatemailAddress} ?selected=${this.source?.nameIdPolicy === SAMLSourceNameIdPolicyEnum._11nameidFormatemailAddress}>
|
||||
${gettext("Email address")}
|
||||
${t`Email address`}
|
||||
</option>
|
||||
<option value=${SAMLSourceNameIdPolicyEnum._20nameidFormatWindowsDomainQualifiedName} ?selected=${this.source?.nameIdPolicy === SAMLSourceNameIdPolicyEnum._20nameidFormatWindowsDomainQualifiedName}>
|
||||
${gettext("Windows")}
|
||||
${t`Windows`}
|
||||
</option>
|
||||
<option value=${SAMLSourceNameIdPolicyEnum._20nameidFormatX509SubjectName} ?selected=${this.source?.nameIdPolicy === SAMLSourceNameIdPolicyEnum._20nameidFormatX509SubjectName}>
|
||||
${gettext("X509 Subject")}
|
||||
${t`X509 Subject`}
|
||||
</option>
|
||||
<option value=${SAMLSourceNameIdPolicyEnum._20nameidFormattransient} ?selected=${this.source?.nameIdPolicy === SAMLSourceNameIdPolicyEnum._20nameidFormattransient}>
|
||||
${gettext("Transient")}
|
||||
${t`Transient`}
|
||||
</option>
|
||||
</select>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Delete temporary users after")}
|
||||
label=${t`Delete temporary users after`}
|
||||
?required=${true}
|
||||
name="temporaryUserDeleteAfter">
|
||||
<input type="text" value="${this.source?.temporaryUserDeleteAfter || "days=1"}" class="pf-c-form-control" required>
|
||||
<p class="pf-c-form__helper-text">${gettext("Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3).")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3).`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Digest algorithm")}
|
||||
label=${t`Digest algorithm`}
|
||||
?required=${true}
|
||||
name="digestAlgorithm">
|
||||
<select class="pf-c-form-control">
|
||||
<option value=${SAMLSourceDigestAlgorithmEnum._200009Xmldsigsha1} ?selected=${this.source?.digestAlgorithm === SAMLSourceDigestAlgorithmEnum._200009Xmldsigsha1}>
|
||||
${gettext("SHA1")}
|
||||
${t`SHA1`}
|
||||
</option>
|
||||
<option value=${SAMLSourceDigestAlgorithmEnum._200104Xmlencsha256} ?selected=${this.source?.digestAlgorithm === SAMLSourceDigestAlgorithmEnum._200104Xmlencsha256 || this.source?.digestAlgorithm === undefined}>
|
||||
${gettext("SHA256")}
|
||||
${t`SHA256`}
|
||||
</option>
|
||||
<option value=${SAMLSourceDigestAlgorithmEnum._200104XmldsigMoresha384} ?selected=${this.source?.digestAlgorithm === SAMLSourceDigestAlgorithmEnum._200104XmldsigMoresha384}>
|
||||
${gettext("SHA384")}
|
||||
${t`SHA384`}
|
||||
</option>
|
||||
<option value=${SAMLSourceDigestAlgorithmEnum._200104Xmlencsha512} ?selected=${this.source?.digestAlgorithm === SAMLSourceDigestAlgorithmEnum._200104Xmlencsha512}>
|
||||
${gettext("SHA512")}
|
||||
${t`SHA512`}
|
||||
</option>
|
||||
</select>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Signature algorithm")}
|
||||
label=${t`Signature algorithm`}
|
||||
?required=${true}
|
||||
name="signatureAlgorithm">
|
||||
<select class="pf-c-form-control">
|
||||
<option value=${SAMLSourceSignatureAlgorithmEnum._200009XmldsigrsaSha1} ?selected=${this.source?.signatureAlgorithm === SAMLSourceSignatureAlgorithmEnum._200009XmldsigrsaSha1}>
|
||||
${gettext("RSA-SHA1")}
|
||||
${t`RSA-SHA1`}
|
||||
</option>
|
||||
<option value=${SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha256} ?selected=${this.source?.signatureAlgorithm === SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha256 || this.source?.signatureAlgorithm === undefined}>
|
||||
${gettext("RSA-SHA256")}
|
||||
${t`RSA-SHA256`}
|
||||
</option>
|
||||
<option value=${SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha384} ?selected=${this.source?.signatureAlgorithm === SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha384}>
|
||||
${gettext("RSA-SHA384")}
|
||||
${t`RSA-SHA384`}
|
||||
</option>
|
||||
<option value=${SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha512} ?selected=${this.source?.signatureAlgorithm === SAMLSourceSignatureAlgorithmEnum._200104XmldsigMorersaSha512}>
|
||||
${gettext("RSA-SHA512")}
|
||||
${t`RSA-SHA512`}
|
||||
</option>
|
||||
<option value=${SAMLSourceSignatureAlgorithmEnum._200009XmldsigdsaSha1} ?selected=${this.source?.signatureAlgorithm === SAMLSourceSignatureAlgorithmEnum._200009XmldsigdsaSha1}>
|
||||
${gettext("DSA-SHA1")}
|
||||
${t`DSA-SHA1`}
|
||||
</option>
|
||||
</select>
|
||||
</ak-form-element-horizontal>
|
||||
@ -212,11 +212,11 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
</ak-form-group>
|
||||
<ak-form-group>
|
||||
<span slot="header">
|
||||
${gettext("Flow settings")}
|
||||
${t`Flow settings`}
|
||||
</span>
|
||||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Pre-authentication flow")}
|
||||
label=${t`Pre-authentication flow`}
|
||||
?required=${true}
|
||||
name="preAuthenticationFlow">
|
||||
<select class="pf-c-form-control">
|
||||
@ -233,10 +233,10 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
});
|
||||
}))}
|
||||
</select>
|
||||
<p class="pf-c-form__helper-text">${gettext("Flow used before authentication.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Flow used before authentication.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Authentication flow")}
|
||||
label=${t`Authentication flow`}
|
||||
?required=${true}
|
||||
name="authenticationFlow">
|
||||
<select class="pf-c-form-control">
|
||||
@ -253,10 +253,10 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
});
|
||||
}))}
|
||||
</select>
|
||||
<p class="pf-c-form__helper-text">${gettext("Flow to use when authenticating existing users.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Flow to use when authenticating existing users.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${gettext("Enrollment flow")}
|
||||
label=${t`Enrollment flow`}
|
||||
?required=${true}
|
||||
name="enrollmentFlow">
|
||||
<select class="pf-c-form-control">
|
||||
@ -273,7 +273,7 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
});
|
||||
}))}
|
||||
</select>
|
||||
<p class="pf-c-form__helper-text">${gettext("Flow to use when enrolling new users.")}</p>
|
||||
<p class="pf-c-form__helper-text">${t`Flow to use when enrolling new users.`}</p>
|
||||
</ak-form-element-horizontal>
|
||||
</div>
|
||||
</ak-form-group>
|
||||
|
||||
Reference in New Issue
Block a user