Missing: The validation is currently not working as expected, and I cannot get the backend to give me meaningful data helping us "go back" to the field that wasn't valid. I really don't want to put all the meaningful validation on the front-end; that's the road to - perdition, the back-end must be usable by people less assiduous than we are. Also: Need to make the button bar work better; maybe each panel can provide a custom button bar if one is needed?
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { msg } from "@lit/localize";
|
|
|
|
import { DigestAlgorithmEnum, SignatureAlgorithmEnum, SpBindingEnum } from "@goauthentik/api";
|
|
|
|
type Option<T> = [string, T, boolean?];
|
|
|
|
function toOptions<T>(options: Option<T>[]) {
|
|
return options.map(([label, value, isDefault]: Option<T>) => ({
|
|
label,
|
|
value,
|
|
default: isDefault ?? false,
|
|
}));
|
|
}
|
|
|
|
export const spBindingOptions = toOptions([
|
|
[msg("Redirect"), SpBindingEnum.Redirect, true],
|
|
[msg("Post"), SpBindingEnum.Post],
|
|
]);
|
|
|
|
export const digestAlgorithmOptions = toOptions([
|
|
["SHA1", DigestAlgorithmEnum._200009Xmldsigsha1],
|
|
["SHA256", DigestAlgorithmEnum._200104Xmlencsha256, true],
|
|
["SHA384", DigestAlgorithmEnum._200104XmldsigMoresha384],
|
|
["SHA512", DigestAlgorithmEnum._200104Xmlencsha512],
|
|
]);
|
|
|
|
export const signatureAlgorithmOptions = toOptions([
|
|
["RSA-SHA1", SignatureAlgorithmEnum._200009XmldsigrsaSha1],
|
|
["RSA-SHA256", SignatureAlgorithmEnum._200104XmldsigMorersaSha256, true],
|
|
["RSA-SHA384", SignatureAlgorithmEnum._200104XmldsigMorersaSha384],
|
|
["RSA-SHA512", SignatureAlgorithmEnum._200104XmldsigMorersaSha512],
|
|
["DSA-SHA1", SignatureAlgorithmEnum._200009XmldsigdsaSha1],
|
|
]);
|