2022-02-28 15:22:00 +00:00
|
|
|
import { lazy } from "react";
|
2022-08-19 18:05:09 +00:00
|
|
|
import type { Path } from "react-router-dom-v5-compat";
|
|
|
|
import { generatePath } from "react-router-dom-v5-compat";
|
2022-02-28 15:22:00 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type ProviderType =
|
|
|
|
| "aes-generated"
|
|
|
|
| "ecdsa-generated"
|
|
|
|
| "hmac-generated"
|
|
|
|
| "java-keystore"
|
|
|
|
| "rsa"
|
2022-03-07 14:40:39 +00:00
|
|
|
| "rsa-enc"
|
2022-02-28 15:22:00 +00:00
|
|
|
| "rsa-enc-generated"
|
|
|
|
| "rsa-generated";
|
|
|
|
|
|
|
|
export type KeyProviderParams = {
|
|
|
|
id: string;
|
|
|
|
providerType: ProviderType;
|
|
|
|
realm: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const KeyProviderFormRoute: RouteDef = {
|
|
|
|
path: "/:realm/realm-settings/keys/providers/:id/:providerType/settings",
|
|
|
|
component: lazy(() => import("../keys/key-providers/KeyProviderForm")),
|
|
|
|
breadcrumb: (t) => t("realm-settings:editProvider"),
|
|
|
|
access: "view-realm",
|
|
|
|
};
|
|
|
|
|
2022-08-19 18:05:09 +00:00
|
|
|
export const toKeyProvider = (params: KeyProviderParams): Partial<Path> => ({
|
2022-02-28 15:22:00 +00:00
|
|
|
pathname: generatePath(KeyProviderFormRoute.path, params),
|
|
|
|
});
|