2021-05-04 17:58:18 +00:00
|
|
|
import type { TFunction } from "i18next";
|
|
|
|
import type { AccessType } from "keycloak-admin/lib/defs/whoAmIRepresentation";
|
2021-07-21 09:20:32 +00:00
|
|
|
import type { ComponentType } from "react";
|
|
|
|
import type { MatchOptions } from "use-react-router-breadcrumbs";
|
2021-07-22 10:17:53 +00:00
|
|
|
import authenticationRoutes from "./authentication/routes";
|
2021-07-22 11:17:00 +00:00
|
|
|
import clientScopesRoutes from "./client-scopes/routes";
|
2021-07-21 15:08:40 +00:00
|
|
|
import clientRoutes from "./clients/routes";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { DashboardSection } from "./dashboard/Dashboard";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { EventsSection } from "./events/EventsSection";
|
|
|
|
import { GroupsSection } from "./groups/GroupsSection";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { SearchGroups } from "./groups/SearchGroups";
|
|
|
|
import {
|
|
|
|
AddIdentityProvider,
|
|
|
|
IdentityProviderCrumb,
|
|
|
|
} from "./identity-providers/add/AddIdentityProvider";
|
|
|
|
import { AddOpenIdConnect } from "./identity-providers/add/AddOpenIdConnect";
|
|
|
|
import { DetailSettings } from "./identity-providers/add/DetailSettings";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { IdentityProvidersSection } from "./identity-providers/IdentityProvidersSection";
|
|
|
|
import { PageNotFoundSection } from "./PageNotFoundSection";
|
2021-07-22 14:18:59 +00:00
|
|
|
import realmRoleRoutes from "./realm-roles/routes";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { AESGeneratedSettings } from "./realm-settings/key-providers/aes-generated/AESGeneratedForm";
|
|
|
|
import { ECDSAGeneratedSettings } from "./realm-settings/key-providers/ecdsa-generated/ECDSAGeneratedForm";
|
|
|
|
import { HMACGeneratedSettings } from "./realm-settings/key-providers/hmac-generated/HMACGeneratedForm";
|
|
|
|
import { JavaKeystoreSettings } from "./realm-settings/key-providers/java-keystore/JavaKeystoreForm";
|
|
|
|
import { RSAGeneratedSettings } from "./realm-settings/key-providers/rsa-generated/RSAGeneratedForm";
|
|
|
|
import { RSASettings } from "./realm-settings/key-providers/rsa/RSAForm";
|
2021-07-20 18:47:05 +00:00
|
|
|
import {
|
|
|
|
EditProviderCrumb,
|
|
|
|
RealmSettingsSection,
|
|
|
|
} from "./realm-settings/RealmSettingsSection";
|
2021-07-22 07:13:35 +00:00
|
|
|
import realmRoutes from "./realm/routes";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { SessionsSection } from "./sessions/SessionsSection";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { LdapMapperDetails } from "./user-federation/ldap/mappers/LdapMapperDetails";
|
|
|
|
import { UserFederationKerberosSettings } from "./user-federation/UserFederationKerberosSettings";
|
|
|
|
import { UserFederationLdapSettings } from "./user-federation/UserFederationLdapSettings";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { UserFederationSection } from "./user-federation/UserFederationSection";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { UserGroups } from "./user/UserGroups";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { UsersSection } from "./user/UsersSection";
|
2021-03-03 13:53:42 +00:00
|
|
|
import { UsersTabs } from "./user/UsersTabs";
|
2020-10-21 11:31:41 +00:00
|
|
|
|
2021-07-21 09:20:32 +00:00
|
|
|
export type RouteDef = {
|
|
|
|
path: string;
|
|
|
|
component: ComponentType;
|
|
|
|
breadcrumb: ((t: TFunction) => string | ComponentType<any>) | null;
|
2020-10-21 11:31:41 +00:00
|
|
|
access: AccessType;
|
2021-07-21 09:20:32 +00:00
|
|
|
matchOptions?: MatchOptions;
|
2020-10-21 11:31:41 +00:00
|
|
|
};
|
|
|
|
|
2021-07-21 09:20:32 +00:00
|
|
|
export const routes: RouteDef[] = [
|
2021-07-22 10:17:53 +00:00
|
|
|
...authenticationRoutes,
|
2021-07-21 15:08:40 +00:00
|
|
|
...clientRoutes,
|
2021-07-22 11:17:00 +00:00
|
|
|
...clientScopesRoutes,
|
2021-07-22 14:18:59 +00:00
|
|
|
...realmRoleRoutes,
|
2021-07-22 07:13:35 +00:00
|
|
|
...realmRoutes,
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/users",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: UsersSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("users:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "query-users",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2021-03-03 13:53:42 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/users/add-user",
|
|
|
|
component: UsersTabs,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("users:createUser"),
|
2021-03-03 13:53:42 +00:00
|
|
|
access: "manage-users",
|
|
|
|
},
|
2021-03-23 19:02:27 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/users/:id",
|
|
|
|
component: UserGroups,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("users:userDetails"),
|
2021-03-23 19:02:27 +00:00
|
|
|
access: "manage-users",
|
|
|
|
},
|
2021-03-11 20:23:08 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/users/:id/:tab",
|
|
|
|
component: UsersTabs,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("users:userDetails"),
|
2021-03-11 20:23:08 +00:00
|
|
|
access: "manage-users",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/sessions",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: SessionsSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("sessions:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-03-05 10:18:47 +00:00
|
|
|
path: "/:realm/events/:tab?",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: EventsSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("events:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-events",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-04-19 11:41:07 +00:00
|
|
|
path: "/:realm/realm-settings/:tab?",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: RealmSettingsSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("realmSettings"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2021-07-12 18:19:50 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/aes-generated/settings",
|
|
|
|
component: AESGeneratedSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-12 18:19:50 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-19 13:58:35 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/ecdsa-generated/settings",
|
|
|
|
component: ECDSAGeneratedSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-19 13:58:35 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-16 08:22:08 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/hmac-generated/settings",
|
|
|
|
component: HMACGeneratedSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-16 08:22:08 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-20 13:49:39 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/java-keystore/settings",
|
|
|
|
component: JavaKeystoreSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-20 13:49:39 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-19 15:07:19 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/rsa-generated/settings",
|
|
|
|
component: RSAGeneratedSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-19 15:07:19 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-19 18:35:06 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/realm-settings/keys/:id?/rsa/settings",
|
|
|
|
component: RSASettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => EditProviderCrumb,
|
2021-07-19 18:35:06 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/identity-providers",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: IdentityProvidersSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("identityProviders"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-identity-providers",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2021-05-06 18:59:00 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/identity-providers/oidc",
|
|
|
|
component: AddOpenIdConnect,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("identity-providers:addOpenIdProvider"),
|
2021-05-06 18:59:00 +00:00
|
|
|
access: "manage-identity-providers",
|
|
|
|
},
|
2021-06-14 11:31:45 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/identity-providers/keycloak-oidc",
|
|
|
|
component: AddOpenIdConnect,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("identity-providers:addKeycloakOpenIdProvider"),
|
2021-06-14 11:31:45 +00:00
|
|
|
access: "manage-identity-providers",
|
|
|
|
},
|
2021-04-21 13:18:45 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/identity-providers/:id",
|
|
|
|
component: AddIdentityProvider,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: () => IdentityProviderCrumb,
|
2021-04-21 13:18:45 +00:00
|
|
|
access: "manage-identity-providers",
|
|
|
|
},
|
2021-05-06 18:59:00 +00:00
|
|
|
{
|
2021-06-14 11:31:45 +00:00
|
|
|
path: "/:realm/identity-providers/:id/:tab?",
|
2021-05-06 18:59:00 +00:00
|
|
|
component: DetailSettings,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "manage-identity-providers",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/user-federation",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: UserFederationSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("userFederation"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2020-12-08 06:30:53 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/user-federation/kerberos",
|
2020-12-16 07:02:41 +00:00
|
|
|
component: UserFederationSection,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/user-federation/kerberos/:id",
|
2020-12-08 06:30:53 +00:00
|
|
|
component: UserFederationKerberosSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:settings"),
|
2020-12-08 06:30:53 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-02-09 18:01:23 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/user-federation/kerberos/new",
|
|
|
|
component: UserFederationKerberosSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:settings"),
|
2021-02-09 18:01:23 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-04-05 19:55:12 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/user-federation/ldap",
|
|
|
|
component: UserFederationSection,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-04-07 14:50:55 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/user-federation/ldap/new",
|
|
|
|
component: UserFederationLdapSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("user-federation:addOneLdap"),
|
2021-04-07 14:50:55 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2020-12-16 07:02:41 +00:00
|
|
|
{
|
2021-03-16 14:24:32 +00:00
|
|
|
path: "/:realm/user-federation/ldap/:id/:tab?",
|
2020-12-16 07:02:41 +00:00
|
|
|
component: UserFederationLdapSettings,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:settings"),
|
2020-12-16 07:02:41 +00:00
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-03-23 21:15:46 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/user-federation/ldap/:id/:tab/:mapperId",
|
2021-04-07 15:16:41 +00:00
|
|
|
component: LdapMapperDetails,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:mappingDetails"),
|
2021-03-29 15:52:56 +00:00
|
|
|
access: "view-realm",
|
2021-03-23 21:15:46 +00:00
|
|
|
},
|
2021-01-05 19:49:33 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/",
|
2021-01-15 01:44:16 +00:00
|
|
|
component: DashboardSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:home"),
|
2021-01-05 19:49:33 +00:00
|
|
|
access: "anyone",
|
|
|
|
},
|
2021-03-01 15:06:04 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/groups/search",
|
|
|
|
component: SearchGroups,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("groups:searchGroups"),
|
2021-03-01 15:06:04 +00:00
|
|
|
access: "query-groups",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/:realm/groups",
|
|
|
|
component: GroupsSection,
|
|
|
|
breadcrumb: null,
|
2021-07-21 09:20:32 +00:00
|
|
|
access: "query-groups",
|
2021-03-01 15:06:04 +00:00
|
|
|
matchOptions: {
|
|
|
|
exact: false,
|
|
|
|
},
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
|
|
|
path: "/",
|
2021-01-15 01:44:16 +00:00
|
|
|
component: DashboardSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:home"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "anyone",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2020-11-12 18:59:23 +00:00
|
|
|
path: "*",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: PageNotFoundSection,
|
2021-01-05 19:49:33 +00:00
|
|
|
breadcrumb: null,
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "anyone",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
];
|