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 { NewRoleForm } from "./realm-roles/add/NewRoleForm";
|
|
|
|
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-10-21 11:31:41 +00:00
|
|
|
|
|
|
|
export type RouteDef = {
|
|
|
|
path: string;
|
|
|
|
component: () => JSX.Element;
|
|
|
|
breadcrumb: TFunction | "";
|
|
|
|
access: AccessType;
|
|
|
|
};
|
|
|
|
|
|
|
|
type RoutesFn = (t: TFunction) => RouteDef[];
|
|
|
|
|
|
|
|
export const routes: RoutesFn = (t: TFunction) => [
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
|
|
|
path: "/add-realm",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/clients/:id",
|
2020-11-02 20:15:09 +00:00
|
|
|
component: ClientDetails,
|
2020-10-01 14:25:29 +00:00
|
|
|
breadcrumb: t("clients:clientSettings"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-clients",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
2020-10-28 18:17:15 +00:00
|
|
|
{
|
|
|
|
path: "/clients",
|
|
|
|
component: ClientsSection,
|
|
|
|
breadcrumb: t("clients:clientList"),
|
|
|
|
access: "query-clients",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
|
|
|
path: "/add-client",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/import-client",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
2020-10-21 17:38:11 +00:00
|
|
|
path: "/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
|
|
|
{
|
|
|
|
path: "/client-scopes/:id",
|
|
|
|
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
|
|
|
},
|
2020-10-21 17:38:11 +00:00
|
|
|
{
|
|
|
|
path: "/client-scopes/:scopeId/:id",
|
|
|
|
component: MappingDetails,
|
|
|
|
breadcrumb: t("client-scopes:mappingDetails"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/client-scopes/:id",
|
|
|
|
component: ClientScopeForm,
|
|
|
|
breadcrumb: t("client-scopes:clientScopeDetails"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-10-28 18:17:15 +00:00
|
|
|
{
|
|
|
|
path: "/client-scopes",
|
|
|
|
component: ClientScopesSection,
|
|
|
|
breadcrumb: t("client-scopes:clientScopeList"),
|
|
|
|
access: "view-clients",
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
2020-10-14 20:50:10 +00:00
|
|
|
path: "/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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/add-role",
|
|
|
|
component: NewRoleForm,
|
|
|
|
breadcrumb: t("roles:createRole"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "manage-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/users",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/groups",
|
|
|
|
component: GroupsSection,
|
|
|
|
breadcrumb: t("groups"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "query-groups",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/sessions",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/events",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/realm-settings",
|
|
|
|
component: RealmSettingsSection,
|
|
|
|
breadcrumb: t("realmSettings"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/authentication",
|
|
|
|
component: AuthenticationSection,
|
|
|
|
breadcrumb: t("authentication"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/identity-providers",
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/user-federation",
|
|
|
|
component: UserFederationSection,
|
|
|
|
breadcrumb: t("userFederation"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "view-realm",
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
component: PageNotFoundSection,
|
|
|
|
breadcrumb: "",
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "anyone",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
];
|