keycloak-scim/src/route-config.ts

265 lines
7.3 KiB
TypeScript
Raw Normal View History

import { TFunction } from "i18next";
import { BreadcrumbsRoute } from "use-react-router-breadcrumbs";
import { AccessType } from "keycloak-admin/lib/defs/whoAmIRepresentation";
import { AuthenticationSection } from "./authentication/AuthenticationSection";
import { ClientScopeForm } from "./client-scopes/form/ClientScopeForm";
import { ClientScopesSection } from "./client-scopes/ClientScopesSection";
import { DashboardSection } from "./dashboard/Dashboard";
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";
import { MappingDetails } from "./client-scopes/details/MappingDetails";
import { ClientDetails } from "./clients/ClientDetails";
2021-03-03 13:53:42 +00:00
import { UsersTabs } from "./user/UsersTabs";
import { UserFederationKerberosSettings } from "./user-federation/UserFederationKerberosSettings";
import { UserFederationLdapSettings } from "./user-federation/UserFederationLdapSettings";
import { RoleMappingForm } from "./client-scopes/add/RoleMappingForm";
import { RealmRoleTabs } from "./realm-roles/RealmRoleTabs";
import { SearchGroups } from "./groups/SearchGroups";
export type RouteDef = BreadcrumbsRoute & {
access: AccessType;
component: () => JSX.Element;
};
type RoutesFn = (t: TFunction) => RouteDef[];
export const routes: RoutesFn = (t: TFunction) => [
{
path: "/:realm/add-realm",
component: NewRealmForm,
breadcrumb: t("realm:createRealm"),
access: "manage-realm",
},
{
path: "/:realm/clients",
component: ClientsSection,
breadcrumb: t("clients:clientList"),
access: "query-clients",
},
{
path: "/:realm/clients/add-client",
component: NewClientForm,
breadcrumb: t("clients:createClient"),
access: "manage-clients",
},
{
path: "/:realm/clients/import-client",
component: ImportForm,
breadcrumb: t("clients:importClient"),
access: "manage-clients",
},
{
path: "/:realm/clients/:clientId/roles/add-role",
component: RealmRoleTabs,
breadcrumb: t("roles:createRole"),
access: "manage-realm",
},
{
path: "/:realm/clients/:clientId/roles/:id",
component: RealmRoleTabs,
breadcrumb: t("roles:roleDetails"),
access: "view-realm",
},
{
path: "/:realm/clients/:clientId/roles/:id/:tab",
component: RealmRoleTabs,
breadcrumb: null,
access: "view-realm",
},
{
path: "/:realm/clients/:clientId/:tab",
component: ClientDetails,
breadcrumb: t("clients:clientSettings"),
access: "view-clients",
},
{
path: "/:realm/client-scopes/new",
component: ClientScopeForm,
breadcrumb: t("client-scopes:createClientScope"),
access: "manage-clients",
},
{
path: "/:realm/client-scopes/:id/mappers/oidc-role-name-mapper",
component: RoleMappingForm,
breadcrumb: t("client-scopes:mappingDetails"),
access: "view-clients",
},
{
path: "/:realm/client-scopes/:id/mappers/:mapperId",
component: MappingDetails,
breadcrumb: t("client-scopes:mappingDetails"),
access: "view-clients",
},
{
path: "/:realm/client-scopes/:id/:tab",
component: ClientScopeForm,
breadcrumb: t("client-scopes:clientScopeDetails"),
access: "view-clients",
},
{
path: "/:realm/client-scopes",
component: ClientScopesSection,
breadcrumb: t("client-scopes:clientScopeList"),
access: "view-clients",
},
{
path: "/:realm/roles",
component: RealmRolesSection,
breadcrumb: t("roles:roleList"),
access: "view-realm",
},
{
path: "/:realm/roles/add-role",
component: RealmRoleTabs,
breadcrumb: t("roles:createRole"),
access: "manage-realm",
},
Adds realm role details tab to storybook (#217) * parent 9eabcdbee40ec3bf125f4604bd5fb04c42b91dd9 author jenny-s51 <jshandel12@gmail.com> 1602688597 -0400 committer jenny-s51 <jshandel12@gmail.com> 1605296992 -0500 add file for realm role details add details and attributes tabs clean up a bit get name working add reload fix route config fix prettier add storybook demo for realm details add details and attributes tabs * parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297630 -0500 parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297556 -0500 parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297545 -0500 parent 9eabcdbee40ec3bf125f4604bd5fb04c42b91dd9 author jenny-s51 <jshandel12@gmail.com> 1602688597 -0400 committer jenny-s51 <jshandel12@gmail.com> 1605296992 -0500 add file for realm role details add details and attributes tabs clean up a bit get name working add reload fix route config fix prettier add storybook demo for realm details add details and attributes tabs clean up a bit clean up a bit add reload fix route config add storybook demo for realm details Delete messages.json cleaning up, wip fix CI clean up more * add back role messages * fix format * revert role list to master * remove reload * fix spacing and add FormAccess component * fix route * fix formatting
2020-11-18 21:52:18 +00:00
{
path: "/:realm/roles/:id",
component: RealmRoleTabs,
Adds realm role details tab to storybook (#217) * parent 9eabcdbee40ec3bf125f4604bd5fb04c42b91dd9 author jenny-s51 <jshandel12@gmail.com> 1602688597 -0400 committer jenny-s51 <jshandel12@gmail.com> 1605296992 -0500 add file for realm role details add details and attributes tabs clean up a bit get name working add reload fix route config fix prettier add storybook demo for realm details add details and attributes tabs * parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297630 -0500 parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297556 -0500 parent 95101205603aec53689aa61488ffb4820591b8d1 author jenny-s51 <jshandel12@gmail.com> 1604507462 -0500 committer jenny-s51 <jshandel12@gmail.com> 1605297545 -0500 parent 9eabcdbee40ec3bf125f4604bd5fb04c42b91dd9 author jenny-s51 <jshandel12@gmail.com> 1602688597 -0400 committer jenny-s51 <jshandel12@gmail.com> 1605296992 -0500 add file for realm role details add details and attributes tabs clean up a bit get name working add reload fix route config fix prettier add storybook demo for realm details add details and attributes tabs clean up a bit clean up a bit add reload fix route config add storybook demo for realm details Delete messages.json cleaning up, wip fix CI clean up more * add back role messages * fix format * revert role list to master * remove reload * fix spacing and add FormAccess component * fix route * fix formatting
2020-11-18 21:52:18 +00:00
breadcrumb: t("roles:roleDetails"),
access: "view-realm",
},
{
path: "/:realm/roles/:id/:tab",
component: RealmRoleTabs,
breadcrumb: null,
access: "view-realm",
},
{
path: "/:realm/users",
component: UsersSection,
breadcrumb: t("users:title"),
access: "query-users",
},
2021-03-03 13:53:42 +00:00
{
path: "/:realm/users/add-user",
component: UsersTabs,
breadcrumb: t("users:createUser"),
access: "manage-users",
},
{
path: "/:realm/sessions",
component: SessionsSection,
breadcrumb: t("sessions:title"),
access: "view-realm",
},
{
path: "/:realm/events",
component: EventsSection,
breadcrumb: t("events:title"),
access: "view-events",
},
{
path: "/:realm/events/:tab",
component: EventsSection,
breadcrumb: null,
access: "view-events",
},
{
path: "/:realm/realm-settings",
component: RealmSettingsSection,
breadcrumb: t("realmSettings"),
access: "view-realm",
},
{
path: "/:realm/authentication",
component: AuthenticationSection,
breadcrumb: t("authentication"),
access: "view-realm",
},
{
path: "/:realm/identity-providers",
component: IdentityProvidersSection,
breadcrumb: t("identityProviders"),
access: "view-identity-providers",
},
{
path: "/:realm/user-federation",
component: UserFederationSection,
breadcrumb: t("userFederation"),
access: "view-realm",
},
{
path: "/:realm/user-federation/kerberos",
component: UserFederationSection,
breadcrumb: null,
access: "view-realm",
},
{
path: "/:realm/user-federation/ldap",
component: UserFederationSection,
breadcrumb: null,
access: "view-realm",
},
{
path: "/:realm/user-federation/kerberos/:id",
component: UserFederationKerberosSettings,
breadcrumb: t("common:settings"),
access: "view-realm",
},
2021-02-09 18:01:23 +00:00
{
path: "/:realm/user-federation/kerberos/new",
component: UserFederationKerberosSettings,
breadcrumb: t("common:settings"),
access: "view-realm",
},
{
path: "/:realm/user-federation/ldap/:id",
component: UserFederationLdapSettings,
breadcrumb: t("common:settings"),
access: "view-realm",
},
2021-02-09 18:01:23 +00:00
{
path: "/:realm/user-federation/ldap/new",
component: UserFederationLdapSettings,
breadcrumb: t("common:settings"),
access: "view-realm",
},
{
path: "/:realm/",
component: DashboardSection,
breadcrumb: t("common:home"),
access: "anyone",
},
{
path: "/:realm/groups/search",
component: SearchGroups,
breadcrumb: t("groups:searchGroups"),
access: "query-groups",
},
{
path: "/:realm/groups",
component: GroupsSection,
breadcrumb: null,
matchOptions: {
exact: false,
},
access: "query-groups",
},
{
path: "/",
component: DashboardSection,
breadcrumb: t("common:home"),
access: "anyone",
},
{
path: "*",
component: PageNotFoundSection,
breadcrumb: null,
access: "anyone",
},
];