mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-08-27 11:07:03 +00:00
Update LDAP query builder page with improved UI and enhanced data handling.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/2e4d1f49-f8e4-412c-90f9-c80cf2b05b1f.jpg
This commit is contained in:
@@ -278,3 +278,5 @@ export function DashboardLayout({ children, title, description }: DashboardLayou
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DashboardLayout;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+19
-9
@@ -1,4 +1,4 @@
|
|||||||
import type { Express, Request, Response, NextFunction } from "express";
|
import type { Express, Request as ExpressRequest, Response, NextFunction } from "express";
|
||||||
import { createServer, type Server } from "http";
|
import { createServer, type Server } from "http";
|
||||||
import { setupAuth } from "./auth";
|
import { setupAuth } from "./auth";
|
||||||
import { setupSwagger } from "./swagger";
|
import { setupSwagger } from "./swagger";
|
||||||
@@ -13,6 +13,16 @@ import {
|
|||||||
initializeRBAC
|
initializeRBAC
|
||||||
} from "./authorization";
|
} from "./authorization";
|
||||||
|
|
||||||
|
// Extend Express Request to include user property
|
||||||
|
interface Request extends ExpressRequest {
|
||||||
|
user: {
|
||||||
|
id: number;
|
||||||
|
username: string;
|
||||||
|
roleId?: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export async function registerRoutes(app: Express): Promise<Server> {
|
export async function registerRoutes(app: Express): Promise<Server> {
|
||||||
// Setup authentication
|
// Setup authentication
|
||||||
const { authenticateApiToken } = setupAuth(app);
|
const { authenticateApiToken } = setupAuth(app);
|
||||||
@@ -1167,7 +1177,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/api/connections/:connectionId/ldap-filters", requireAuth, async (req, res, next) => {
|
app.get("/api/connections/:connectionId/ldap-filters", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const connectionId = parseInt(req.params.connectionId);
|
const connectionId = parseInt(req.params.connectionId);
|
||||||
|
|
||||||
@@ -1233,7 +1243,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 401:
|
* 401:
|
||||||
* $ref: '#/components/responses/UnauthorizedError'
|
* $ref: '#/components/responses/UnauthorizedError'
|
||||||
*/
|
*/
|
||||||
app.post("/api/connections/:connectionId/ldap-filters", requireAuth, async (req, res, next) => {
|
app.post("/api/connections/:connectionId/ldap-filters", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const connectionId = parseInt(req.params.connectionId);
|
const connectionId = parseInt(req.params.connectionId);
|
||||||
|
|
||||||
@@ -1282,7 +1292,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 404:
|
* 404:
|
||||||
* $ref: '#/components/responses/NotFoundError'
|
* $ref: '#/components/responses/NotFoundError'
|
||||||
*/
|
*/
|
||||||
app.get("/api/ldap-filters/:id", requireAuth, async (req, res, next) => {
|
app.get("/api/ldap-filters/:id", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const id = parseInt(req.params.id);
|
const id = parseInt(req.params.id);
|
||||||
const filter = await storage.getLdapFilter(id);
|
const filter = await storage.getLdapFilter(id);
|
||||||
@@ -1342,7 +1352,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 404:
|
* 404:
|
||||||
* $ref: '#/components/responses/NotFoundError'
|
* $ref: '#/components/responses/NotFoundError'
|
||||||
*/
|
*/
|
||||||
app.put("/api/ldap-filters/:id", requireAuth, async (req, res, next) => {
|
app.put("/api/ldap-filters/:id", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const id = parseInt(req.params.id);
|
const id = parseInt(req.params.id);
|
||||||
|
|
||||||
@@ -1386,7 +1396,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 404:
|
* 404:
|
||||||
* $ref: '#/components/responses/NotFoundError'
|
* $ref: '#/components/responses/NotFoundError'
|
||||||
*/
|
*/
|
||||||
app.delete("/api/ldap-filters/:id", requireAuth, async (req, res, next) => {
|
app.delete("/api/ldap-filters/:id", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const id = parseInt(req.params.id);
|
const id = parseInt(req.params.id);
|
||||||
|
|
||||||
@@ -1439,7 +1449,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 404:
|
* 404:
|
||||||
* $ref: '#/components/responses/NotFoundError'
|
* $ref: '#/components/responses/NotFoundError'
|
||||||
*/
|
*/
|
||||||
app.get("/api/ldap-filters/:filterId/revisions", requireAuth, async (req, res, next) => {
|
app.get("/api/ldap-filters/:filterId/revisions", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const filterId = parseInt(req.params.filterId);
|
const filterId = parseInt(req.params.filterId);
|
||||||
|
|
||||||
@@ -1487,7 +1497,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 404:
|
* 404:
|
||||||
* $ref: '#/components/responses/NotFoundError'
|
* $ref: '#/components/responses/NotFoundError'
|
||||||
*/
|
*/
|
||||||
app.post("/api/ldap-filters/:filterId/revert/:revisionId", requireAuth, async (req, res, next) => {
|
app.post("/api/ldap-filters/:filterId/revert/:revisionId", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const filterId = parseInt(req.params.filterId);
|
const filterId = parseInt(req.params.filterId);
|
||||||
const revisionId = parseInt(req.params.revisionId);
|
const revisionId = parseInt(req.params.revisionId);
|
||||||
@@ -1565,7 +1575,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
* 401:
|
* 401:
|
||||||
* $ref: '#/components/responses/UnauthorizedError'
|
* $ref: '#/components/responses/UnauthorizedError'
|
||||||
*/
|
*/
|
||||||
app.post("/api/connections/:connectionId/test-ldap-filter", requireAuth, async (req, res, next) => {
|
app.post("/api/connections/:connectionId/test-ldap-filter", requireAuth, async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const connectionId = parseInt(req.params.connectionId);
|
const connectionId = parseInt(req.params.connectionId);
|
||||||
const { ldapFilter, objectClass } = req.body;
|
const { ldapFilter, objectClass } = req.body;
|
||||||
|
|||||||
Reference in New Issue
Block a user