Files
authentik/website/docs/add-secure-apps/providers/radius/HashSupport.tsx
Teffen Ellis 5bdef1c4f6 website/docs: Prepare for monorepo. (#14119)
* docusaurus-theme: Fix header alignment, overscroll, vertical padding.

* docusaurus-theme: Lint.

* website/docs: Prepare for monorepo packages.

* website/docs: Clean up dependencies. Tidy table.

* website/docs: Fix issue where Prettier affects example content.

* website/docs: Temp fix for stale packages.
2025-04-24 18:22:56 +00:00

83 lines
2.1 KiB
TypeScript

import styles from "./styles.module.css";
const RADIUSProtocols = [
"PAP",
"CHAP",
"Digest",
"MS-CHAP",
"PEAP",
"MS-CHAPv2",
"Cisco LEAP",
"EAP-GTC",
"EAP-MD5",
"EAP-PWD",
] as const satisfies string[];
type RADIUSProtocol = (typeof RADIUSProtocols)[number];
const HashKinds = [
"Cleartext",
"NT",
"MD5",
"Salted MD5",
"SHA1",
"Salted SHA1",
"Unix Crypt",
] as const satisfies string[];
type HashKind = (typeof HashKinds)[number];
const supportMatrix: Record<HashKind, RADIUSProtocol[]> = {
"Cleartext": [
"PAP",
"CHAP",
"Digest",
"MS-CHAP",
"PEAP",
"MS-CHAPv2",
"Cisco LEAP",
"EAP-GTC",
"EAP-MD5",
"EAP-PWD",
],
"NT": ["PAP", "MS-CHAP", "PEAP", "MS-CHAPv2", "Cisco LEAP", "EAP-GTC"],
"MD5": ["PAP", "EAP-GTC"],
"Salted MD5": ["PAP", "EAP-GTC"],
"SHA1": ["PAP", "EAP-GTC"],
"Salted SHA1": ["PAP", "EAP-GTC", "EAP-PWD"],
"Unix Crypt": ["PAP", "EAP-GTC", "EAP-PWD"],
};
export const HashSupport: React.FC = () => {
return (
<table className={styles.table}>
<thead>
<tr>
<th></th>
{HashKinds.map((hashKind, i) => (
<th key={i}>{hashKind}</th>
))}
</tr>
</thead>
<tbody>
{RADIUSProtocols.map((radiusProtocol, i) => (
<tr key={i}>
<td>{radiusProtocol}</td>
{HashKinds.map((hashKind) => {
const protocols = supportMatrix[hashKind];
const supported = protocols.includes(radiusProtocol);
return (
<td data-supported={supported} key={hashKind}>
{supported ? "✓" : "✗"}
</td>
);
})}
</tr>
))}
</tbody>
</table>
);
};