2022-06-25 15:44:17 +00:00
|
|
|
import "@goauthentik/web/pages/admin-overview/AdminOverviewPage";
|
|
|
|
|
2021-09-21 09:19:26 +00:00
|
|
|
import { html } from "lit";
|
2020-12-01 16:41:27 +00:00
|
|
|
|
2021-10-28 07:48:51 +00:00
|
|
|
import { ID_REGEX, Route, SLUG_REGEX, UUID_REGEX } from "./elements/router/Route";
|
2020-12-02 14:44:40 +00:00
|
|
|
|
2020-12-01 16:41:27 +00:00
|
|
|
export const ROUTES: Route[] = [
|
|
|
|
// Prevent infinite Shell loops
|
2021-09-16 15:30:16 +00:00
|
|
|
new Route(new RegExp("^/$")).redirect("/administration/overview"),
|
|
|
|
new Route(new RegExp("^#.*")).redirect("/administration/overview"),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/library$")).redirect("/if/user/", true),
|
|
|
|
// statically imported since this is the default route
|
|
|
|
new Route(new RegExp("^/administration/overview$"), async () => {
|
|
|
|
return html`<ak-admin-overview></ak-admin-overview>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/administration/dashboard/users$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/admin-overview/DashboardUserPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-admin-dashboard-users></ak-admin-dashboard-users>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/administration/system-tasks$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/system-tasks/SystemTaskListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-system-task-list></ak-system-task-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/core/providers$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/providers/ProviderListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-provider-list></ak-provider-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/core/providers/(?<id>${ID_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/providers/ProviderViewPage");
|
2021-02-16 19:00:34 +00:00
|
|
|
return html`<ak-provider-view .providerID=${parseInt(args.id, 10)}></ak-provider-view>`;
|
2021-02-04 08:54:00 +00:00
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/core/applications$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/applications/ApplicationListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-application-list></ak-application-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/core/applications/(?<slug>${SLUG_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/applications/ApplicationViewPage");
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-application-view .applicationSlug=${args.slug}></ak-application-view>`;
|
2020-12-01 16:41:27 +00:00
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/core/sources$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/sources/SourceListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-source-list></ak-source-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/core/sources/(?<slug>${SLUG_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/sources/SourceViewPage");
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-source-view .sourceSlug=${args.slug}></ak-source-view>`;
|
2020-12-12 18:39:09 +00:00
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/core/property-mappings$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/property-mappings/PropertyMappingListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-property-mapping-list></ak-property-mapping-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/core/tokens$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/tokens/TokenListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-token-list></ak-token-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/core/tenants$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/tenants/TenantListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-tenant-list></ak-tenant-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/policy/policies$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/policies/PolicyListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-policy-list></ak-policy-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/policy/reputation$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/policies/reputation/ReputationListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-policy-reputation-list></ak-policy-reputation-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/identity/groups$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/groups/GroupListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-group-list></ak-group-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/identity/groups/(?<uuid>${UUID_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/groups/GroupViewPage");
|
2022-02-26 15:55:22 +00:00
|
|
|
return html`<ak-group-view .groupId=${args.uuid}></ak-group-view>`;
|
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/identity/users$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/users/UserListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-user-list></ak-user-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/identity/users/(?<id>${ID_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/users/UserViewPage");
|
2021-03-20 15:37:31 +00:00
|
|
|
return html`<ak-user-view .userId=${parseInt(args.id, 10)}></ak-user-view>`;
|
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/flow/stages/invitations$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/stages/invitation/InvitationListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-stage-invitation-list></ak-stage-invitation-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/flow/stages/prompts$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/stages/prompt/PromptListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-stage-prompt-list></ak-stage-prompt-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/flow/stages$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/stages/StageListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-stage-list></ak-stage-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/flow/flows$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/flows/FlowListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-flow-list></ak-flow-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/flow/flows/(?<slug>${SLUG_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/flows/FlowViewPage");
|
2021-02-16 19:34:15 +00:00
|
|
|
return html`<ak-flow-view .flowSlug=${args.slug}></ak-flow-view>`;
|
2020-12-12 18:39:09 +00:00
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/events/log$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/events/EventListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-event-list></ak-event-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp(`^/events/log/(?<id>${UUID_REGEX})$`), async (args) => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/events/EventInfoPage");
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-event-info-page .eventID=${args.id}></ak-event-info-page>`;
|
2021-02-04 20:28:01 +00:00
|
|
|
}),
|
2022-05-14 15:07:37 +00:00
|
|
|
new Route(new RegExp("^/events/transports$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/events/TransportListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-event-transport-list></ak-event-transport-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/events/rules$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/events/RuleListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-event-rule-list></ak-event-rule-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/outpost/outposts$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/outposts/OutpostListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-outpost-list></ak-outpost-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/outpost/integrations$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/outposts/ServiceConnectionListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-outpost-service-connection-list></ak-outpost-service-connection-list>`;
|
|
|
|
}),
|
|
|
|
new Route(new RegExp("^/crypto/certificates$"), async () => {
|
2022-07-01 14:56:23 +00:00
|
|
|
await import("@goauthentik/web/pages/crypto/CertificateKeyPairListPage");
|
2022-05-14 15:07:37 +00:00
|
|
|
return html`<ak-crypto-certificate-list></ak-crypto-certificate-list>`;
|
|
|
|
}),
|
2020-12-01 16:41:27 +00:00
|
|
|
];
|