Files
authentik/web/src/admin/applications/wizard/methods/radius/ak-application-wizard-authentication-by-radius.ts
Ken Sternberg e164661321 Merge branch 'web/config-provider' into web/config-provider-2-tenant
* web/config-provider:
  web: bump API Client version (#7803)
  events: add graph for event volume (#7639)
  website/docs: change links to point to our YouTube (#7794)
  web: bump core-js from 3.33.3 to 3.34.0 in /web (#7796)
  core: bump golang from 1.21.4-bookworm to 1.21.5-bookworm (#7798)
  web: bump the wdio group in /tests/wdio with 4 updates (#7799)
  web/admin: revise wizard form handling (#7331)
  web: bump the eslint group in /tests/wdio with 2 updates (#7783)
  web: bump the sentry group in /web with 2 updates (#7784)
  web: bump the eslint group in /web with 2 updates (#7785)
  web: bump chart.js from 4.4.0 to 4.4.1 in /web (#7786)
  website: bump @types/react from 18.2.41 to 18.2.42 in /website (#7787)
  website: bump react-tooltip from 5.24.0 to 5.25.0 in /website (#7788)
  outposts/ldap: avoid nil ptr deref in MemorySearcher (#7767)
2023-12-06 10:06:55 -08:00

83 lines
3.9 KiB
TypeScript

import "@goauthentik/admin/applications/wizard/ak-wizard-title";
import "@goauthentik/admin/common/ak-crypto-certificate-search";
import "@goauthentik/admin/common/ak-flow-search/ak-tenanted-flow-search";
import { ascii_letters, digits, first, randomString } from "@goauthentik/common/utils";
import "@goauthentik/components/ak-text-input";
import { WithTenantConfig } from "@goauthentik/elements/Interface/tenantProvider";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { msg } from "@lit/localize";
import { customElement } from "@lit/reactive-element/decorators.js";
import { html } from "lit";
import { ifDefined } from "lit/directives/if-defined.js";
import { FlowsInstancesListDesignationEnum, RadiusProvider } from "@goauthentik/api";
import BaseProviderPanel from "../BaseProviderPanel";
@customElement("ak-application-wizard-authentication-by-radius")
export class ApplicationWizardAuthenticationByRadius extends WithTenantConfig(BaseProviderPanel) {
render() {
const provider = this.wizard.provider as RadiusProvider | undefined;
const errors = this.wizard.errors.provider;
return html`<ak-wizard-title>${msg("Configure Radius Provider")}</ak-wizard-title>
<form class="pf-c-form pf-m-horizontal" @input=${this.handleChange}>
<ak-text-input
name="name"
label=${msg("Name")}
value=${ifDefined(provider?.name)}
.errorMessages=${errors?.name ?? []}
required
>
</ak-text-input>
<ak-form-element-horizontal
label=${msg("Authentication flow")}
?required=${true}
name="authorizationFlow"
.errorMessages=${errors?.authorizationFlow ?? []}
>
<ak-tenanted-flow-search
flowType=${FlowsInstancesListDesignationEnum.Authentication}
.currentFlow=${provider?.authorizationFlow}
.tenantFlow=${this.tenant.flowAuthentication}
required
></ak-tenanted-flow-search>
<p class="pf-c-form__helper-text">
${msg("Flow used for users to authenticate.")}
</p>
</ak-form-element-horizontal>
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-text-input
name="sharedSecret"
label=${msg("Shared secret")}
.errorMessages=${errors?.sharedSecret ?? []}
value=${first(
provider?.sharedSecret,
randomString(128, ascii_letters + digits)
)}
required
></ak-text-input>
<ak-text-input
name="clientNetworks"
label=${msg("Client Networks")}
value=${first(provider?.clientNetworks, "0.0.0.0/0, ::/0")}
.errorMessages=${errors?.clientNetworks ?? []}
required
help=${msg(`List of CIDRs (comma-seperated) that clients can connect from. A more specific
CIDR will match before a looser one. Clients connecting from a non-specified CIDR
will be dropped.`)}
></ak-text-input>
</div>
</ak-form-group>
</form>`;
}
}
export default ApplicationWizardAuthenticationByRadius;