Add Legal Office seal and complete Azure CDN deployment
- Add Legal Office of the Master seal (SVG design with Maltese Cross, scales of justice, legal scroll) - Create legal-office-manifest-template.json for Legal Office credentials - Update SEAL_MAPPING.md and DESIGN_GUIDE.md with Legal Office seal documentation - Complete Azure CDN infrastructure deployment: - Resource group, storage account, and container created - 17 PNG seal files uploaded to Azure Blob Storage - All manifest templates updated with Azure URLs - Configuration files generated (azure-cdn-config.env) - Add comprehensive Azure CDN setup scripts and documentation - Fix manifest URL generation to prevent double slashes - Verify all seals accessible via HTTPS
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Handles secure VDR, deal rooms, and document access control
|
||||
*/
|
||||
|
||||
import Fastify from 'fastify';
|
||||
import Fastify, { type FastifyRequest, type FastifyReply } from 'fastify';
|
||||
import fastifySwagger from '@fastify/swagger';
|
||||
import fastifySwaggerUI from '@fastify/swagger-ui';
|
||||
import {
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
authenticateJWT,
|
||||
requireRole,
|
||||
} from '@the-order/shared';
|
||||
import { CreateDealSchema, DealSchema, CreateDocumentSchema } from '@the-order/schemas';
|
||||
import { CreateDealSchema, CreateDocumentSchema } from '@the-order/schemas';
|
||||
import { StorageClient } from '@the-order/storage';
|
||||
import {
|
||||
getPool,
|
||||
@@ -25,14 +25,14 @@ import {
|
||||
getDealById,
|
||||
createDealDocument,
|
||||
createDocument,
|
||||
getDocumentById,
|
||||
} from '@the-order/database';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
const logger = createLogger('dataroom-service');
|
||||
|
||||
const server = Fastify({
|
||||
logger,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const server: any = Fastify({
|
||||
logger: logger as any,
|
||||
requestIdLogLabel: 'requestId',
|
||||
disableRequestLogging: false,
|
||||
});
|
||||
@@ -78,10 +78,10 @@ async function initializeServer(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
await registerSecurityPlugins(server);
|
||||
addCorrelationId(server);
|
||||
addRequestLogging(server);
|
||||
server.setErrorHandler(errorHandler);
|
||||
await registerSecurityPlugins(server as any);
|
||||
addCorrelationId(server as any);
|
||||
addRequestLogging(server as any);
|
||||
server.setErrorHandler(errorHandler as any);
|
||||
}
|
||||
|
||||
// Health check
|
||||
@@ -122,7 +122,8 @@ server.get(
|
||||
server.post(
|
||||
'/deals',
|
||||
{
|
||||
preHandler: [authenticateJWT, requireRole('admin', 'deal_manager')],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
preHandler: [authenticateJWT as any, requireRole('admin', 'deal_manager') as any],
|
||||
schema: {
|
||||
...createBodySchema(CreateDealSchema),
|
||||
description: 'Create a new deal room',
|
||||
@@ -139,9 +140,9 @@ server.post(
|
||||
},
|
||||
},
|
||||
},
|
||||
async (request, reply) => {
|
||||
async (request: FastifyRequest, reply: FastifyReply) => {
|
||||
const body = request.body as { name: string; status?: string };
|
||||
const userId = request.user?.id;
|
||||
const userId = (request as any).user?.id;
|
||||
|
||||
const deal = await createDeal({
|
||||
name: body.name,
|
||||
@@ -158,7 +159,8 @@ server.post(
|
||||
server.get(
|
||||
'/deals/:dealId',
|
||||
{
|
||||
preHandler: [authenticateJWT],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
preHandler: [authenticateJWT as any],
|
||||
schema: {
|
||||
description: 'Get a deal room by ID',
|
||||
tags: ['deals'],
|
||||
@@ -181,7 +183,7 @@ server.get(
|
||||
},
|
||||
},
|
||||
},
|
||||
async (request, reply) => {
|
||||
async (request: FastifyRequest, reply: FastifyReply) => {
|
||||
const { dealId } = request.params as { dealId: string };
|
||||
|
||||
const deal = await getDealById(dealId);
|
||||
@@ -197,7 +199,8 @@ server.get(
|
||||
server.post(
|
||||
'/deals/:dealId/documents',
|
||||
{
|
||||
preHandler: [authenticateJWT, requireRole('admin', 'deal_manager', 'editor')],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
preHandler: [authenticateJWT as any, requireRole('admin', 'deal_manager', 'editor') as any],
|
||||
schema: {
|
||||
...createBodySchema(CreateDocumentSchema),
|
||||
description: 'Upload a document to a deal room',
|
||||
@@ -221,10 +224,10 @@ server.post(
|
||||
},
|
||||
},
|
||||
},
|
||||
async (request, reply) => {
|
||||
async (request: FastifyRequest, reply: FastifyReply) => {
|
||||
const { dealId } = request.params as { dealId: string };
|
||||
const body = request.body as { title: string; type: string; content?: string; fileUrl?: string };
|
||||
const userId = request.user?.id;
|
||||
const userId = (request as any).user?.id;
|
||||
|
||||
// Verify deal exists
|
||||
const deal = await getDealById(dealId);
|
||||
@@ -270,7 +273,8 @@ server.post(
|
||||
server.get(
|
||||
'/deals/:dealId/documents/:documentId/url',
|
||||
{
|
||||
preHandler: [authenticateJWT],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
preHandler: [authenticateJWT as any],
|
||||
schema: {
|
||||
description: 'Get a presigned URL for document access',
|
||||
tags: ['documents'],
|
||||
@@ -299,7 +303,7 @@ server.get(
|
||||
},
|
||||
},
|
||||
},
|
||||
async (request, reply) => {
|
||||
async (request: FastifyRequest, _reply: FastifyReply) => {
|
||||
const { dealId, documentId } = request.params as { dealId: string; documentId: string };
|
||||
const { expiresIn = 3600 } = request.query as { expiresIn?: number };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user