Merge pull request #325 from Gravity-Software-srl/main
fix typing of algToKeyUriAlg + totp interface + cleanup build dir
This commit is contained in:
commit
02be899629
2
.gitignore
vendored
2
.gitignore
vendored
@ -53,6 +53,8 @@ jspm_packages
|
|||||||
|
|
||||||
# VS Code devcontainers
|
# VS Code devcontainers
|
||||||
.devcontainer
|
.devcontainer
|
||||||
|
/.yarn
|
||||||
|
/.yarnrc.yml
|
||||||
|
|
||||||
/stories/assets/fonts/
|
/stories/assets/fonts/
|
||||||
/build_storybook/
|
/build_storybook/
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
"build-storybook": "yarn build && yarn copy-keycloak-resources-to-storybook-static && build-storybook"
|
"build-storybook": "yarn build && yarn copy-keycloak-resources-to-storybook-static && build-storybook"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"keycloakify": "dist/bin/keycloakify/index.js",
|
|
||||||
"copy-keycloak-resources-to-public": "dist/bin/copy-keycloak-resources-to-public.js",
|
"copy-keycloak-resources-to-public": "dist/bin/copy-keycloak-resources-to-public.js",
|
||||||
"initialize-email-theme": "dist/bin/initialize-email-theme.js",
|
|
||||||
"download-builtin-keycloak-theme": "dist/bin/download-builtin-keycloak-theme.js",
|
"download-builtin-keycloak-theme": "dist/bin/download-builtin-keycloak-theme.js",
|
||||||
"eject-keycloak-page": "dist/bin/eject-keycloak-page.js"
|
"eject-keycloak-page": "dist/bin/eject-keycloak-page.js",
|
||||||
|
"initialize-email-theme": "dist/bin/initialize-email-theme.js",
|
||||||
|
"keycloakify": "dist/bin/keycloakify/index.js"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{ts,tsx,json,md}": [
|
"*.{ts,tsx,json,md}": [
|
||||||
|
@ -333,7 +333,6 @@ export declare namespace KcContext {
|
|||||||
totpSecretEncoded: string;
|
totpSecretEncoded: string;
|
||||||
qrUrl: string;
|
qrUrl: string;
|
||||||
policy: {
|
policy: {
|
||||||
supportedApplications: string[];
|
|
||||||
algorithm: "HmacSHA1" | "HmacSHA256" | "HmacSHA512";
|
algorithm: "HmacSHA1" | "HmacSHA256" | "HmacSHA512";
|
||||||
digits: number;
|
digits: number;
|
||||||
lookAheadWindow: number;
|
lookAheadWindow: number;
|
||||||
@ -347,6 +346,7 @@ export declare namespace KcContext {
|
|||||||
initialCounter: number;
|
initialCounter: number;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
supportedApplications: string[];
|
||||||
totpSecretQrCode: string;
|
totpSecretQrCode: string;
|
||||||
manualUrl: string;
|
manualUrl: string;
|
||||||
totpSecret: string;
|
totpSecret: string;
|
||||||
|
@ -453,8 +453,8 @@ export const kcContextMocks: KcContext[] = [
|
|||||||
manualUrl: "#",
|
manualUrl: "#",
|
||||||
totpSecret: "G4nsI8lQagRMUchH8jEG",
|
totpSecret: "G4nsI8lQagRMUchH8jEG",
|
||||||
otpCredentials: [],
|
otpCredentials: [],
|
||||||
|
supportedApplications: ["FreeOTP", "Google Authenticator"],
|
||||||
policy: {
|
policy: {
|
||||||
supportedApplications: ["FreeOTP", "Google Authenticator"],
|
|
||||||
algorithm: "HmacSHA1",
|
algorithm: "HmacSHA1",
|
||||||
digits: 6,
|
digits: 6,
|
||||||
lookAheadWindow: 1,
|
lookAheadWindow: 1,
|
||||||
|
@ -3,6 +3,7 @@ import type { PageProps } from "keycloakify/login/pages/PageProps";
|
|||||||
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
||||||
import type { KcContext } from "../kcContext";
|
import type { KcContext } from "../kcContext";
|
||||||
import type { I18n } from "../i18n";
|
import type { I18n } from "../i18n";
|
||||||
|
import { MessageKey } from "keycloakify/login/i18n/i18n";
|
||||||
|
|
||||||
export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pageId: "login-config-totp.ftl" }>, I18n>) {
|
export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pageId: "login-config-totp.ftl" }>, I18n>) {
|
||||||
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
||||||
@ -16,7 +17,7 @@ export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pa
|
|||||||
|
|
||||||
const { msg, msgStr } = i18n;
|
const { msg, msgStr } = i18n;
|
||||||
|
|
||||||
const algToKeyUriAlg: Record<KcContext.LoginConfigTotp["totp"]["policy"]["algorithm"], string> = {
|
const algToKeyUriAlg: Record<(typeof kcContext)["totp"]["policy"]["algorithm"], string> = {
|
||||||
"HmacSHA1": "SHA1",
|
"HmacSHA1": "SHA1",
|
||||||
"HmacSHA256": "SHA256",
|
"HmacSHA256": "SHA256",
|
||||||
"HmacSHA512": "SHA512"
|
"HmacSHA512": "SHA512"
|
||||||
@ -30,8 +31,8 @@ export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pa
|
|||||||
<p>{msg("loginTotpStep1")}</p>
|
<p>{msg("loginTotpStep1")}</p>
|
||||||
|
|
||||||
<ul id="kc-totp-supported-apps">
|
<ul id="kc-totp-supported-apps">
|
||||||
{totp.policy.supportedApplications.map(app => (
|
{totp.supportedApplications.map(app => (
|
||||||
<li>{app}</li>
|
<li>{msgStr(app as MessageKey, app)}</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@ -169,7 +170,7 @@ export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pa
|
|||||||
name="cancel-aia"
|
name="cancel-aia"
|
||||||
value="true"
|
value="true"
|
||||||
>
|
>
|
||||||
${msg("doCancel")}
|
{msg("doCancel")}
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user