16 lines
758 B
TypeScript
16 lines
758 B
TypeScript
/** Asymmetrische OIDC-Signaturalgorithmen zur Auswahl, Standard RS256. */
|
|
export const OIDC_SIGNING_ALGS = ["RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512"] as const;
|
|
|
|
export function normalizeSigningAlg(raw: string | null | undefined): string {
|
|
const alg = (raw ?? "").trim().toUpperCase();
|
|
return (OIDC_SIGNING_ALGS as readonly string[]).includes(alg) ? alg : "RS256";
|
|
}
|
|
|
|
/** Anmelde-Button-Beschriftung: leer wird Standard, längere Texte auf 60 Zeichen gekürzt. */
|
|
export const DEFAULT_OIDC_BUTTON_LABEL = "Mit SSO anmelden";
|
|
|
|
export function normalizeButtonLabel(raw: string | null | undefined): string {
|
|
const label = (raw ?? "").trim().slice(0, 60);
|
|
return label === "" ? DEFAULT_OIDC_BUTTON_LABEL : label;
|
|
}
|