Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m12s
CI/CD Pipeline / Security Scanning (push) Successful in 2m21s
CI/CD Pipeline / Lint and Format (push) Failing after 36s
CI/CD Pipeline / Terraform Validation (push) Failing after 22s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 25s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 23s
Validation / validate-genesis (push) Successful in 26s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m15s
Validation / validate-documentation (push) Failing after 15s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 26s
Verify Deployment / Verify Deployment (push) Failing after 56s
Add operator settlement terminal UI/API, swift-listener service, compliance idempotency gates, GRU reserve dashboards, and @dbis/integration-foundation for typed HYBX/ISO adapter contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.redactMetadata = redactMetadata;
|
|
exports.createAuditEvent = createAuditEvent;
|
|
const SENSITIVE_KEY_PATTERNS = [
|
|
/password/i,
|
|
/secret/i,
|
|
/token/i,
|
|
/api[_-]?key/i,
|
|
/private[_-]?key/i,
|
|
/credential/i,
|
|
/ssn/i,
|
|
/iban/i,
|
|
/email/i,
|
|
/phone/i,
|
|
/address/i,
|
|
];
|
|
const REDACTED = '[REDACTED]';
|
|
function isSensitiveKey(key) {
|
|
return SENSITIVE_KEY_PATTERNS.some((p) => p.test(key));
|
|
}
|
|
function redactMetadata(metadata) {
|
|
const out = {};
|
|
for (const [key, value] of Object.entries(metadata)) {
|
|
if (isSensitiveKey(key)) {
|
|
out[key] = REDACTED;
|
|
continue;
|
|
}
|
|
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
out[key] = redactMetadata(value);
|
|
}
|
|
else {
|
|
out[key] = value;
|
|
}
|
|
}
|
|
return out;
|
|
}
|
|
function createAuditEvent(partial) {
|
|
const { metadata, ...rest } = partial;
|
|
return {
|
|
...rest,
|
|
timestamp: new Date().toISOString(),
|
|
metadata_redacted: redactMetadata(metadata ?? {}),
|
|
};
|
|
}
|