2020-10-01 14:25:29 +00:00
|
|
|
import { TFunction } from "i18next";
|
2020-11-12 12:55:52 +00:00
|
|
|
import { AccessType } from "keycloak-admin/lib/defs/whoAmIRepresentation";
|
|
|
|
|
2020-10-01 14:25:29 +00:00
|
|
|
import { AuthenticationSection } from "./authentication/AuthenticationSection";
|
2020-10-15 17:09:32 +00:00
|
|
|
import { ClientScopeForm } from "./client-scopes/form/ClientScopeForm";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { ClientScopesSection } from "./client-scopes/ClientScopesSection";
|
|
|
|
import { NewClientForm } from "./clients/add/NewClientForm";
|
|
|
|
import { ClientsSection } from "./clients/ClientsSection";
|
|
|
|
import { ImportForm } from "./clients/import/ImportForm";
|
|
|
|
import { EventsSection } from "./events/EventsSection";
|
|
|
|
import { GroupsSection } from "./groups/GroupsSection";
|
|
|
|
import { IdentityProvidersSection } from "./identity-providers/IdentityProvidersSection";
|
|
|
|
import { PageNotFoundSection } from "./PageNotFoundSection";
|
|
|
|
import { RealmRolesSection } from "./realm-roles/RealmRolesSection";
|
|
|
|
import { RealmSettingsSection } from "./realm-settings/RealmSettingsSection";
|
|
|
|
import { NewRealmForm } from "./realm/add/NewRealmForm";
|
|
|
|
import { SessionsSection } from "./sessions/SessionsSection";
|
|
|
|
import { UserFederationSection } from "./user-federation/UserFederationSection";
|
|
|
|
import { UsersSection } from "./user/UsersSection";
|
2020-10-21 17:38:11 +00:00
|
|
|
import { MappingDetails } from "./client-scopes/details/MappingDetails";
|
2020-11-02 20:15:09 +00:00
|
|
|
import { ClientDetails } from "./clients/ClientDetails";
|
2020-12-08 06:30:53 +00:00
|
|
|
import { UserFederationKerberosSettings } from "./user-federation/UserFederationKerberosSettings";
|
2020-12-16 07:02:41 +00:00
|
|
|
import { UserFederationLdapSettings } from "./user-federation/UserFederationLdapSettings";
|
2020-11-17 21:39:28 +00:00
|
|
|
import { RoleMappingForm } from "./client-scopes/add/RoleMappingForm";
|
2021-01-05 19:49:33 +00:00
|
|
|
import { BreadcrumbsRoute } from "use-react-router-breadcrumbs";
|
2020-12-04 20:37:29 +00:00
|
|
|
import { RealmRoleTabs } from "./realm-roles/RealmRoleTabs";
|
2020-10-21 11:31:41 +00:00
|
|
|
|
2021-01-05 19:49:33 +00:00
|
|
|
export type RouteDef = BreadcrumbsRoute & {
|
2020-10-21 11:31:41 +00:00
|
|
|
access: AccessType;
|
2021-01-12 14:00:44 +00:00
|
|
|
component: () => JSX.Element;
|
2020-10-21 11:31:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
type RoutesFn = (t: TFunction) => RouteDef[];
|
|
|
|
|
2021-01-12 14:00:44 +00:00
|
|
|
export const routes: RoutesFn = (t: TFunction) => [
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/add-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: NewRealmForm,
|
|
|
|
breadcrumb: t("realm:createRealm"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "manage-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/clients",
|
2020-10-28 18:17:15 +00:00
|
|
|
component: ClientsSection,
|
|
|
|
breadcrumb: t("clients:clientList"),
|
|
|
|
access: "query-clients",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/clients/add-client",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: NewClientForm,
|
|
|
|
breadcrumb: t("clients:createClient"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "manage-clients",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/clients/import-client",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: ImportForm,
|
|
|
|
breadcrumb: t("clients:importClient"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "manage-clients",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/clients/:id",
|
|
|
|
component: ClientDetails,
|
|
|
|
breadcrumb: t("clients:clientSettings"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2021-01-13 20:47:40 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/clients/:id/:tab?/:subtab?",
|
|
|
|
component: ClientDetails,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2021-01-05 19:49:33 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/client-scopes/new",
|
2020-10-15 17:09:32 +00:00
|
|
|
component: ClientScopeForm,
|
2020-10-01 14:25:29 +00:00
|
|
|
breadcrumb: t("client-scopes:createClientScope"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "manage-clients",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2020-10-15 17:09:32 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/client-scopes/:id",
|
2020-10-15 17:09:32 +00:00
|
|
|
component: ClientScopeForm,
|
|
|
|
breadcrumb: t("client-scopes:clientScopeDetails"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-clients",
|
2020-10-15 17:09:32 +00:00
|
|
|
},
|
2021-01-13 20:47:40 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/client-scopes/:id/:tab",
|
|
|
|
component: ClientScopeForm,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-11-17 21:39:28 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/client-scopes/:scopeId/oidc-role-name-mapper",
|
2020-11-17 21:39:28 +00:00
|
|
|
component: RoleMappingForm,
|
|
|
|
breadcrumb: t("client-scopes:mappingDetails"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-10-21 17:38:11 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/client-scopes/:scopeId/:id",
|
2020-10-21 17:38:11 +00:00
|
|
|
component: MappingDetails,
|
|
|
|
breadcrumb: t("client-scopes:mappingDetails"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/client-scopes/:id",
|
2020-10-21 17:38:11 +00:00
|
|
|
component: ClientScopeForm,
|
|
|
|
breadcrumb: t("client-scopes:clientScopeDetails"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-10-28 18:17:15 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/client-scopes",
|
2020-10-28 18:17:15 +00:00
|
|
|
component: ClientScopesSection,
|
|
|
|
breadcrumb: t("client-scopes:clientScopeList"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/roles",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: RealmRolesSection,
|
|
|
|
breadcrumb: t("roles:roleList"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2020-12-02 21:04:54 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/roles/add-role",
|
2020-12-04 20:37:29 +00:00
|
|
|
component: RealmRoleTabs,
|
2020-12-02 21:04:54 +00:00
|
|
|
breadcrumb: t("roles:createRole"),
|
|
|
|
access: "manage-realm",
|
|
|
|
},
|
2020-11-18 21:52:18 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/roles/:id",
|
2020-12-04 20:37:29 +00:00
|
|
|
component: RealmRoleTabs,
|
2020-11-18 21:52:18 +00:00
|
|
|
breadcrumb: t("roles:roleDetails"),
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-01-13 20:47:40 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/roles/:id/:tab",
|
|
|
|
component: RealmRoleTabs,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
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,
|
|
|
|
breadcrumb: t("users:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "query-users",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/groups",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: GroupsSection,
|
2021-01-12 14:00:44 +00:00
|
|
|
breadcrumb: null,
|
|
|
|
matchOptions: {
|
|
|
|
exact: false,
|
|
|
|
},
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "query-groups",
|
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,
|
|
|
|
breadcrumb: t("sessions:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/events",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: EventsSection,
|
|
|
|
breadcrumb: t("events:title"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-events",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2021-01-13 20:47:40 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/events/:tab",
|
|
|
|
component: EventsSection,
|
|
|
|
breadcrumb: null,
|
|
|
|
access: "view-events",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/realm-settings",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: RealmSettingsSection,
|
|
|
|
breadcrumb: t("realmSettings"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/authentication",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: AuthenticationSection,
|
|
|
|
breadcrumb: t("authentication"),
|
2020-10-21 11:31:41 +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,
|
|
|
|
breadcrumb: t("identityProviders"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-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,
|
|
|
|
breadcrumb: 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/ldap",
|
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,
|
|
|
|
breadcrumb: t("common:settings"),
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
2020-12-16 07:02:41 +00:00
|
|
|
{
|
2021-01-05 19:49:33 +00:00
|
|
|
path: "/:realm/user-federation/ldap/:id",
|
2020-12-16 07:02:41 +00:00
|
|
|
component: UserFederationLdapSettings,
|
|
|
|
breadcrumb: t("common:settings"),
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-01-05 19:49:33 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/",
|
|
|
|
component: ClientsSection,
|
|
|
|
breadcrumb: t("common:home"),
|
|
|
|
access: "anyone",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
component: ClientsSection,
|
|
|
|
breadcrumb: 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
|
|
|
},
|
|
|
|
];
|