forked from Yara724/api
Enforce claim beneficiary access and retire unused legacy APIs
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { InjectModel } from "@nestjs/mongoose";
|
||||
import { isAxiosError, type AxiosResponse } from "axios";
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { Model, Types } from "mongoose";
|
||||
import { randomBytes } from "node:crypto";
|
||||
import type { FanavaranAuditSession } from "./fanavaran-audit.types";
|
||||
import {
|
||||
FanavaranAuditLog,
|
||||
FanavaranAuditLogDocument,
|
||||
FanavaranAuditStatus,
|
||||
FanavaranAuditStep,
|
||||
} from "./schema/fanavaran-audit-log.schema";
|
||||
import type { FanavaranAuditSession } from "./fanavaran-audit.types";
|
||||
|
||||
export interface RecordFanavaranAuditStepInput {
|
||||
session: FanavaranAuditSession;
|
||||
@@ -104,9 +104,7 @@ export class FanavaranAuditService {
|
||||
const lower = key.toLowerCase();
|
||||
if (FanavaranAuditService.SENSITIVE_HEADER_KEYS.has(lower)) {
|
||||
out[key] =
|
||||
typeof rawValue === "string"
|
||||
? this.maskToken(rawValue)
|
||||
: "***";
|
||||
typeof rawValue === "string" ? this.maskToken(rawValue) : "***";
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
@@ -301,14 +299,6 @@ export class FanavaranAuditService {
|
||||
}
|
||||
}
|
||||
|
||||
async findByTrackingCode(trackingCode: string) {
|
||||
return this.auditModel
|
||||
.find({ trackingCode })
|
||||
.sort({ createdAt: 1 })
|
||||
.lean()
|
||||
.exec();
|
||||
}
|
||||
|
||||
private maskSensitiveDeep(value: unknown, depth = 0): unknown {
|
||||
if (depth > 8) {
|
||||
return "[max-depth]";
|
||||
|
||||
Reference in New Issue
Block a user